I am currently coding my first discord bot, it can already play YouTube music.(我目前正在编写我的第一个Discord机器人,它已经可以播放YouTube音乐。)
if (message.content.includes("Good Job") ||
message.content.includes("good job")) {
message.channel.sendMessage("Good Job everyone :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.(如您所见,如果有人键入“好工作”(这只是一个例子),则该机器人将以“每个人都好工作:smirk :)进行回复,但垃圾邮件将开始:该机器人读取自己的消息并对其进行回复。)
How can I prevent the bot from answering itself?(如何防止漫游器自行回答?)
ask by gitgudgithub translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…