diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-07-06 19:49:53 +0200 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-07-06 19:49:53 +0200 |
commit | eb417485c9c8171f20ec30519dcfdbe60c267fef (patch) | |
tree | d856af9d14262e234bd52fd31ff76614aee2238c | |
parent | 627cbf6bebccb5bf2b36dea60e131cb53ce1e753 (diff) | |
download | tanzanite-eb417485c9c8171f20ec30519dcfdbe60c267fef.tar.gz tanzanite-eb417485c9c8171f20ec30519dcfdbe60c267fef.tar.bz2 tanzanite-eb417485c9c8171f20ec30519dcfdbe60c267fef.zip |
minimal config changes
-rw-r--r-- | config/Config.ts | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/config/Config.ts b/config/Config.ts index ce5ec06..7504658 100644 --- a/config/Config.ts +++ b/config/Config.ts @@ -1,4 +1,4 @@ -import { type Snowflake } from 'discord.js'; +import type { Snowflake } from 'discord.js'; export class Config { public credentials: Credentials; @@ -21,22 +21,37 @@ export class Config { this.supportGuild = options.supportGuild; } + /** + * The appropriate discord token for the environment. + */ public get token(): string { - return this.environment === 'production' - ? this.credentials.token - : this.environment === 'beta' - ? this.credentials.betaToken - : this.credentials.devToken; + switch (this.environment) { + case 'production': + return this.credentials.token; + case 'beta': + return this.credentials.betaToken; + case 'development': + return this.credentials.devToken; + } } + /** + * Whether this is the production instance of the bot. + */ public get isProduction(): boolean { return this.environment === 'production'; } + /** + * Whether this is the beta instance of the bot. + */ public get isBeta(): boolean { return this.environment === 'beta'; } + /** + * Whether this is the development instance of the bot. + */ public get isDevelopment(): boolean { return this.environment === 'development'; } |