From de17681b28c8dc8ea96ca8544a00ba5a2c032eac Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 9 Nov 2019 11:26:10 +0100 Subject: [PATCH] Added error handeling --- commands/utility/play.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/commands/utility/play.js b/commands/utility/play.js index a147da3..291da2a 100644 --- a/commands/utility/play.js +++ b/commands/utility/play.js @@ -46,8 +46,13 @@ class playCommand extends Command { voiceChannel.leave(); return message.channel.send('Music ended, i left the channel'); }); - }); + }) + .catch(err => { + console.error(err); + voiceChannel.leave(); + return message.channel.send('An error has occured! is the link you sent valid?'); + }); } } -module.exports = playCommand; \ No newline at end of file +module.exports = playCommand;