Discord.js音乐机器人不在Linux上运行(但在Windows上工作)



我决定编写一个命令,用于将音乐流式传输到频道。我写的代码——

module.exports = {
name: "hardbass",
category: "music",
run: async (client, message, args, servers) => {
const ffmpeg = require("ffmpeg");
const opusscript = require("opusscript");
if(!message.member.voiceChannel) return message.reply("Niesi vo voice channeli").then(x => x.delete(3000))
await message.member.voiceChannel.join().then(connection => {
connection.playArbitraryInput(`http://air2.radiorecord.ru:9003/hbass_320`);
})
}
}

-在Windows上完美运行,所以我决定将其移动到我的Raspberry Pi(运行Raspbian,相同的节点.js版本-13.3.0,也是相同的npm版本(,机器人通常托管在那里。令我惊讶的是,它没有奏效。机器人加入了频道,但没有播放任何音乐。根本没有错误消息。

如果你还没有找到答案,我也经历过同样的事情。我的错误是Linux找不到Opus模块。只需在机器人所在的文件夹中npm i discordjs/opus即可正常工作。当将机器人切换回我的 Windows PC 时,它抛出了相同的错误,因此我不得不重新安装 discordjs/opus。我想您不能拥有与两个操作系统兼容的版本吗?我自己仍在努力寻找解决方案。

相关内容

最新更新