Reputation: 17
Why this code doesn't work?
client.on('message', message => {
if(message.content.startsWith(prefix + ' stop'))
{
channel.send('Resetting...')
client.destroy()
client.login("xxx");
}
})
I have this error :
Help me please
Upvotes: 1
Views: 93
Reputation: 270
Error says channel not defined.
Assuming you want the bot to send the response to the same channel the command was called...
Try replacing the line
channel.send('Resetting...')
to message.channel.send('Resetting...')
Upvotes: 1