aboutsummaryrefslogtreecommitdiff
path: root/src/commands/leveling/level.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/leveling/level.ts')
-rw-r--r--src/commands/leveling/level.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/commands/leveling/level.ts b/src/commands/leveling/level.ts
index 0da0bf0..ea77124 100644
--- a/src/commands/leveling/level.ts
+++ b/src/commands/leveling/level.ts
@@ -11,8 +11,11 @@ import {
import canvas from 'canvas';
import { MessageAttachment } from 'discord.js';
import got from 'got';
-import { join } from 'path';
-import SimplifyNumber from 'simplify-number';
+import { dirname, join } from 'path';
+import { fileURLToPath } from 'url';
+
+// idk why I need to do default twice, it is being weird
+const { default: SimplifyNumber } = ((await import('simplify-number')).default as unknown as typeof import('simplify-number'));
export default class LevelCommand extends BushCommand {
public constructor() {
@@ -89,7 +92,7 @@ export default class LevelCommand extends BushCommand {
gray = '#23272A',
highlight = user.hexAccentColor ?? '#5865F2';
// Load roboto font
- canvas.registerFont(join(__dirname, '..', '..', '..', '..', 'lib', 'assets', 'Roboto-Regular.ttf'), {
+ canvas.registerFont(join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..', '..', 'lib', 'assets', 'Roboto-Regular.ttf'), {
family: 'Roboto'
});
// Create image canvas