mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +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 } = 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,
|
||||
|
||||
Reference in New Issue
Block a user