aboutsummaryrefslogtreecommitdiff
path: root/src/lib/utils/Config.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-16 14:32:18 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-16 14:32:18 -0400
commit0e87bbd3940d89defcb04926587b35c8f4d1947f (patch)
treee50860d4dc25a11d4c3977b583284c4bcad1b077 /src/lib/utils/Config.ts
parent661e4c9935aeb8760dafc7ced4bbec6cc356a033 (diff)
downloadtanzanite-0e87bbd3940d89defcb04926587b35c8f4d1947f.tar.gz
tanzanite-0e87bbd3940d89defcb04926587b35c8f4d1947f.tar.bz2
tanzanite-0e87bbd3940d89defcb04926587b35c8f4d1947f.zip
remove util classes, move config out of src
Diffstat (limited to 'src/lib/utils/Config.ts')
-rw-r--r--src/lib/utils/Config.ts93
1 files changed, 0 insertions, 93 deletions
diff --git a/src/lib/utils/Config.ts b/src/lib/utils/Config.ts
deleted file mode 100644
index ce5ec06..0000000
--- a/src/lib/utils/Config.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-import { type Snowflake } from 'discord.js';
-
-export class Config {
- public credentials: Credentials;
- public environment: Environment;
- public owners: Snowflake[];
- public prefix: string;
- public channels: Channels;
- public db: DataBase;
- public logging: Logging;
- public supportGuild: SupportGuild;
-
- public constructor(options: ConfigOptions) {
- this.credentials = options.credentials;
- this.environment = options.environment;
- this.owners = options.owners;
- this.prefix = options.prefix;
- this.channels = options.channels;
- this.db = options.db;
- this.logging = options.logging;
- this.supportGuild = options.supportGuild;
- }
-
- public get token(): string {
- return this.environment === 'production'
- ? this.credentials.token
- : this.environment === 'beta'
- ? this.credentials.betaToken
- : this.credentials.devToken;
- }
-
- public get isProduction(): boolean {
- return this.environment === 'production';
- }
-
- public get isBeta(): boolean {
- return this.environment === 'beta';
- }
-
- public get isDevelopment(): boolean {
- return this.environment === 'development';
- }
-}
-
-export interface ConfigOptions {
- credentials: Credentials;
- environment: Environment;
- owners: Snowflake[];
- prefix: string;
- channels: Channels;
- db: DataBase;
- logging: Logging;
- supportGuild: SupportGuild;
-}
-
-interface Credentials {
- token: string;
- betaToken: string;
- devToken: string;
- hypixelApiKey: string;
- wolframAlphaAppId: string;
- imgurClientId: string;
- imgurClientSecret: string;
- sentryDsn: string;
- perspectiveApiKey: string;
-}
-
-type Environment = 'production' | 'beta' | 'development';
-
-interface Channels {
- log: Snowflake;
- error: Snowflake;
- dm: Snowflake;
- servers: Snowflake;
-}
-
-interface DataBase {
- host: string;
- port: number;
- username: string;
- password: string;
-}
-
-interface Logging {
- db: boolean;
- verbose: boolean;
- info: boolean;
-}
-
-interface SupportGuild {
- id: Snowflake;
- invite: string;
-}