IntFooBar
IntFooBar

Reputation: 312

DiscordJS How To Edit Messages?

So I am using discord.js v11.2.1 to edit messages, and I cannot simply figure out. I am trying to edit a message, from a different channel, and I am using TextChannel to fetchMessage(id) so I could edit.

new Discord().TextChannel.fetchMessage(message_id)
    .then(message => message.edit("new message"));

And my error is that Cannot read property 'client' of undefined. So what should I do?

Basically, I have a command which will send a message to another channel. And I want to use the command to edit the message from another channel.

Upvotes: 1

Views: 7202

Answers (1)

Axiumin_
Axiumin_

Reputation: 2145

It is because you are creating a new instance of the bot, making it return null.

Upvotes: 1

Related Questions