diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-31 22:38:06 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-31 22:38:06 -0400 |
commit | c40a94697d64962edda41345e03fa76f51aa431c (patch) | |
tree | 1e258d51d6b19b9918f1d478b3f4c51dca3adc93 /src/lib/models/Global.ts | |
parent | 901d9dfc8c5d95b8c76519e700c624294d4df787 (diff) | |
download | tanzanite-c40a94697d64962edda41345e03fa76f51aa431c.tar.gz tanzanite-c40a94697d64962edda41345e03fa76f51aa431c.tar.bz2 tanzanite-c40a94697d64962edda41345e03fa76f51aa431c.zip |
upgrade typescript, improve workflow, bunch of bug fixes and some other things
Diffstat (limited to 'src/lib/models/Global.ts')
-rw-r--r-- | src/lib/models/Global.ts | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/src/lib/models/Global.ts b/src/lib/models/Global.ts index c5c680d..6b6ebae 100644 --- a/src/lib/models/Global.ts +++ b/src/lib/models/Global.ts @@ -1,5 +1,5 @@ -import { Snowflake } from 'discord.js'; -import { DataTypes, Sequelize } from 'sequelize'; +import { type Snowflake } from 'discord.js'; +import { DataTypes, type Sequelize } from 'sequelize'; import { BaseModel } from './BaseModel'; import { jsonArray } from './__helpers'; @@ -21,28 +21,37 @@ export interface GlobalModelCreationAttributes { blacklistedChannels?: Snowflake[]; } -// declaration merging so that the fields don't override Sequelize's getters -export interface Global { - /** The bot's environment. */ - environment: 'production' | 'development' | 'beta'; +export class Global extends BaseModel<GlobalModel, GlobalModelCreationAttributes> implements GlobalModel { + /** + * The bot's environment. + */ + public declare environment: 'production' | 'development' | 'beta'; - /** Trusted users. */ - superUsers: Snowflake[]; + /** + * Trusted users. + */ + public declare superUsers: Snowflake[]; - /** Globally disabled commands. */ - disabledCommands: string[]; + /** + * Globally disabled commands. + */ + public declare disabledCommands: string[]; - /** Globally blacklisted users. */ - blacklistedUsers: Snowflake[]; + /** + * Globally blacklisted users. + */ + public declare blacklistedUsers: Snowflake[]; - /** Guilds blacklisted from using the bot. */ - blacklistedGuilds: Snowflake[]; + /** + * Guilds blacklisted from using the bot. + */ + public declare blacklistedGuilds: Snowflake[]; - /** Channels where the bot is prevented from running. */ - blacklistedChannels: Snowflake[]; -} + /** + * Channels where the bot is prevented from running commands in. + */ + public declare blacklistedChannels: Snowflake[]; -export class Global extends BaseModel<GlobalModel, GlobalModelCreationAttributes> implements GlobalModel { public static initModel(sequelize: Sequelize): void { Global.init( { |