napi-rs/canvas doesn't support line breaks????

This commit is contained in:
Dragon Fire
2024-05-03 01:49:01 -04:00
parent 570149028a
commit 8a5af83844
173 changed files with 332 additions and 332 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
const Command = require('../../framework/Command');
const { PermissionFlagsBits } = require('discord.js');
const { createCanvas, loadImage } = require('@napi-rs/canvas');
const { createCanvas, loadImage } = require('canvas');
const request = require('node-superfetch');
const path = require('path');
@@ -43,7 +43,7 @@ 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);
const attachment = canvas.toBuffer('image/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' }] });
}