mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 13:56:43 +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');
|
||||
const path = require('path');
|
||||
const hats = require('../../assets/json/hat');
|
||||
@@ -154,6 +154,6 @@ module.exports = class HatCommand extends Command {
|
||||
ctx.drawImage(avatar, 0, 0);
|
||||
ctx.drawImage(base, 0, 0, avatar.width, avatar.height);
|
||||
const comment = user.id === this.client.user.id ? hat.commentMe : hat.comment.replace(/{{user}}/g, user.tag);
|
||||
return msg.say(comment, { files: [{ attachment: canvas.toBuffer(), name: `${type}-hat.png` }] });
|
||||
return msg.say(comment, { files: [{ attachment: canvas.toBuffer('image/png'), name: `${type}-hat.png` }] });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user