diff --git a/commands/images/god.js b/commands/images/god.js index 695f6f48..cda07584 100644 --- a/commands/images/god.js +++ b/commands/images/god.js @@ -30,7 +30,9 @@ module.exports = class godCommand extends Command { const ctx = canvas.getContext('2d') const background = await loadImage(image); ctx.drawImage(background, 20, 80, 275, 250); - const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/42/1/1539555260-untitled.png'); + const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/42/1/1539555260-untitled.png').catch(error => { + return message.say('An error as occured, please try again') + }) const bg = await loadImage(buffer); ctx.drawImage(bg, 0, 0, canvas.width, canvas.height); diff --git a/commands/images/human.js b/commands/images/human.js index fe700719..5e526ec4 100644 --- a/commands/images/human.js +++ b/commands/images/human.js @@ -28,7 +28,9 @@ module.exports = class humanCommand extends Command { const canvas = createCanvas(578, 400) const ctx = canvas.getContext('2d') - const background = await loadImage('https://image.noelshack.com/fichiers/2018/42/1/1539594726-untitled.png'); + const background = await loadImage('https://image.noelshack.com/fichiers/2018/42/1/1539594726-untitled.png').catch(error => { + return message.say('An error as occured, please try again') + }) ctx.drawImage(background, 0, 0, canvas.width, canvas.height); const { body: buffer } = await superagent.get(image); const bg = await loadImage(buffer); diff --git a/commands/images/idubbbz.js b/commands/images/idubbbz.js index e355125f..528d5b20 100644 --- a/commands/images/idubbbz.js +++ b/commands/images/idubbbz.js @@ -54,7 +54,9 @@ module.exports = class idubbbzCommand extends Command { const ctx = canvas.getContext('2d') const background = await loadImage(image); ctx.drawImage(background, 620, 100, 200, 200); - const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/41/7/1539510207-untitled.png'); + const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/41/7/1539510207-untitled.png').catch(error => { + return message.say('An error as occured, please try again') + }) const bg = await loadImage(buffer); ctx.drawImage(bg, 0, 0, canvas.width, canvas.height); ctx.font = applyText(canvas, text) diff --git a/commands/images/idubbbzpaint.js b/commands/images/idubbbzpaint.js index 9295b88a..2060c821 100644 --- a/commands/images/idubbbzpaint.js +++ b/commands/images/idubbbzpaint.js @@ -54,7 +54,9 @@ module.exports = class idubbbzpaintCommand extends Command { const ctx = canvas.getContext('2d') const background = await loadImage(image); ctx.drawImage(background, 140, 30, 400, 400); - const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/41/7/1539533685-untitled.png'); + const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/41/7/1539533685-untitled.png').catch(error => { + return message.say('An error as occured, please try again') + }) const bg = await loadImage(buffer); ctx.drawImage(bg, 0, 0, canvas.width, canvas.height); ctx.font = applyText(canvas, text) diff --git a/commands/images/like.js b/commands/images/like.js index ea3b5df8..ec348509 100644 --- a/commands/images/like.js +++ b/commands/images/like.js @@ -30,7 +30,9 @@ module.exports = class likeCommand extends Command { const ctx = canvas.getContext('2d') const background = await loadImage(image); ctx.drawImage(background, 40, 0, 300, 255); - const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/41/7/1539547403-untitled.png'); + const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/41/7/1539547403-untitled.png').catch(error => { + return message.say('An error as occured, please try again') + }) const bg = await loadImage(buffer); ctx.drawImage(bg, 0, 0, canvas.width, canvas.height); diff --git a/commands/images/ugly.js b/commands/images/ugly.js index e5e39a31..7c07a4f6 100644 --- a/commands/images/ugly.js +++ b/commands/images/ugly.js @@ -28,7 +28,9 @@ module.exports = class uglyCommand extends Command { const canvas = createCanvas(323, 400) const ctx = canvas.getContext('2d') - const background = await loadImage('https://image.noelshack.com/fichiers/2018/42/1/1539598678-untitled.png'); + const background = await loadImage('https://image.noelshack.com/fichiers/2018/42/1/1539598678-untitled.png').catch(error => { + return message.say('An error as occured, please try again') + }) ctx.drawImage(background, 0, 0, canvas.width, canvas.height); const { body: buffer } = await superagent.get(image); const bg = await loadImage(buffer);