Ylich
Ylich

Reputation: 70

How to react to a message by Id

I have the id of a message stored in my database, the message content is a request. After fullfilling the request I want to add a reaction to this message.

What I need is something like:


  message.get('OLD_MESSAGE_ID').react("👍");

But I've no idea how to achieve that.

Upvotes: 0

Views: 139

Answers (1)

Xge
Xge

Reputation: 450

You'll need the text channel the message is in.

var channel = guild.channels.get("CHANNEL_ID")

channel.fetchMessage("OLD_MESSAGE_ID")
 .then((message) => {

  message.react("👍")

 })

Upvotes: 1

Related Questions