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 } = require('canvas');
const { createCanvas } = require('@napi-rs/canvas');
const pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ23456789'.split('');
module.exports = class CaptchaCommand extends Command {
@@ -41,7 +41,7 @@ module.exports = class CaptchaCommand extends Command {
ctx.strokeText(text, 15, 26);
await msg.reply(
'**You have 15 seconds, what does the captcha say?**',
{ files: [{ attachment: canvas.toBuffer(), name: 'captcha-quiz.png' }] }
{ files: [{ attachment: canvas.toBuffer('image/png'), name: 'captcha-quiz.png' }] }
);
const msgs = await msg.channel.awaitMessages({
filter: res => res.author.id === msg.author.id,