Javascript 删除消息。作者反应

Javascript 删除消息。作者反应,javascript,discord,discord.js,Javascript,Discord,Discord.js,我想消除用户在反应时的反应,只留下一个,机器人自己的反应 我已经看过一些关于这个的教程,但是我还没有找到这个方法 const test = new Discord.MessageEmbed() .setColor("random") .setTitle("help") .setDescription(`**this a test**`) message.channel.send(test).then(msg => {

我想消除用户在反应时的反应,只留下一个,机器人自己的反应

我已经看过一些关于这个的教程,但是我还没有找到这个方法

const test = new Discord.MessageEmbed()
    .setColor("random")
    .setTitle("help")
    .setDescription(`**this a test**`)

message.channel.send(test).then(msg => {
    msg.react('This code removes the reaction if the ID of the user that added the reaction is not your bot's ID. Replace 
<Client>
with whatever you've declared your Discord client as.

edit.on('collect', (r2, user) => {
    if (user.id !== <Client>.user.id) r2.remove().catch(console.log);

    test.setTitle("test edited");
    test.setDescription("edited");

    msg.edit(test);
});
const test=new Discord.MessageEmbed()
.setColor(“随机”)
.setTitle(“帮助”)
.setDescription(`**this a test**`)
message.channel.send(test).then(msg=>{

msg.react(“如果添加反应的用户的ID不是您的机器人的ID,则此代码将删除反应。用您声明的Discord客户端的ID替换

edit.on('collect',(r2,用户)=>{
if(user.id!=.user.id)r2.remove().catch(console.log);
测试。设置标题(“测试编辑”);
测试说明(“编辑”);
msg.edit(测试);
});

如果添加反应的用户的ID不是您的机器人的ID,则此代码将删除反应。将
替换为您声明的Discord客户端

edit.on('collect',(r2,用户)=>{
if(user.id!=.user.id)r2.remove().catch(console.log);
测试。设置标题(“测试编辑”);
测试说明(“编辑”);
msg.edit(测试);
});

它的工作,但它也删除了bot的,我希望它只删除用户的,仍然保留bot的反应。它不应该这样做。你确定你提供的if语句具有正确的bot ID吗?如果你能准确地看到你是如何将它添加到你的程序中的,那将非常有用。它的工作,但它也删除了bot的,我希望它只删除使用r's,仍然保留bot的反应它不应该这样做。您确定您提供的if语句具有正确的bot ID吗?查看您是如何将其添加到程序中的将非常有用。