From 7fd4bd40f49b07a584b2a2c5e071b6624d9dfe09 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sat, 27 Aug 2022 22:01:17 -0400 Subject: node-canvas -> @napi-rs/canvas ts 4.7.4 -> 4.8.2 --- src/commands/moulberry-bush/neuRepo.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/commands/moulberry-bush/neuRepo.ts') diff --git a/src/commands/moulberry-bush/neuRepo.ts b/src/commands/moulberry-bush/neuRepo.ts index fcb6f23..4baae7d 100644 --- a/src/commands/moulberry-bush/neuRepo.ts +++ b/src/commands/moulberry-bush/neuRepo.ts @@ -1,5 +1,5 @@ import { BushCommand, clientSendAndPermCheck, type ArgType, type CommandMessage, type SlashMessage } from '#lib'; -import canvas from 'canvas'; +import canvas from '@napi-rs/canvas'; import { ApplicationCommandOptionType, AttachmentBuilder, @@ -7,9 +7,8 @@ import { CacheType, PermissionFlagsBits } from 'discord.js'; -import { dirname, join } from 'path'; +import { join } from 'path'; import tinycolor from 'tinycolor2'; -import { fileURLToPath } from 'url'; import { formattingInfo, RawNeuItem } from '../../../lib/utils/Minecraft.js'; export default class NeuRepoCommand extends BushCommand { @@ -66,10 +65,6 @@ export default class NeuRepoCommand extends BushCommand { } public toolTip(item: RawNeuItem): Buffer { - canvas.registerFont(join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..', '..', 'assets', 'Faithful.ttf'), { - family: 'Faithful' - }); - const background = '#100010'; const width = 250; @@ -143,7 +138,7 @@ export default class NeuRepoCommand extends BushCommand { item.displayname.split(''); - return itemRender.toBuffer(); + return itemRender.toBuffer('image/png'); } // stolen from NEU and modified -- cgit