From 4acede31a9477c1713a5a7cdc9135806d2f51a05 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 28 Feb 2021 09:18:07 -0500 Subject: [PATCH] Fix --- assets/json/frame.json | 3 +++ commands/edit-image/frame.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/assets/json/frame.json b/assets/json/frame.json index 5da3a4d5..ee6ad5af 100644 --- a/assets/json/frame.json +++ b/assets/json/frame.json @@ -1,8 +1,10 @@ { "classic": { + "file": "classic.png", "stretch": true }, "sakura": { + "file": "sakura.png", "stretch": false, "xStart": 189, "yStart": 182, @@ -10,6 +12,7 @@ "ySize": 1700 }, "neon": { + "file": "neon.png", "stretch": false, "xStart": 79, "yStart": 191, diff --git a/commands/edit-image/frame.js b/commands/edit-image/frame.js index de9b958f..6cf00f6a 100644 --- a/commands/edit-image/frame.js +++ b/commands/edit-image/frame.js @@ -46,7 +46,7 @@ module.exports = class FrameCommand extends Command { async run(msg, { frame, image }) { try { - const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'frames', `${frame}.png`)); + const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'frames', frame.file)); const { body } = await request.get(image); const data = await loadImage(body); let canvas; @@ -63,7 +63,7 @@ module.exports = class FrameCommand extends Command { } 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: `frame-${frame}.png` }] }); + return msg.say({ files: [{ attachment, name: `frame-${frame.file}` }] }); } catch (err) { return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); }