Im coding a discord bot, and now it should play music, but if i run the command, it says "ffmpeg not found",i already installed ffmpeg as programm and in the console, here is the code:
if (message.content.startsWith === `${prefix}play`) {
const ytdl = require('ytdl-core');
const streamOptions = {
seek: 0,
volume: 1
};
const broadcast = bot.createVoiceBroadcast();
var link = arg1
bot.voiceChannel.join()
.then(connection => {
const stream = ytdl(arg1, {
filter: 'audioonly'
});
broadcast.playStream(stream);
const dispatcher = connection.playBroadcast(broadcast);
})
.catch(console.error);
Simply installing FFMPEG on your system does not allow programs to access the executable for the program. Are you on windows? If you are, you need to add the FFMPEG's executable to your PATH environment variable.