From 865c141b5bdfd28a6a3608ed0f028b313820c620 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Tue, 16 Oct 2018 11:55:57 +0200 Subject: [PATCH] Dosen't allow gif anymore --- commands/images/fetish.js | 4 +++- commands/images/god.js | 4 +++- commands/images/human.js | 6 ++++-- commands/images/idubbbz.js | 8 +++++--- commands/images/idubbbzpaint.js | 4 +++- commands/images/like.js | 4 +++- commands/images/ugly.js | 4 +++- 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/commands/images/fetish.js b/commands/images/fetish.js index c4fa43fb..74f55ec3 100644 --- a/commands/images/fetish.js +++ b/commands/images/fetish.js @@ -23,8 +23,10 @@ module.exports = class fetishCommand extends Command { let image = null if (!Attachment[0]) image = message.author.displayAvatarURL + else if(Attachment[0] && Attachment[0].url.endsWith('gif')) + return message.say('Gif dosent work, sorry') else - image = Attachment[0].url + image = Attachment[0].url const canvas = createCanvas(528, 559) const ctx = canvas.getContext('2d') diff --git a/commands/images/god.js b/commands/images/god.js index cda07584..58b054ff 100644 --- a/commands/images/god.js +++ b/commands/images/god.js @@ -23,8 +23,10 @@ module.exports = class godCommand extends Command { let image = null if (!Attachment[0]) image = message.author.displayAvatarURL + else if(Attachment[0] && Attachment[0].url.endsWith('gif')) + return message.say('Gif dosent work, sorry') else - image = Attachment[0].url + image = Attachment[0].url const canvas = createCanvas(310, 400) const ctx = canvas.getContext('2d') diff --git a/commands/images/human.js b/commands/images/human.js index 5e526ec4..ed411a09 100644 --- a/commands/images/human.js +++ b/commands/images/human.js @@ -23,9 +23,11 @@ module.exports = class humanCommand extends Command { let image = null if (!Attachment[0]) image = message.author.displayAvatarURL + else if(Attachment[0] && Attachment[0].url.endsWith('gif')) + return message.say('Gif dosent work, sorry') else - image = Attachment[0].url - + image = Attachment[0].url + 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').catch(error => { diff --git a/commands/images/idubbbz.js b/commands/images/idubbbz.js index 528d5b20..6e56874b 100644 --- a/commands/images/idubbbz.js +++ b/commands/images/idubbbz.js @@ -31,9 +31,11 @@ module.exports = class idubbbzCommand extends Command { let Attachment = (message.attachments).array(); let image = null if (!Attachment[0]) - image = message.author.displayAvatarURL - else - image = Attachment[0].url + image = message.author.displayAvatarURL + else if(Attachment[0] && Attachment[0].url.endsWith('gif')) + return message.say('Gif dosent work, sorry') + else + image = Attachment[0].url const canvas = createCanvas(1281, 627) const applyText = (canvas, text) => { diff --git a/commands/images/idubbbzpaint.js b/commands/images/idubbbzpaint.js index 2060c821..f5843622 100644 --- a/commands/images/idubbbzpaint.js +++ b/commands/images/idubbbzpaint.js @@ -32,8 +32,10 @@ module.exports = class idubbbzpaintCommand extends Command { let image = null if (!Attachment[0]) image = message.author.displayAvatarURL + else if(Attachment[0] && Attachment[0].url.endsWith('gif')) + return message.say('Gif dosent work, sorry') else - image = Attachment[0].url + image = Attachment[0].url const canvas = createCanvas(1024, 544) const applyText = (canvas, text) => { diff --git a/commands/images/like.js b/commands/images/like.js index ec348509..831c63db 100644 --- a/commands/images/like.js +++ b/commands/images/like.js @@ -23,8 +23,10 @@ module.exports = class likeCommand extends Command { let image = null if (!Attachment[0]) image = message.author.displayAvatarURL + else if(Attachment[0] && Attachment[0].url.endsWith('gif')) + return message.say('Gif dosent work, sorry') else - image = Attachment[0].url + image = Attachment[0].url const canvas = createCanvas(386, 399) const ctx = canvas.getContext('2d') diff --git a/commands/images/ugly.js b/commands/images/ugly.js index 7c07a4f6..88b9a7ba 100644 --- a/commands/images/ugly.js +++ b/commands/images/ugly.js @@ -23,8 +23,10 @@ module.exports = class uglyCommand extends Command { let image = null if (!Attachment[0]) image = message.author.displayAvatarURL + else if(Attachment[0] && Attachment[0].url.endsWith('gif')) + return message.say('Gif dosent work, sorry') else - image = Attachment[0].url + image = Attachment[0].url const canvas = createCanvas(323, 400) const ctx = canvas.getContext('2d')