1
votes

I'm trying to make my own bot for my server, for now i'm focusing on the verify. By acting to the check mark emoji it'll add the verified role, and then it should remove only the user reaction, but instead it'll remove every reaction right away

   client.on('messageReactionAdd', async (reactionReaction, user) => {
   
   const message = reactionReaction.message;
   const verifyChannel = message.guild.channels.cache.find(c => c.name === 'approvazione');
   const member = message.guild.members.cache.get(user.id);
   if (member.user.bot) return;
   const verify = message.guild.roles.cache.get('728000975046180988');
   

   if (reactionReaction.emoji.name === '✅' && message.channel.id === verifyChannel.id) {
    member.roles.add(verify).catch(console.error);
   await reactionReaction.remove(member).catch(console.error);
    
} 

here is the message sent by the bot with it's own reaction

and here is the same message after i reacted, and both mine and the bot reaction are removed, i just want my reaction to be removed

1

1 Answers

1
votes

If you look at the docs it takes no parameter for the user:

https://discord.js.org/#/docs/main/stable/class/MessageReaction?scrollTo=remove

This was changed in v12, the method now is to use .users.remove:

reactionReaction.users.remove(member);