久久久久久久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ù)器時的歡迎消息)
主站蜘蛛池模板: 在线视频中文字幕 | 在线中文字幕视频 | 久久99国产精一区二区三区 | 中文字幕免费视频 | 99久久精品一区二区成人 | 99re热精品视频国产免费 | 福利视频网站 | 国产欧美一级二级三级在线视频 | 国产精品久久久久久妇女6080 | 激情久久久久 | 国产片网站| 超碰在线播 | 欧美视频成人 | 最新伦理片| 久久91精品国产一区二区三区 | 欧美mv日韩mv国产网站91进入 | www.亚洲.com | 国产激情视频网站 | 91看片网| 一本大道久久a久久精二百 国产成人免费在线 | 黄色a三级 | 久久精品国产99国产精品 | 午夜寂寞福利视频 | 国产精品久久精品 | 成人在线观看网站 | 国产91精品网站 | 久久久国产一区二区三区四区小说 | 欧美精品久久久久 | 午夜丰满少妇一级毛片 | 美女视频一区二区三区 | 久久免费小视频 | 二区欧美 | 天天看天天操 | 天堂久久网 | 偷派自拍 | 91精品中文字幕一区二区三区 | 在线一区二区三区 | 国产精品2 | 成人一区二区三区在线观看 | 日韩精品视频在线观看一区二区三区 | 精品一区二区三区四区外站 |