【发布时间】:2019-10-18 02:39:02
【问题描述】:
所以我正在制作一个 discord 机器人并尝试使用 discord.js、node-opus 和 ytdl-core 来实现音乐。但是随机地,在执行命令时(主要是 >>stop),我会得到一个完全停止命令的 ReferenceError,而再尝试一次,不做任何更改,命令将成功完成。有什么帮助吗?
Bot Snippet |下面是执行命令时随机出现的错误。
(node:11740) UnhandledPromiseRejectionWarning: ReferenceError: message is not defined
at StreamDispatcher.<anonymous> (C:\Users\###\Desktop\real_bot_code\main.js:286:7)
at StreamDispatcher.emit (events.js:200:13)
at StreamDispatcher.destroy (C:\Users\###\Desktop\real_bot_code\node_modules\discord.js\src\client\voice\dispatcher\StreamDispatcher.js:294:10)
at AudioPlayer.destroyCurrentStream (C:\Users\###\Desktop\real_bot_code\node_modules\discord.js\src\client\voice\player\AudioPlayer.js:77:18)
at VoiceConnection.<anonymous> (C:\Users\###\Desktop\real_bot_code\node_modules\discord.js\src\client\voice\player\AudioPlayer.js:42:53)
at Object.onceWrapper (events.js:288:20)
at VoiceConnection.emit (events.js:205:15)
at VoiceConnection.disconnect (C:\Users\###\Desktop\real_bot_code\node_modules\discord.js\src\client\voice\VoiceConnection.js:311:10)
at VoiceChannel.leave (C:\Users\###\Desktop\real_bot_code\node_modules\discord.js\src\structures\VoiceChannel.js:142:69)
at Client.<anonymous> (C:\Users\###\Desktop\real_bot_code\main.js:179:31)
对不起,如果这是一个不好的例子,我对 stack 和 discord.js 很陌生。
【问题讨论】:
标签: discord.js