本文介紹了Discord 機(jī)器人針對(duì)一個(gè)事件多次響應(yīng)的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
我希望我的機(jī)器人對(duì) .on
等命令做出一次響應(yīng).但是,它每次輸入都會(huì)響應(yīng)多次:
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);
}
如果有人能指出我正確的方向,讓機(jī)器人做出響應(yīng),那就太好了.
If anyone could point me in the right direction to make the bot respond once that would be great.
推薦答案
我來晚了,但我想你有多個(gè) 實(shí)例 您的機(jī)器人同時(shí)運(yùn)行.
I'm late, but I think you had multiple instances of your bot running at the same time.
這篇關(guān)于Discord 機(jī)器人針對(duì)一個(gè)事件多次響應(yīng)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!