Face Analyze, Analyze group

This commit is contained in:
Daniel Odendahl Jr
2018-03-08 22:49:19 +00:00
parent 35f4bd0bbe
commit 10e9fc0c02
18 changed files with 88 additions and 21 deletions
+3 -1
View File
@@ -37,7 +37,9 @@ module.exports = class IfunnyCommand extends Command {
ctx.fillStyle = '#181619';
ctx.fillRect(0, canvas.height - base.height, canvas.width, base.height);
ctx.drawImage(base, canvas.width - base.width, canvas.height - base.height);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'ifunny.png' }] });
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: 'ifunny.png' }] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}