This commit is contained in:
Dragon Fire
2021-02-28 09:18:07 -05:00
parent bef7b27830
commit 4acede31a9
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -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,
+2 -2
View File
@@ -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!`);
}