本文介紹了Discord 機器人針對一個事件多次響應的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我希望我的機器人對 .on
等命令做出一次響應.但是,它每次輸入都會響應多次:
I want my bot to respond once to a command such as .on
. However, it responds multiple times per input:
代碼是:
client.on('message', message =>{
if(message.content === '.on'){
message.channel.sendMessage('Testing Bot is now Online, Greetings, ' + message.author.username);
}
如果有人能指出我正確的方向,讓機器人做出響應,那就太好了.
If anyone could point me in the right direction to make the bot respond once that would be great.
推薦答案
我來晚了,但我想你有多個 實例 您的機器人同時運行.
I'm late, but I think you had multiple instances of your bot running at the same time.
這篇關于Discord 機器人針對一個事件多次響應的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!