I'm using Windows (64-bit) with Node.js and npm installed.
In my project file, I have run the following commands:
npm init
npm install discord.js --save
npm install ffmpeg --save
Now i just created the code for a basic bot here is the main code.
I list here the important:
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){
});
}
Then, in Discord, I say the following:
[1517932146] Musik bot loaded
(node:35760) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: FFMPEG not found
I have already tested the following:
- reinstallation of everything
- others of the require names e.t.z.
- simplify the code
So if you have any ideas then let me know.
Solution
npm i ffmpeg-binaries@3.2.2-3
link
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…