vol1n
vol1n

Reputation: 31

Node.js, Discord.js - Why is the 'messageReactionAdd' listener being activated when the bot reacts but not a user?

channel.send({embeds: [embed]}).then(sent => {
  //sent.react('✅') 
  console.log('listener')
  client.on("messageReactionAdd", (messageReaction, user) => {
    console.log('y')
                                
    console.log(messageReaction)
    if (messageReaction.emoji.name == ':white_check_mark:' && user.id == buyer.id){
    } else {
      console.log('n')
    }
  })
})

When the bot reacts, it logs 'y' and the reaction object. When I on my main account react, the listener is not activated. Any guesses as to why?

Upvotes: 1

Views: 32

Answers (1)

theusaf
theusaf

Reputation: 1802

It is likely that your Client is missing Intents for GUILD_MESSAGE_REACTIONS. To listen to message reactions from others users in guilds, you have to specify the GUILD_MESSAGE_REACTIONS.

const Client = new Discord.Client({
  intents: ["GUILDS", "GUILD_MESSAEGES", "GUILD_MESSAGE_REACTIONS" /* etc */]
});

Upvotes: 1

Related Questions