mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 05:54:33 +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 { TwitterOpenApi } = require('twitter-openapi-typescript');
|
||||
const emojiRegex = require('emoji-regex');
|
||||
const twemoji = require('@twemoji/parser');
|
||||
@@ -202,7 +202,7 @@ module.exports = class TweetCommand extends Command {
|
||||
ctx.clip();
|
||||
}
|
||||
ctx.drawImage(avatar, 17, 84, 52, 52);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'tweet.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'tweet.png' }] });
|
||||
}
|
||||
|
||||
roundedPath(ctx, radius, x, y, imageWidth, imageHeight) {
|
||||
|
||||
Reference in New Issue
Block a user