【发布时间】:2018-07-16 18:16:51
【问题描述】:
我使用的是安装了 Node.js 和 npm 的 Windows(64 位)。 在我的项目文件中,我运行了以下命令:
npm init
npm install discord.js --save
npm install ffmpeg --save
现在我刚刚创建了一个基本机器人的代码here 是主要代码。 我在这里列出了重要的:
if (message.content === '!play' && message.member.roles.has(message.guild.roles.find("name", config.role_name).id)) {
if (!message.member.voiceChannel) return log("?");
message.member.voiceChannel.join().then(function (connection){
});
}
然后,在 Discord 中,我说以下内容:
[1517932146] Musik bot loaded
(node:35760) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: FFMPEG not found
我已经测试了以下内容:
- 重新安装一切
- 其他要求名称 e.t.z.
- 简化代码
如果你有任何想法,请告诉我。
解决方案
npm i ffmpeg-binaries@3.2.2-3
【问题讨论】:
-
您可能希望正确粘贴您的代码,当您单击该链接时,它会将您发送到一个空的 hastebin。
标签: javascript node.js ffmpeg discord discord.js