Discord.JS |音乐机器人“错误:视频不可用”

问题描述

我将在下面列出命令逻辑本身以及所有已安装的依赖项。基本上,到目前为止,只要我在discord中使用我提供的任何youtube链接运行该命令,该机器人便会加入并且一切正常运行,但是不久之后,该机器人在VSC中出现错误错误为“视频不可用”。我浏览了各种论坛并观看了很多视频,但根本找不到任何解决方案。

播放命令逻辑:

if (musicArgs.startsWith('play')) {

                let musicPlayPrefix = 'play';

                let musicPlayArgs = musicArgs.slice(musicPlayPrefix.length).trim();

                if (message.member.voice.channel) {

                    const connection = await message.member.voice.channel.join();

                    const dispatcher = connection.play(await ytdl(musicPlayArgs),{ type: 'opus'})

                    dispatcher.on('error',console.error);

                    dispatcher.on('start',() => {

                        message.channel.send(`**Now Playing:** *${musicPlayArgs}`);
                    });

                    dispatcher.on('finish',() => {

                        message.channel.send(`**Music Finished!**`);
                    });
                }

                else {

                    message.channel.send(`You're not in a voice channel! Retry the command inside of one.`);
                }
            }

Package.json中的依赖项:

 "dependencies": {
    "@discordjs/opus": "github:discordjs/opus","discord.js": "^12.3.1","ffmpeg-static": "^4.2.7","hypixel-api-reborn": "^2.2.4","libsodium-wrappers": "^0.7.8","ytdl-core-discord": "git+https://github.com/amishshah/ytdl-core-discord.git"
  }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...