aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moulberry-bush
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-08-27 22:01:17 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-08-27 22:01:17 -0400
commit7fd4bd40f49b07a584b2a2c5e071b6624d9dfe09 (patch)
tree35bd9c8a686daafc7cbfef235afade0ef0c8a104 /src/commands/moulberry-bush
parentb72d58843e853b0f260527a3689f76b13946bcb8 (diff)
downloadtanzanite-7fd4bd40f49b07a584b2a2c5e071b6624d9dfe09.tar.gz
tanzanite-7fd4bd40f49b07a584b2a2c5e071b6624d9dfe09.tar.bz2
tanzanite-7fd4bd40f49b07a584b2a2c5e071b6624d9dfe09.zip
node-canvas -> @napi-rs/canvas
ts 4.7.4 -> 4.8.2
Diffstat (limited to 'src/commands/moulberry-bush')
-rw-r--r--src/commands/moulberry-bush/neuRepo.ts11
1 files changed, 3 insertions, 8 deletions
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