mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-14 08:08:34 +02:00
Transition to @napi-rs/canvas
This commit is contained in:
@@ -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');
|
||||
|
||||
module.exports = class CircleCommand extends Command {
|
||||
@@ -37,6 +37,6 @@ module.exports = class CircleCommand extends Command {
|
||||
ctx.closePath();
|
||||
ctx.clip();
|
||||
ctx.drawImage(data, (canvas.width / 2) - (data.width / 2), (canvas.height / 2) - (data.height / 2));
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'circle.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'circle.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user