[discord.js] Listening for Reactions

How do I get the bot to send a message and then do something if someone reacted to a specific message?

You can use

to send a message to the channel that triggered the event. This could be a user message or a function that runs repeatedly overtime.

Then, you can use this event that triggers when the bot’s message gets reacted:

[BotClient].on(“messageReactionAdd”, (reaction, user) => {}
‘‘reaction’’ has ‘‘reaction.emoji’’ which is the reacted emoji, and ‘‘reaction.message’’ returns the original message that has been reacted.

With that you can do something like

if (reaction.emoji === “:blush:”)
if you want for the condition to be triggered with a specific emoji

1 Like

Thank you so much! And welcome to the community by the way! :slight_smile:

actually it’d be reaction.emoji.name


if (reaction.emoji.name === “”) {…}

Please don’t bump old posts and OP already found the answer. Also, this could be for a older version of discord.js and the API could be different.

1 Like