我构建了一个 discord.js 机器人,当有人使用它的命令时它会加入,但它只有在视频具有高观看次数时才有效,我尝试使用未列出的 YouTube 视频、我上传的一些视频和低观看次数的视频,但它不起作用,它只是加入语音频道然后离开。
if (message.content == "!sodium") {
if (!message.member.voice.channel) return message.reply("You have to be in a voice channel");
message.member.voice.channel.join().then(VoiceConnection => {
VoiceConnection.play(ytdl("https://youtu.be/30p-iRH9z2c")).on("finish", () =>
VoiceConnection.disconnect());
message.reply("started...");
}).catch(e => console.log(e))
};