Transition to @napi-rs/canvas

This commit is contained in:
Dragon Fire
2024-05-03 01:13:32 -04:00
parent 0c9253fe75
commit b504764ba2
173 changed files with 333 additions and 333 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
const Command = require('../../framework/Command');
const { PermissionFlagsBits } = require('discord.js');
const { createCanvas, loadImage } = require('canvas');
const { createCanvas, loadImage } = require('@napi-rs/canvas');
const request = require('node-superfetch');
const path = require('path');
@@ -54,6 +54,6 @@ module.exports = class LegoIconCommand extends Command {
ctx.clip();
const height = 764 / data.width;
ctx.drawImage(data, (base.width / 2) - (764 / 2), (base.height / 2) - (764 / 2), 764, data.height * height);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'lego-icon.png' }] });
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'lego-icon.png' }] });
}
};