Reputation: 312
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
Reputation: 2145
It is because you are creating a new instance of the bot, making it return null.
Upvotes: 1