mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 14:55:40 +02:00
Fix
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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!`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user