more error handling
This commit is contained in:
parent
e4bdf94c5c
commit
7daab42d5f
|
@ -113,6 +113,7 @@ async function play(song, id, connection, channel) {
|
|||
url = out.stdout;
|
||||
}
|
||||
|
||||
try {
|
||||
const stream = got(url, {isStream: true});
|
||||
const resource = Voice.createAudioResource(stream, { inputType: Voice.StreamType.Arbitrary });
|
||||
|
||||
|
@ -141,6 +142,12 @@ async function play(song, id, connection, channel) {
|
|||
}
|
||||
|
||||
player.play(resource);
|
||||
} catch(err) {
|
||||
console.log(err);
|
||||
channel.send(`failed to play track: \`\`\`${err}\`\`\``);
|
||||
advanceQueue(id, channel, subscription, connection);
|
||||
return;
|
||||
}
|
||||
|
||||
return player;
|
||||
}
|
||||
|
|
Reference in New Issue