From cca0b7a03bcd61af12b7f9bff51276f6c70beeb3 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 26 Jul 2021 18:45:31 -0400 Subject: refactor: this.client.util -> util --- src/lib/utils/BushLogger.ts | 14 +++++++------- src/lib/utils/Config.ts | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/lib/utils') diff --git a/src/lib/utils/BushLogger.ts b/src/lib/utils/BushLogger.ts index 98c3c04..3069dc8 100644 --- a/src/lib/utils/BushLogger.ts +++ b/src/lib/utils/BushLogger.ts @@ -70,13 +70,13 @@ export class BushLogger { /** Sends a message to the log channel */ public async channelLog(message: BushSendMessageType): Promise { - const channel = await this.client.util.getConfigChannel('log'); + const channel = await util.getConfigChannel('log'); await channel.send(message).catch(() => {}); } /** Sends a message to the error channel */ public async channelError(message: BushSendMessageType): Promise { - const channel = await this.client.util.getConfigChannel('error'); + const channel = await util.getConfigChannel('error'); await channel.send(message).catch(() => {}); } @@ -116,7 +116,7 @@ export class BushLogger { if (!sendChannel) return; const embed = new MessageEmbed() .setDescription(`**[${header}]** ${this.parseFormatting(this.stripColor(newContent), '', true)}`) - .setColor(this.client.util.colors.gray) + .setColor(util.colors.gray) .setTimestamp(); await this.channelLog({ embeds: [embed] }); } @@ -137,7 +137,7 @@ export class BushLogger { if (!sendChannel) return; const embed = new MessageEmbed() .setDescription(`**[${header}]** ${this.parseFormatting(this.stripColor(newContent), '', true)}`) - .setColor(this.client.util.colors.info) + .setColor(util.colors.info) .setTimestamp(); await this.channelLog({ embeds: [embed] }); } @@ -159,7 +159,7 @@ export class BushLogger { if (!sendChannel) return; const embed = new MessageEmbed() .setDescription(`**[${header}]** ${this.parseFormatting(this.stripColor(newContent), '', true)}`) - .setColor(this.client.util.colors.warn) + .setColor(util.colors.warn) .setTimestamp(); await this.channelLog({ embeds: [embed] }); } @@ -180,7 +180,7 @@ export class BushLogger { if (!sendChannel) return; const embed = new MessageEmbed() .setDescription(`**[${header}]** ${this.parseFormatting(this.stripColor(newContent), '', true)}`) - .setColor(this.client.util.colors.error) + .setColor(util.colors.error) .setTimestamp(); await this.channelError({ embeds: [embed] }); } @@ -201,7 +201,7 @@ export class BushLogger { if (!sendChannel) return; const embed = new MessageEmbed() .setDescription(`**[${header}]** ${this.parseFormatting(this.stripColor(newContent), '', true)}`) - .setColor(this.client.util.colors.success) + .setColor(util.colors.success) .setTimestamp(); await this.channelLog({ embeds: [embed] }).catch(() => {}); } diff --git a/src/lib/utils/Config.ts b/src/lib/utils/Config.ts index 65f43cb..663fe95 100644 --- a/src/lib/utils/Config.ts +++ b/src/lib/utils/Config.ts @@ -8,7 +8,7 @@ export interface ConfigOptions { channels: { log: Snowflake; error: Snowflake; dm: Snowflake }; db: { host: string; port: number; username: string; password: string }; logging: { db: boolean; verbose: boolean; info: boolean }; - supportGuild: {id: Snowflake, invite: string} + supportGuild: { id: Snowflake; invite: string }; } export class Config { @@ -19,7 +19,7 @@ export class Config { public channels: { log: Snowflake; error: Snowflake; dm: Snowflake }; public db: { host: string; port: number; username: string; password: string }; public logging: { db: boolean; verbose: boolean; info: boolean }; - public supportGuild: {id: Snowflake, invite: string} + public supportGuild: { id: Snowflake; invite: string }; public constructor(options: ConfigOptions) { this.credentials = options.credentials; @@ -29,7 +29,7 @@ export class Config { this.channels = options.channels; this.db = options.db; this.logging = options.logging; - this.supportGuild = options.supportGuild + this.supportGuild = options.supportGuild; } public get token(): string { -- cgit