简体   繁体   English

我的机器人不和谐不起作用。 我不知道为什么

[英]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.

相关问题 我的 innerHTML 不起作用,我不知道为什么? - My innerHTML doesn't work and I don't know why? 我的for循环不起作用,我也不知道为什么 - my for loop doesn't work and I don't know why 我的Javascript不起作用。不知道它是函数,我是如何调用它,我使用的CSS或者是什么 - My Javascript doesn't work. Don't know if it's the Function, how I'm calling it, the CSS I used or what 我不知道为什么渲染在反应中不起作用 - I don't know why rendering doesn't work in react 我不知道为什么这个“这个”方法不起作用? - I don't know why this 'this' method doesn't work? 如果我没有嵌套if / else语句,则代码不起作用。 我为什么要窝? - If I don't nest the if/else statements, the code doesn't work. Why do I have to nest? 我的用户脚本不起作用,我也不知道为什么(过度使用var关键字) - My userscript doesn't work and I don't know why (overuse of var keyword) Vue 3 路由器不工作。 我不明白为什么 - Vue 3 router doesn't work. I don't understand why Heroku 部署了我的 discord 机器人,但它的命令不起作用 - Heroku deploys my discord bot, but the it's commands don't work 我的地理位置(javascript)无法正常运行,我也不知道为什么 - my geolocation(javascript) does not work and I don't know why
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM