admin管理员组文章数量:1430506
I just started learning javascript with node.js and I am attempting to create a music bot, I've set up the mand handler and everything, however, I keep getting this error when I try to run the play mand
Error: FFmpeg/avconv not found! at Function.getInfo (C:\Users\johnd\OneDrive\Desktop\discordBot\node_modules\prism-media\src\core\FFmpeg.js:130:11) at Function.create (C:\Users\johnd\OneDrive\Desktop\discordBot\node_modules\prism-media\src\core\FFmpeg.js:143:38) at new FFmpeg (C:\Users\johnd\OneDrive\Desktop\discordBot\node_modules\prism-media\src\core\FFmpeg.js:44:27) at AudioPlayer.playUnknown (C:\Users\johnd\OneDrive\Desktop\discordBot\node_modules\discord.js\src\client\voice\player\BasePlayer.js:47:20) at VoiceConnection.play (C:\Users\johnd\OneDrive\Desktop\discordBot\node_modules\discord.js\src\client\voice\util\PlayInterface.js:71:28) at C:\Users\johnd\OneDrive\Desktop\discordBot\mands\play.js:7:39 at processTicksAndRejections (internal/process/task_queues.js:97:5)
I'll post my play function below
async function playMusic(vc,songId) {
const stream = await ytdl(songId,{type: 'opus',filter : 'audioonly'});
vc.join().then(connection => {
const dispatcher = connection.play(stream,{volume: 1});
dispatcher.on('end', end => {
console.log("Song ended!");
vc.leave();
}).catch(err => console.log(err));
}).catch(err => console.log(err));
}
My proof of installation: .jpg
Update 1: I'm still looking for others with this specific problem and can't find anything.
I just started learning javascript with node.js and I am attempting to create a music bot, I've set up the mand handler and everything, however, I keep getting this error when I try to run the play mand
Error: FFmpeg/avconv not found! at Function.getInfo (C:\Users\johnd\OneDrive\Desktop\discordBot\node_modules\prism-media\src\core\FFmpeg.js:130:11) at Function.create (C:\Users\johnd\OneDrive\Desktop\discordBot\node_modules\prism-media\src\core\FFmpeg.js:143:38) at new FFmpeg (C:\Users\johnd\OneDrive\Desktop\discordBot\node_modules\prism-media\src\core\FFmpeg.js:44:27) at AudioPlayer.playUnknown (C:\Users\johnd\OneDrive\Desktop\discordBot\node_modules\discord.js\src\client\voice\player\BasePlayer.js:47:20) at VoiceConnection.play (C:\Users\johnd\OneDrive\Desktop\discordBot\node_modules\discord.js\src\client\voice\util\PlayInterface.js:71:28) at C:\Users\johnd\OneDrive\Desktop\discordBot\mands\play.js:7:39 at processTicksAndRejections (internal/process/task_queues.js:97:5)
I'll post my play function below
async function playMusic(vc,songId) {
const stream = await ytdl(songId,{type: 'opus',filter : 'audioonly'});
vc.join().then(connection => {
const dispatcher = connection.play(stream,{volume: 1});
dispatcher.on('end', end => {
console.log("Song ended!");
vc.leave();
}).catch(err => console.log(err));
}).catch(err => console.log(err));
}
My proof of installation: https://i.sstatic/LRfJ4.jpg
Update 1: I'm still looking for others with this specific problem and can't find anything.
Share Improve this question edited Mar 16, 2020 at 13:49 cccmdm asked Mar 16, 2020 at 12:32 cccmdmcccmdm 111 silver badge3 bronze badges3 Answers
Reset to default 4You need to run the following mands:
1) npm install ffmpeg-static
2) npm install @discordjs/opus
3) npm install ytdl-core
No need to install any binary or put it in the PATH, just install the above things like you installed discordjs. These things will show up in your package.json file after that. When you will host your bot in the cloud it will build it using the package.json.
have you added ffmpeg to the windows path yet?
here's a link to that, in case you haven't ===> https://www.youtube./watch?v=qjtmgCb8NcE
(be sure you have de .EXE on PATHEXT too)
ps.: I had the same problem, I restarted my puter and everything went to normal. And here's another link that could help https://www.npmjs./package/discord.js-music-v11
If his suggestion doesn't work try: run npm install FFmpeg-static and npm install @discordjs/opus
I was having the same issue and this is what worked
本文标签: javascriptDiscordjs Music Bot ffmpeg not foundStack Overflow
版权声明:本文标题:javascript - Discord.js Music Bot ffmpeg not found? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745490820a2660597.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论