【发布时间】:2020-04-08 09:27:40
【问题描述】:
我决定编写一个将音乐流式传输到频道的命令。我写的代码-
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 上完美运行,因此我决定将其移至我的树莓派(运行 raspbian,相同的 node.js 版本 - 13.3.0,也相同的 npm 版本),通常托管该机器人。令我惊讶的是,它没有用。机器人加入了频道,但没有播放任何音乐。根本没有错误消息。
【问题讨论】:
-
可能缺少编解码器。
标签: node.js linux windows discord.js opus