mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 14:18:36 +02:00
Transfer to @napi-rs/canvas again (this time w/ line breaks)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const { PermissionFlagsBits } = require('discord.js');
|
||||
const { createCanvas, loadImage } = require('canvas');
|
||||
const { createCanvas, loadImage } = require('@napi-rs/canvas');
|
||||
const path = require('path');
|
||||
const { wrapText } = require('../../util/Canvas');
|
||||
const { wrapText, fillTextWithBreaks } = require('../../util/Canvas');
|
||||
|
||||
module.exports = class SpongebobBurnCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -61,7 +61,7 @@ module.exports = class SpongebobBurnCommand extends Command {
|
||||
ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(fontSize);
|
||||
}
|
||||
const lines = wrapText(ctx, burn, 180);
|
||||
ctx.fillText(lines.join('\n'), 55, 103);
|
||||
fillTextWithBreaks(ctx, lines.join('\n'), 55, 103);
|
||||
ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(25);
|
||||
ctx.fillText(person, 382, 26);
|
||||
ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(20);
|
||||
|
||||
Reference in New Issue
Block a user