[英]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请帮帮我
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...')
尝试将
channel.send('Resetting...')
线替换为message.channel.send('Resetting...')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.