diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-27 14:45:41 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-27 14:45:41 -0400 |
commit | bf9c58c3d658327d2f97a0975d8cb5ae0a4db723 (patch) | |
tree | 583325c0551878ccb7135b1493303fd07a3a89c9 /src/lib/extensions | |
parent | e9b7628a7429a013f5dcf3db5fdfb0d087c0cd81 (diff) | |
download | tanzanite-bf9c58c3d658327d2f97a0975d8cb5ae0a4db723.tar.gz tanzanite-bf9c58c3d658327d2f97a0975d8cb5ae0a4db723.tar.bz2 tanzanite-bf9c58c3d658327d2f97a0975d8cb5ae0a4db723.zip |
consistency and more work on settings command
Diffstat (limited to 'src/lib/extensions')
-rw-r--r-- | src/lib/extensions/discord-akairo/BushClient.ts | 12 | ||||
-rw-r--r-- | src/lib/extensions/discord-akairo/BushClientUtil.ts | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts index 54392fd..ca5f325 100644 --- a/src/lib/extensions/discord-akairo/BushClient.ts +++ b/src/lib/extensions/discord-akairo/BushClient.ts @@ -277,14 +277,14 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re for (const loader of Object.keys(loaders)) { try { loaders[loader as keyof typeof loaders].loadAll(); - void this.logger.success('Startup', `Successfully loaded <<${loader}>>.`, false); + void this.logger.success('startup', `Successfully loaded <<${loader}>>.`, false); } catch (e) { - void this.logger.error('Startup', `Unable to load loader <<${loader}>> with error:\n${e?.stack || e}`, false); + void this.logger.error('startup', `Unable to load loader <<${loader}>> with error:\n${e?.stack || e}`, false); } } await this.dbPreInit(); await UpdateCacheTask.init(this); - void this.console.success('Startup', `Successfully created <<cache>>.`, false); + void this.console.success('startup', `Successfully created <<cache>>.`, false); this.taskHandler.startAll!(); } @@ -298,10 +298,10 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re Level.initModel(this.db); StickyRole.initModel(this.db); await this.db.sync({ alter: true }); // Sync all tables to fix everything if updated - await this.console.success('Startup', `Successfully connected to <<database>>.`, false); + await this.console.success('startup', `Successfully connected to <<database>>.`, false); } catch (e) { await this.console.error( - 'Startup', + 'startup', `Failed to connect to <<database>> with error:\n` + typeof e === 'object' ? e?.stack : e, false ); @@ -330,7 +330,7 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re await this.#init(); await this.login(this.token!); } catch (e) { - await this.console.error('Start', chalk.red(e?.stack || e), false); + await this.console.error('start', chalk.red(e?.stack || e), false); exit(2); } } diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts index ef51b63..9ed890a 100644 --- a/src/lib/extensions/discord-akairo/BushClientUtil.ts +++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts @@ -1354,6 +1354,10 @@ export class BushClientUtil extends ClientUtil { return new Promise((resolve) => setTimeout(resolve, s * 1000)); } + camelToSnakeCase(str: string) { + return str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`); + } + //~ modified from https://stackoverflow.com/questions/31054910/get-functions-methods-of-a-class //~ answer by Bruno Grieder //~ public getMethods(obj: any): string { |