This commit is contained in:
Dragon Fire
2021-04-06 10:31:13 -04:00
parent 5b8cdb1cfd
commit 6399a7bff5
+4
View File
@@ -33,6 +33,10 @@ module.exports = class EmojiImageCommand extends Command {
if (!parsed.length || !parsed[0].url) return msg.reply('This emoji is not yet supported.');
const { body } = await request.get(parsed[0].url);
const emojiImage = await loadImage(body);
if (parsed[0].url.endsWith('svg')) {
emojiImage.width *= 4;
emojiImage.height *= 4;
}
const canvas = createCanvas(512, 512);
const ctx = canvas.getContext('2d');
ctx.drawImage(emojiImage, 0, 0, 512, 512);