user14656140
user14656140

Reputation:

How do I edit a message inside of another channel by message ID?

I'm trying to edit a message that's in another channel that the bot can see, when you use the command from another channel.

I tried using this method but it didn't work. What's the new method since this one is probably outdated?

client.channels.cache.get('Channel ID').fetchMessage('Message ID').edit(embed);

Upvotes: 0

Views: 840

Answers (1)

Zsolt Meszaros
Zsolt Meszaros

Reputation: 23161

.fetchMessages() is now .messages.fetch() and it returns a promise:

  client.channels.cache
    .get('Channel ID')
    .messages.fetch('Message ID')
    .then((msg) => msg.edit(embed));

Upvotes: 1

Related Questions