本文介紹了discord.js 機器人回復自己的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我目前正在編寫我的第一個 discord 機器人,它已經可以播放 YouTube 音樂.
I am currently coding my first discord bot, it can already play YouTube music.
如您所見,如果有人輸入干得好"(這只是一個示例),那么機器人會回復每個人都干得好:smirk:),但隨后就會開始垃圾郵件:機器人會讀取自己的消息并回復它.
As you see, if someone types "good job" (this is just an example) then the bot will reply with "good job everyone :smirk:), but then the spam will begin: the bot reads his own message and replies to it.
如何防止機器人自己回答?
How can I prevent the bot from answering itself?
推薦答案
在 on message 事件中使用這個:
Use this in the on message event:
更多信息:https://anidiotsguide.gitbooks.io/discord-js-bot-guide/coding-guides/a-basic-command-handler.html
這篇關于discord.js 機器人回復自己的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!