【发布时间】:2021-01-25 13:37:42
【问题描述】:
我创建了一个不和谐机器人,目标是生成带有表情符号按钮的反应式嵌入。我的问题是一旦按下“按钮”,使用机器人创建的所有嵌入都会同时修改。
下面是我的机器人的伪代码:
const raidEmbed = new Discord.MessageEmbed() //create the embed
//some code to fill the embed
message.channel.send(raidEmbed).then(embedMessage => {
embedMessage.react('❌')
.then(()=>embedMessage.react('⭕')
//more react to create all the 'buttons'
client.on('messageReactionAdd', (reaction, user) => {
//some code to do stuff when the right 'button' is pressed
//then reset the button with this code:
if (user.id !== client.user.id) {
reaction.users.remove(user.id);
}
const newEmbed = new Discord.MessageEmbed()
//code to create the new embed
embedMessage.edit(newEmbed);
}
})
我不明白为什么我的所有嵌入都链接在一起以及如何解决此问题。
【问题讨论】:
标签: discord.js embed