我遵循了有关编码音乐bot的youtube编码教程,然后一点一点地升级了命令,我亲自测试了所有内容,直到它完美运行为止。 1天后,在尝试播放音乐时出现错误,我不知道发生了什么。
我尝试删除代码中可能是问题的几处内容,最终这些都不是真正的问题
C:\Users\Nume\Desktop\Bot\node_modules\opusscript\build\opusscript_native_wasm.js:8
var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locate
Error: This video is unavailable
at C:\Users\Nume\Desktop\Bot\node_modules\ytdl-core\lib\info.js:255:16
at Object.exports.<computed> [as getBasicInfo] (C:\Users\Nume\Desktop\Bot\node_modules\ytdl-core\lib\info.js:367:7)
at exports.getFullInfo (C:\Users\Nume\Desktop\Bot\node_modules\ytdl-core\lib\info.js:211:18)
at Function.exports.<computed> [as getInfo] (C:\Users\Nume\Desktop\Bot\node_modules\ytdl-core\lib\info.js:369:7)
at ytdl (C:\Users\Nume\Desktop\Bot\node_modules\ytdl-core\lib\index.js:17:8)
at play (C:\Users\Nume\Desktop\Bot\commands\simple\play.js:8:51)
at StreamDispatcher.<anonymous> (C:\Users\Nume\Desktop\Bot\commands\simple\play.js:13:17)
at StreamDispatcher.emit (events.js:209:13)
at StreamDispatcher.destroy (C:\Users\Nume\Desktop\Bot\node_modules\discord.js\src\client\voice\dispatcher\StreamDispatcher.js:294:10)
at AudioPlayer.destroyCurrentStream (C:\Users\Nume\Desktop\Bot\node_modules\discord.js\src\client\voice\player\AudioPlayer.js:77:18)
Emitted 'error' event on PassThrough instance at:
at C:\Users\Nume\Desktop\Bot\node_modules\ytdl-core\lib\index.js:19:14
at C:\Users\Nume\Desktop\Bot\node_modules\ytdl-core\lib\info.js:370:25
at C:\Users\Nume\Desktop\Bot\node_modules\ytdl-core\lib\info.js:255:7
at Object.exports.<computed> [as getBasicInfo] (C:\Users\Nume\Desktop\Bot\node_modules\ytdl-core\lib\info.js:367:7)
[... lines matching original stack trace ...]
at StreamDispatcher.emit (events.js:209:13)
应该发生的事情是:机器人正在播放音乐并向他发送正在播放的歌曲的消息,而这在一天前还算不错。这是我遇到的错误。
{{1}}
答案 0 :(得分:0)
更新了ytdl-core,之后效果很好