From 42a64b9147f79002051b0b12cb046fec9e36d489 Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Sat, 9 May 2020 10:17:02 +0100 Subject: [PATCH] added changes to error handling --- commands/music/pause.js | 4 ++-- commands/music/queue.js | 4 ++-- commands/music/resume.js | 4 ++-- commands/music/skip.js | 4 ++-- commands/music/stop.js | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/commands/music/pause.js b/commands/music/pause.js index 7561aa9..8de8b7f 100644 --- a/commands/music/pause.js +++ b/commands/music/pause.js @@ -11,7 +11,7 @@ module.exports = class Play extends Command { guildOnly: true, throttling: { usages: 1, - duration: 5 + duration: 3 } }); } @@ -38,7 +38,7 @@ module.exports = class Play extends Command { } } catch (err) { console.error(err); - const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon'); + const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`); return message.say({ embed }); } } diff --git a/commands/music/queue.js b/commands/music/queue.js index 3e8cee4..79cd6fc 100644 --- a/commands/music/queue.js +++ b/commands/music/queue.js @@ -11,7 +11,7 @@ module.exports = class Play extends Command { guildOnly: true, throttling: { usages: 1, - duration: 5 + duration: 3 } }); } @@ -39,7 +39,7 @@ module.exports = class Play extends Command { } } catch(err) { console.error(err); - const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon'); + const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`); return message.say({ embed }); } } diff --git a/commands/music/resume.js b/commands/music/resume.js index 86aece1..154afd2 100644 --- a/commands/music/resume.js +++ b/commands/music/resume.js @@ -11,7 +11,7 @@ module.exports = class Play extends Command { guildOnly: true, throttling: { usages: 1, - duration: 5 + duration: 3 } }); } @@ -35,7 +35,7 @@ module.exports = class Play extends Command { } } catch (err) { console.error(err); - const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon'); + const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`); return message.say({ embed }); } } diff --git a/commands/music/skip.js b/commands/music/skip.js index 7325d4d..1cf9c7f 100644 --- a/commands/music/skip.js +++ b/commands/music/skip.js @@ -11,7 +11,7 @@ module.exports = class Play extends Command { guildOnly: true, throttling: { usages: 1, - duration: 5 + duration: 3 } }); } @@ -33,7 +33,7 @@ module.exports = class Play extends Command { } } catch (err) { console.error(err); - const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon'); + const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`); return message.say({ embed }); } } diff --git a/commands/music/stop.js b/commands/music/stop.js index 72448ff..b31ff42 100644 --- a/commands/music/stop.js +++ b/commands/music/stop.js @@ -11,7 +11,7 @@ module.exports = class Play extends Command { guildOnly: true, throttling: { usages: 1, - duration: 5 + duration: 3 } }); } @@ -28,17 +28,17 @@ module.exports = class Play extends Command { } else { const voiceChannel = message.member.voice.channel; - message.guild.music.queue = []; message.guild.music.isPlaying = false; message.guild.music.nowPlaying = null; message.guild.music.dispatcher = null; + message.guild.music.queue = []; voiceChannel.leave(); const embed = new MessageEmbed().setColor('#000099').setTitle(':stop_button: Stopped player and cleared queue'); return await message.say({ embed }); } } catch(err) { console.error(err); - const embed = new MessageEmbed().setColor('#ff0000').setTitle(':x: Error occured, if you are my creator please fix me soon'); + const embed = new MessageEmbed().setColor('#ff0000').setTitle(`:x: Error occured: ${err.message}`); return message.say({ embed }); } }