Message Reactions

I’m making a JavaScript Discord bot, how do I do something when someone reacts to a certain emoji on a message? Please may I have some code?

This is a nice tutorial on how to make a basic reaction collector and await reactions

Tell us if you have a problem with it

I looked at that. How would I make it so the bot doesn’t trigger the code when it reacts?

Can you please explain what you’re wanting more? From what I understand, you want an event to be fired when someone reacts, but don’t want it to execute code.

no he wants the bot to react with all the reactions you can use to trigger but the but wouuld end up firing the code when it does

Hey there,
You may know Node.js events.
So, here’s what we are gonna do: the event messageReactionAdd triggers whenever someone reacts to a message. We’l; use that event to get the data required.

client.on('messageReactionAdd', (reaction, user) => {
// wallah!
// you can now access the property and methods of reaction as well as the user reacted on the message.

Cheers, for further queries feel free to mention me!

In that case, you would need to have the code block out bot accounts. Here’s an example:

client.on('messageReactionAdd', function(reaction, user) {
    if (! {
        //The following code will only run if the user is not a bot, therefore filering out the initial bot reactions.

Hope this answered your question!