При внедрении функции musi c в мой диск node.js. js диск-бот я получил ошибку, утверждающую, что он не может найти FFMPEG. Я переустанавливал ffmpeg 3 раза безрезультатно.
Это полная ошибка
2020-02-17T01:48:30.403766+00:00 app[worker.1]: (node:4) UnhandledPromiseRejectionWarning: Error: FFMPEG not found
2020-02-17T01:48:30.403797+00:00 app[worker.1]: at Function.selectFfmpegCommand (/app/node_modules/prism-media/src/transcoders/ffmpeg/Ffmpeg.js:46:13)
2020-02-17T01:48:30.403798+00:00 app[worker.1]: at new FfmpegTranscoder (/app/node_modules/prism-media/src/transcoders/ffmpeg/Ffmpeg.js:7:37)
2020-02-17T01:48:30.403798+00:00 app[worker.1]: at new MediaTranscoder (/app/node_modules/prism-media/src/transcoders/MediaTranscoder.js:10:19)
2020-02-17T01:48:30.403799+00:00 app[worker.1]: at new Prism (/app/node_modules/prism-media/src/Prism.js:5:23)
2020-02-17T01:48:30.403799+00:00 app[worker.1]: at new VoiceConnection (/app/node_modules/discord.js/src/client/voice/VoiceConnection.js:46:18)
2020-02-17T01:48:30.403800+00:00 app[worker.1]: at /app/node_modules/discord.js/src/client/voice/ClientVoiceManager.js:63:22
2020-02-17T01:48:30.403800+00:00 app[worker.1]: at new Promise (<anonymous>)
2020-02-17T01:48:30.403801+00:00 app[worker.1]: at ClientVoiceManager.joinChannel (/app/node_modules/discord.js/src/client/voice/ClientVoiceManager.js:45:12)
2020-02-17T01:48:30.403801+00:00 app[worker.1]: at VoiceChannel.join (/app/node_modules/discord.js/src/structures/VoiceChannel.js:130:30)
2020-02-17T01:48:30.403802+00:00 app[worker.1]: at Object.execute (/app/commands/play.js:31:64)
2020-02-17T01:48:30.404044+00:00 app[worker.1]: (node:4) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
2020-02-17T01:48:30.404052+00:00 app[worker.1]: (node:4) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Это код
const ytdl = require("ytdl-core");
module.exports = {
name: 'play',
description: 'initiates music methods of the bot',
execute(msg, args){
var servers = {};
function play(connection, msg){
var server = servers[msg.guild.id];
server.dispatcher = connection.playStream(ytdl(server.queue[0], {filter: "audioonly"}));
server.queue.shift();
server.dispatcher.on("end", function(){
if(server.queue[0]){
play(connection, msg);
}else{
connection.disconnect();
}
});
}
if(!args[1]) return msg.channel.send("you need to provide a link");
if(!msg.member.voiceChannel) return msg.channel.send("You must be in a voice channel to use this feature");
if(!servers[msg.guild.id]) servers[msg.guild.id] = {
queue: []
}
var server = servers[msg.guild.id];
server.queue.push(args[1]);
if(!msg.guild.voiceConnection) msg.member.voiceChannel.join().then(function(connection){
play(connection, msg);
})
}
}
Понятия не имею, в чем проблема. Я использую герою для развертывания, если это вообще имеет значение.