From 78d4499912efd257a16f7dbb273f83d1378e7e87 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Mon, 15 Oct 2018 11:23:40 +0200 Subject: [PATCH] Send message when error occured --- commands/images/god.js | 4 +++- commands/images/human.js | 4 +++- commands/images/idubbbz.js | 4 +++- commands/images/idubbbzpaint.js | 4 +++- commands/images/like.js | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/commands/images/god.js b/commands/images/god.js index 0c91254c..636e3606 100644 --- a/commands/images/god.js +++ b/commands/images/god.js @@ -32,7 +32,9 @@ module.exports = class godCommand extends Command { const attachment = new Discord.Attachment(canvas.toBuffer(), 'edupspaint.png'); - message.say(attachment); + message.say(attachment).catch(error => { + message.say('an error as occured. Check the bot/channel permissions') + }) } }; \ No newline at end of file diff --git a/commands/images/human.js b/commands/images/human.js index 1f9f9606..212b9141 100644 --- a/commands/images/human.js +++ b/commands/images/human.js @@ -32,7 +32,9 @@ module.exports = class humanCommand extends Command { const attachment = new Discord.Attachment(canvas.toBuffer(), 'edupspaint.png'); - message.say(attachment); + message.say(attachment).catch(error => { + message.say('an error as occured. Check the bot/channel permissions') + }) } }; \ No newline at end of file diff --git a/commands/images/idubbbz.js b/commands/images/idubbbz.js index 45ede622..8c7e7675 100644 --- a/commands/images/idubbbz.js +++ b/commands/images/idubbbz.js @@ -59,7 +59,9 @@ module.exports = class idubbbzCommand extends Command { const attachment = new Discord.Attachment(canvas.toBuffer(), 'edups.png'); - message.say(attachment); + message.say(attachment).catch(error => { + message.say('an error as occured. Check the bot/channel permissions') + }) } }; \ No newline at end of file diff --git a/commands/images/idubbbzpaint.js b/commands/images/idubbbzpaint.js index 33af0ea4..e6c97e7b 100644 --- a/commands/images/idubbbzpaint.js +++ b/commands/images/idubbbzpaint.js @@ -59,7 +59,9 @@ module.exports = class idubbbzpaintCommand extends Command { const attachment = new Discord.Attachment(canvas.toBuffer(), 'edupspaint.png'); - message.say(attachment); + message.say(attachment).catch(error => { + message.say('an error as occured. Check the bot/channel permissions') + }) } }; \ No newline at end of file diff --git a/commands/images/like.js b/commands/images/like.js index 7c929741..7bb0d7fa 100644 --- a/commands/images/like.js +++ b/commands/images/like.js @@ -32,7 +32,9 @@ module.exports = class likeCommand extends Command { const attachment = new Discord.Attachment(canvas.toBuffer(), 'edupspaint.png'); - message.say(attachment); + message.say(attachment).catch(error => { + message.say('an error as occured. Check the bot/channel permissions') + }) } }; \ No newline at end of file