![](/img/trans.png)
[英]How can I make it so that if a member repeats text sent by my bot, my bot sends a message back?
[英]My bot sends the same message several times in private
我已將我的機器人設置為在發送私人消息后發送每條消息,代碼:
client.on('message', async (message) => {
if (message.author.bot) return;
if(message.channel.type === 'dm') {
const dmembed = new DiscordJS.MessageEmbed()
.setTitle(`New Mail Colllected!`)
.setThumbnail(message.author.displayAvatarURL({dynamic: true}))
.setColor('BLUE')
.setTimestamp()
.setDescription(`**User:** ${message.author.tag} (\`${message.author.id}\`)\n**Date:** ${require("moment")(Date.now()).format("LLLL")}\n\n**Mail Content:** \`\`\`\n${message.content}\n\`\`\``)
.setFooter(`ID: ${message.author.id}`)
const dmchannel = client.channels.cache.get('851481340696068156')
dmchannel.send(dmembed)
}
})
問題是機器人多次修復房間,我嘗試修復它但效果不佳,我很樂意提供幫助
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.