Browse Source

fixed crash on video read failure

master
lolcat 3 months ago
parent
commit
788f69cd47
  1. 6
      bot.js

6
bot.js

@ -119,11 +119,9 @@ client.voiceConnection.on("end", function(){
return;
});
client.voiceConnection.on("error", error);
function error(){
client.sendMessage("Fuck!! An error occured while reading <b>" + playlist[0].title + "</b>!! Skipping...");
client.sendMessage("Fuck!! Could not read information about current video!! Skipping...");
playlist.shift();
play();
return;
@ -418,7 +416,7 @@ client.on("message", async function(message){
if(playlist.length !== 1){
client.sendMessage("Added <b>" + playlist[0].title + "</b> to the queue!!");
client.sendMessage("Added <b>" + playlist[playlist.length - 1].title + "</b> to the queue!!");
}else{
download = await yt.downloadFromInfo(dlinfo, {filter: "audioonly"})

Loading…
Cancel
Save