diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-06-20 22:52:50 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-06-20 22:52:50 -0400 |
commit | 5c3da90f441c321f55ae735d6002f4da91f2481e (patch) | |
tree | ac6a993595eebe38fd5e7bd79ade4c5ec71be373 /src/lib/models/Global.ts | |
parent | 87e77ae8cc69d0d7f1e3d6f614b03c9297e85ab3 (diff) | |
download | tanzanite-5c3da90f441c321f55ae735d6002f4da91f2481e.tar.gz tanzanite-5c3da90f441c321f55ae735d6002f4da91f2481e.tar.bz2 tanzanite-5c3da90f441c321f55ae735d6002f4da91f2481e.zip |
feat(*): aaaaa
Diffstat (limited to 'src/lib/models/Global.ts')
-rw-r--r-- | src/lib/models/Global.ts | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/lib/models/Global.ts b/src/lib/models/Global.ts new file mode 100644 index 0000000..65f51c4 --- /dev/null +++ b/src/lib/models/Global.ts @@ -0,0 +1,50 @@ +import { Snowflake } from 'discord.js'; +import { DataTypes, Optional, Sequelize } from 'sequelize'; +import { BaseModel } from './BaseModel'; + +export interface GlobalModel { + superUsers: Snowflake[]; + disabledCommands: string[]; + blacklistedUsers: Snowflake[]; + blacklistedGuilds: Snowflake[]; + blacklistedChannels: Snowflake[]; +} +export type GlobalModelCreationAttributes = Optional< + GlobalModel, + 'superUsers' | 'disabledCommands' | 'blacklistedUsers' | 'blacklistedGuilds' | 'blacklistedChannels' +>; + +export class Global extends BaseModel<GlobalModel, GlobalModelCreationAttributes> implements GlobalModel { + superUsers: Snowflake[]; + disabledCommands: string[]; + blacklistedUsers: Snowflake[]; + blacklistedGuilds: Snowflake[]; + blacklistedChannels: Snowflake[]; + static initModel(sequelize: Sequelize): void { + Global.init( + { + superUsers: { + type: DataTypes.ARRAY(DataTypes.STRING), + allowNull: true + }, + disabledCommands: { + type: DataTypes.ARRAY(DataTypes.STRING), + allowNull: true + }, + blacklistedUsers: { + type: DataTypes.ARRAY(DataTypes.STRING), + allowNull: true + }, + blacklistedGuilds: { + type: DataTypes.ARRAY(DataTypes.STRING), + allowNull: true + }, + blacklistedChannels: { + type: DataTypes.ARRAY(DataTypes.STRING), + allowNull: true + } + }, + { sequelize } + ); + } +} |