Arthur Gorbana
Arthur Gorbana

Reputation: 17

My bot discord doesn't work. I don't know why

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

Answers (1)

M.K
M.K

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

Related Questions