diff --git a/README.md b/README.md index 0cff41e6..8d6abf2c 100644 --- a/README.md +++ b/README.md @@ -448,7 +448,6 @@ Total: 409 * **silhouette:** Draws a silhouette of an image or a user's avatar. * **square:** Draws an image or a user's avatar as a square. * **squish:** Draws an image or a user's avatar but squished across the X or Y axis. -* **stretch:** Draws an image or a user's avatar but stretched across the X or Y axis. * **tint:** Draws an image or a user's avatar but tinted a specific color. * **zero-dialogue:** Sends a text box from Megaman Zero with the quote of your choice. diff --git a/commands/edit-image/squish.js b/commands/edit-image/squish.js index c82d07c2..438b0cfe 100644 --- a/commands/edit-image/squish.js +++ b/commands/edit-image/squish.js @@ -6,6 +6,7 @@ module.exports = class SquishCommand extends Command { constructor(client) { super(client, { name: 'squish', + aliases: ['stretch'], group: 'edit-image', memberName: 'squish', description: 'Draws an image or a user\'s avatar but squished across the X or Y axis.', diff --git a/commands/edit-image/stretch.js b/commands/edit-image/stretch.js deleted file mode 100644 index f543e948..00000000 --- a/commands/edit-image/stretch.js +++ /dev/null @@ -1,51 +0,0 @@ -const Command = require('../../structures/Command'); -const { createCanvas, loadImage } = require('canvas'); -const request = require('node-superfetch'); - -module.exports = class StretchCommand extends Command { - constructor(client) { - super(client, { - name: 'stretch', - group: 'edit-image', - memberName: 'stretch', - description: 'Draws an image or a user\'s avatar but stretched across the X or Y axis.', - throttling: { - usages: 1, - duration: 10 - }, - clientPermissions: ['ATTACH_FILES'], - args: [ - { - key: 'axis', - prompt: 'What axis do you want to stretch?', - type: 'string', - oneOf: ['x', 'y'], - parse: axis => axis.toLowerCase() - }, - { - key: 'image', - prompt: 'What image would you like to edit?', - type: 'image', - default: msg => msg.author.displayAvatarURL({ format: 'png', size: 512 }) - } - ] - }); - } - - async run(msg, { axis, image }) { - const flipX = axis === 'x'; - const flipY = axis === 'y'; - try { - const { body } = await request.get(image); - const data = await loadImage(body); - const canvas = createCanvas(flipX ? data.width * 2 : data.width, flipY ? data.height * 2 : data.height); - const ctx = canvas.getContext('2d'); - ctx.drawImage(data, 0, 0, canvas.width, canvas.height); - const attachment = canvas.toBuffer(); - if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.'); - return msg.say({ files: [{ attachment, name: 'stretch.png' }] }); - } catch (err) { - return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); - } - } -}; diff --git a/package.json b/package.json index f7cc153b..99972c4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "114.1.0", + "version": "114.1.1", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {