mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 21:40:51 +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 { sepia, centerImagePart } = require('../../util/Canvas');
|
||||
@@ -46,6 +46,6 @@ module.exports = class WantedCommand extends Command {
|
||||
const { x, y, width, height } = centerImagePart(data, 430, 430, 150, 360);
|
||||
ctx.drawImage(data, x, y, width, height);
|
||||
sepia(ctx, x, y, width, height);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'wanted.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'wanted.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user