Reputation: 308
I would like to add a reaction to a message by message ID. For example, messageID.react('👍')
. Is there a way to do that?
Upvotes: 0
Views: 6639
Reputation: 340
messages.fetch()
returns a promise. So in order to react to the message fetched, you can do it in two ways.
Using .then()
:
channel.messages.fetch(msg).then(m => {
m.react("👍");
});
Using await
:
const m = await channel.messages.fetch(msg);
m.react("👍");
Upvotes: 4
Reputation: 308
Found the answere:
channelID.messages.fetch(MESSAGE_ID).then(function (message) { message.react("👍") })
Upvotes: 1
Reputation: 35512
You need to have the text channel the message is sent in, then you can just do:
channel.messages.fetch(messageId).react("👍");
Upvotes: 2