aboutsummaryrefslogtreecommitdiff
path: root/src/commands/leveling
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-11-10 22:12:23 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-11-10 22:12:23 -0500
commit9923f0751396decaa6febcaa54da9b6ad9b596b1 (patch)
tree5022a611ae156ff2cd6edb8c124113b539845213 /src/commands/leveling
parent8928d95b87e036f731c7a65d8646d75f5bb42c93 (diff)
downloadtanzanite-9923f0751396decaa6febcaa54da9b6ad9b596b1.tar.gz
tanzanite-9923f0751396decaa6febcaa54da9b6ad9b596b1.tar.bz2
tanzanite-9923f0751396decaa6febcaa54da9b6ad9b596b1.zip
fixed lots of shit I think
Diffstat (limited to 'src/commands/leveling')
-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