久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

我的 Discord.js 機(jī)器人正在運(yùn)行(在線并在控制臺中

My Discord.js bot is running (online and shows in console) but it won#39;t respond to commands(我的 Discord.js 機(jī)器人正在運(yùn)行(在線并在控制臺中顯示)但它不會響應(yīng)命令)
本文介紹了我的 Discord.js 機(jī)器人正在運(yùn)行(在線并在控制臺中顯示)但它不會響應(yīng)命令的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

所以,有一天我使用 TeamViewer 連接到我的 RPi3 并告訴它重新啟動.完成后,我連接到 pi,啟動了 bot,它看起來正常啟動.

So, one day I was using TeamViewer to connect to my RPi3 and told it to reboot. As soon as it finished, I connected to the pi, started the bot, and it looked like it was starting up properly.

當(dāng)我在 discord 上發(fā)送命令時,機(jī)器人沒有響應(yīng).機(jī)器人仍在運(yùn)行.

When I went to send a command on discord, the bot didn't respond. The bot is still running though.

我嘗試更改一些代碼,但沒有任何改變.

I tried changing some of the code, but nothing changed.

代碼如下:

[REMOVED]

可能是什么問題?

推薦答案

你的問題是你的 if 語句沒有阻塞.

Your problem is lack of blocking of your if statement.

if (message.channel instanceof Discord.DMChannel)
    message.channel.send("``Beep boop! Sorry, I can't respond to direct messages, but you can join the AKAS Gamer's Discord group here: https://discord.gg/QkjQNAr``");
    return

由于缺少括號,您的 return 將始終執(zhí)行,因?yàn)樗皇?if 語句的一部分.應(yīng)該是:

With the lack of bracketing, your return will always execute as it is not part of the if statement. It should be:

if (message.channel instanceof Discord.DMChannel) {
    message.channel.send("``Beep boop! Sorry, I can't respond to direct messages, but you can join the AKAS Gamer's Discord group here: https://discord.gg/QkjQNAr``");
    return
}

C 風(fēng)格語言中的常見建議是永遠(yuǎn)不要省略括號.進(jìn)入那個練習(xí).雖然從技術(shù)上講,單語句條件是允許的,但正如您在此處看到的那樣,它稍后會引起頭痛.

Common recommendation in C-style languages is to never omit the brackets. Get into that practice. While it is technically allowable for single statement conditionals, it will cause headaches later as you've seen here.

這篇關(guān)于我的 Discord.js 機(jī)器人正在運(yùn)行(在線并在控制臺中顯示)但它不會響應(yīng)命令的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

discord.js v12: How do I await for messages in a DM channel?(discord.js v12:我如何等待 DM 頻道中的消息?)
how to make my bot mention the person who gave that bot command(如何讓我的機(jī)器人提及發(fā)出該機(jī)器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復(fù)必須使用導(dǎo)入來加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來自特定服務(wù)器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復(fù)“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務(wù)器時的歡迎消息)
主站蜘蛛池模板: 久久九精品 | 亚洲欧美综合精品久久成人 | 国产aⅴ爽av久久久久久久 | 亚洲福利一区二区 | 天天宗合网 | 国产精品毛片一区二区在线看 | 91亚洲国产成人久久精品网站 | 91视频网址 | 久草新在线| 中文字幕免费在线 | 91黄在线观看 | 九九色综合 | 综合久久亚洲 | 午夜视频免费 | 精品久久国产 | 欧美成人免费在线 | 91人人爽 | 一区二区三区四区在线 | av一区二区在线观看 | 三级免费网 | 亚洲精品久久久一区二区三区 | 色婷婷久久久久swag精品 | 亚洲午夜精品在线观看 | 亚洲小说图片 | 欧美xxxx黑人又粗又长 | 性福视频在线观看 | 国产伦精品一区二区三区高清 | 在线午夜| 一级黄色录像毛片 | 日韩在线观看一区二区三区 | 一级片成人 | 久久久精品一区 | av资源网站| 91在线精品秘密一区二区 | 天啪| 日韩精品免费视频 | 国产91观看 | 8x国产精品视频一区二区 | 18av在线播放 | 91大神xh98xh系列全部 | 欧美一级片免费看 |