aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bot.ts7
-rw-r--r--src/lib/extensions/discord-akairo/BushClient.ts8
2 files changed, 10 insertions, 5 deletions
diff --git a/src/bot.ts b/src/bot.ts
index 473ee27..86a8c16 100644
--- a/src/bot.ts
+++ b/src/bot.ts
@@ -9,4 +9,9 @@ new Sentry(dirname(fileURLToPath(import.meta.url)) || process.cwd());
BushClient.extendStructures();
const client = new BushClient(config);
await client.init();
-if (!process.argv.includes('dry')) await client.start();
+if (process.argv.includes('dry')) {
+ await client.destroy();
+ process.exit(0);
+} else {
+ await client.start();
+}
diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts
index d7c8b60..41ecfaf 100644
--- a/src/lib/extensions/discord-akairo/BushClient.ts
+++ b/src/lib/extensions/discord-akairo/BushClient.ts
@@ -299,6 +299,10 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re
logging: this.config.logging.db ? (sql) => this.logger.debug(sql) : false,
timezone: 'America/New_York'
});
+
+ // global objects
+ global.client = this;
+ global.util = this.util;
}
/**
@@ -448,10 +452,6 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re
return done(null, `intercepted ${arg}`);
});
- // global objects
- global.client = this;
- global.util = this.util;
-
try {
await this.dbPreInit();
await UpdateCacheTask.init(this);