Pinheiro
Pinheiro

Reputation: 17

How do I add a reaction to a specific message?

I would like the bot to react to a message that i have defined (in this case, the ID message "708780848853286962") but when i try to do that an error happens on the console, how do i proceed?

How am i doing:

let msg = '708780848853286962'
msg.react('👆')

Console error:

TypeError: msg.react is not a function

Upvotes: 0

Views: 215

Answers (1)

Syntle
Syntle

Reputation: 5174

You need to fetch that message first, as far as discord.js is concerned with your current code, you're just doing '708780848853286962'.react('👆').

You also need to know what channel the message is in.

const msg = client.channels.cache.get(CHANNEL_ID).messages.fetch('708780848853286962')
msg.react('👆')

Upvotes: 1

Related Questions