aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord-akairo/BushClient.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-05 18:26:55 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-08-05 18:26:55 -0400
commitf4ed3141722719f26ac2286d57a92b1031accaf3 (patch)
tree9d08f8e52d6dd56dd53a5fdbe585d6147db4c795 /src/lib/extensions/discord-akairo/BushClient.ts
parentad2077fa157d49c1099f21ac2effe05903c39035 (diff)
downloadtanzanite-f4ed3141722719f26ac2286d57a92b1031accaf3.tar.gz
tanzanite-f4ed3141722719f26ac2286d57a92b1031accaf3.tar.bz2
tanzanite-f4ed3141722719f26ac2286d57a92b1031accaf3.zip
a few fixes and stuff
Diffstat (limited to 'src/lib/extensions/discord-akairo/BushClient.ts')
-rw-r--r--src/lib/extensions/discord-akairo/BushClient.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts
index 8de630f..5b9ac1b 100644
--- a/src/lib/extensions/discord-akairo/BushClient.ts
+++ b/src/lib/extensions/discord-akairo/BushClient.ts
@@ -15,7 +15,9 @@ import {
Structures,
WebhookEditMessageOptions
} from 'discord.js';
-import * as path from 'path';
+import JSON5 from 'json5';
+import 'json5/lib/register';
+import path from 'path';
import { exit } from 'process';
import readline from 'readline';
import { Sequelize } from 'sequelize';
@@ -100,6 +102,8 @@ type If<T extends boolean, A, B = null> = T extends true ? A : T extends false ?
export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Ready> {
public static preStart(): void {
+ global.JSON5 = JSON5;
+
Structures.extend('GuildEmoji', () => BushGuildEmoji);
Structures.extend('DMChannel', () => BushDMChannel);
Structures.extend('TextChannel', () => BushTextChannel);
@@ -180,6 +184,7 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re
directory: path.join(__dirname, '..', '..', '..', 'commands'),
prefix: async ({ guild }: { guild: Guild }) => {
if (this.config.isDevelopment) return 'dev ';
+ if (!guild) return this.config.prefix;
const row = await GuildModel.findByPk(guild.id);
return (row?.prefix ?? this.config.prefix) as string;
},