mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 10:02:05 +02:00
Fix
This commit is contained in:
@@ -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