From d97496ef25a74632ea8ec58e9714229902b69332 Mon Sep 17 00:00:00 2001 From: TheEssem Date: Tue, 7 Jan 2020 09:38:13 -0600 Subject: [PATCH] Fixed oversight in snowflake, reject image if width is over 10000 in wide --- commands/snowflake.js | 1 + commands/wide.js | 1 + 2 files changed, 2 insertions(+) diff --git a/commands/snowflake.js b/commands/snowflake.js index 6fcf096..99c862b 100644 --- a/commands/snowflake.js +++ b/commands/snowflake.js @@ -1,4 +1,5 @@ exports.run = async (message, args) => { + if (!args[0]) return `${message.author.mention}, you need to provide a snowflake ID!`; if (!args[0].match(/^\d+$/) && args[0] < 21154535154122752) return `${message.author.mention}, that's not a valid snowflake!`; return new Date((args[0] / 4194304) + 1420070400000).toUTCString(); }; diff --git a/commands/wide.js b/commands/wide.js index 3e9030e..2b86bca 100644 --- a/commands/wide.js +++ b/commands/wide.js @@ -9,6 +9,7 @@ exports.run = async (message) => { if (image === undefined) return `${message.author.mention}, you need to provide an image to stretch!`; gm(image.data).size(async (error, size) => { if (error) throw error; + if (size.width > 10000) return `${message.author.mention}, this image is too wide!`; const data = gm(image.data).resize(`${(size.width * 19) / 2}x${size.height / 2}!`); const resultBuffer = await gmToBuffer(data); return message.channel.createMessage("", {