diff options
Diffstat (limited to 'src/lib/models')
-rw-r--r-- | src/lib/models/ActivePunishment.ts | 41 | ||||
-rw-r--r-- | src/lib/models/BaseModel.ts | 15 | ||||
-rw-r--r-- | src/lib/models/Global.ts | 36 | ||||
-rw-r--r-- | src/lib/models/Guild.ts | 98 | ||||
-rw-r--r-- | src/lib/models/Level.ts | 20 | ||||
-rw-r--r-- | src/lib/models/ModLog.ts | 41 | ||||
-rw-r--r-- | src/lib/models/StickyRole.ts | 28 |
7 files changed, 239 insertions, 40 deletions
diff --git a/src/lib/models/ActivePunishment.ts b/src/lib/models/ActivePunishment.ts index 9fcafbe..c204c9a 100644 --- a/src/lib/models/ActivePunishment.ts +++ b/src/lib/models/ActivePunishment.ts @@ -36,31 +36,58 @@ export class ActivePunishment /** * The ID of this punishment (no real use just for a primary key) */ - id: string; + public get id(): string { + return null; + } + public set id(value: string) {} + /** * The type of punishment. */ - type: ActivePunishmentType; + public get type(): ActivePunishmentType { + return null; + } + public set type(value: ActivePunishmentType) {} + /** * The user who is punished. */ - user: Snowflake; + public get user(): Snowflake { + return null; + } + public set user(value: Snowflake) {} + /** * The guild they are punished in. */ - guild: Snowflake; + public get guild(): Snowflake { + return null; + } + public set guild(value: Snowflake) {} + /** * Additional info about the punishment if applicable. The channel id for channel blocks and role for punishment roles. */ - extraInfo: Snowflake; + public get extraInfo(): Snowflake { + return null; + } + public set extraInfo(value: Snowflake) {} + /** * The date when this punishment expires (optional). */ - expires: Date | null; + public get expires(): Date | null { + return null; + } + public set expires(value: Date | null) {} + /** * The reference to the modlog entry. */ - modlog: string; + public get modlog(): string { + return null; + } + public set modlog(value: string) {} static initModel(sequelize: Sequelize): void { ActivePunishment.init( diff --git a/src/lib/models/BaseModel.ts b/src/lib/models/BaseModel.ts index fdbd706..340e0aa 100644 --- a/src/lib/models/BaseModel.ts +++ b/src/lib/models/BaseModel.ts @@ -1,6 +1,17 @@ import { Model } from 'sequelize'; export abstract class BaseModel<A, B> extends Model<A, B> { - public readonly createdAt: Date; - public readonly updatedAt: Date; + /** + * The date when the row was created. + */ + public get createdAt(): Date { + return null; + } + + /** + * The date when the row was last updated. + */ + public get updatedAt(): Date { + return null; + } } diff --git a/src/lib/models/Global.ts b/src/lib/models/Global.ts index e37ef2b..80f11ca 100644 --- a/src/lib/models/Global.ts +++ b/src/lib/models/Global.ts @@ -24,27 +24,51 @@ export class Global extends BaseModel<GlobalModel, GlobalModelCreationAttributes /** * The bot's environment. */ - environment: 'production' | 'development' | 'beta'; + public get environment(): 'production' | 'development' | 'beta' { + return null; + } + public set environment(value: 'production' | 'development' | 'beta') {} + /** * Trusted users. */ - superUsers: Snowflake[]; + public get superUsers(): Snowflake[] { + return null; + } + public set superUsers(value: Snowflake[]) {} + /** * Globally disabled commands. */ - disabledCommands: string[]; + public get disabledCommands(): string[] { + return null; + } + public set disabledCommands(value: string[]) {} + /** * Globally blacklisted users. */ - blacklistedUsers: Snowflake[]; + public get blacklistedUsers(): Snowflake[] { + return null; + } + public set blacklistedUsers(value: Snowflake[]) {} + /** * Guilds blacklisted from using the bot. */ - blacklistedGuilds: Snowflake[]; + public get blacklistedGuilds(): Snowflake[] { + return null; + } + public set blacklistedGuilds(value: Snowflake[]) {} + /** * Channels where the bot is prevented from running. */ - blacklistedChannels: Snowflake[]; + public get blacklistedChannels(): Snowflake[] { + return null; + } + public set blacklistedChannels(value: Snowflake[]) {} + static initModel(sequelize: Sequelize): void { Global.init( { diff --git a/src/lib/models/Guild.ts b/src/lib/models/Guild.ts index 7a0384c..aac4267 100644 --- a/src/lib/models/Guild.ts +++ b/src/lib/models/Guild.ts @@ -32,17 +32,93 @@ export interface GuildModelCreationAttributes { } export class Guild extends BaseModel<GuildModel, GuildModelCreationAttributes> implements GuildModel { - id!: Snowflake; - prefix!: string; - autoPublishChannels: Snowflake[]; - blacklistedChannels: Snowflake[]; - blacklistedUsers: Snowflake[]; - welcomeChannel: Snowflake; - muteRole: Snowflake; - punishmentEnding: string; - disabledCommands: string[]; - lockdownChannels: Snowflake[]; - autoModPhases: string[]; + /** + * The ID of the guild + */ + public get id(): Snowflake { + return null; + } + public set id(value: Snowflake) {} + + /** + * The bot's prefix for the guild + */ + public get prefix(): string { + return null; + } + public set prefix(value: string) {} + + /** + * Channels that will have their messages automatically published + */ + public get autoPublishChannels(): Snowflake[] { + return null; + } + public set autoPublishChannels(value: Snowflake[]) {} + + /** + * Channels where the bot won't respond in. + */ + public get blacklistedChannels(): Snowflake[] { + return null; + } + public set blacklistedChannels(value: Snowflake[]) {} + + /** + * Users that the bot ignores in this guild + */ + public get blacklistedUsers(): Snowflake[] { + return null; + } + public set blacklistedUsers(value: Snowflake[]) {} + + /** + * The channels where the welcome messages are sent + */ + public get welcomeChannel(): Snowflake { + return null; + } + public set welcomeChannel(value: Snowflake) {} + + /** + * The role given out when muting someone + */ + public get muteRole(): Snowflake { + return null; + } + public set muteRole(value: Snowflake) {} + + /** + * The message that gets sent after someone gets a punishment dm + */ + public get punishmentEnding(): string { + return null; + } + public set punishmentEnding(value: string) {} + + /** + * Guild specific disabled commands + */ + public get disabledCommands(): string[] { + return null; + } + public set disabledCommands(value: string[]) {} + + /** + * Channels that should get locked down when the lockdown command gets used. + */ + public get lockdownChannels(): Snowflake[] { + return null; + } + public set lockdownChannels(value: Snowflake[]) {} + + /** + * Custom automod phases + */ + public get autoModPhases(): string[] { + return null; + } + public set autoModPhases(value: string[]) {} static initModel(sequelize: Sequelize, client: BushClient): void { Guild.init( diff --git a/src/lib/models/Level.ts b/src/lib/models/Level.ts index 755b1c6..d8b98bf 100644 --- a/src/lib/models/Level.ts +++ b/src/lib/models/Level.ts @@ -18,16 +18,28 @@ export class Level extends BaseModel<LevelModel, LevelModelCreationAttributes> { /** * The user's id. */ - public user: Snowflake; + public get user(): Snowflake { + return null; + } + public set user(value: Snowflake) {} + /** * The guild where the user is gaining xp. */ - public guild: Snowflake; + public get guild(): Snowflake { + return null; + } + public set guild(value: Snowflake) {} + /** * The user's xp. */ - public xp: number; - get level(): number { + public get xp(): number { + return null; + } + public set xp(value: number) {} + + public get level(): number { return Level.convertXpToLevel(this.xp); } diff --git a/src/lib/models/ModLog.ts b/src/lib/models/ModLog.ts index 3375751..6933432 100644 --- a/src/lib/models/ModLog.ts +++ b/src/lib/models/ModLog.ts @@ -44,31 +44,58 @@ export class ModLog extends BaseModel<ModLogModel, ModLogModelCreationAttributes /** * The primary key of the modlog entry. */ - id: string; + public get id(): string { + return null; + } + public set id(value: string) {} + /** * The type of punishment. */ - type: ModLogType; + public get type(): ModLogType { + return null; + } + public set type(value: ModLogType) {} + /** * The user being punished. */ - user: Snowflake; + public get user(): Snowflake { + return null; + } + public set user(value: Snowflake) {} + /** * The user carrying out the punishment. */ - moderator: Snowflake; + public get moderator(): Snowflake { + return null; + } + public set moderator(value: Snowflake) {} + /** * The reason the user is getting punished */ - reason: string | null; + public get reason(): string | null { + return null; + } + public set reason(value: string | null) {} + /** * The amount of time the user is getting punished for. */ - duration: number | null; + public get duration(): number | null { + return null; + } + public set duration(value: number | null) {} + /** * The guild the user is getting punished in. */ - guild: Snowflake; + public get guild(): Snowflake { + return null; + } + public set guild(value: Snowflake) {} static initModel(sequelize: Sequelize): void { ModLog.init( diff --git a/src/lib/models/StickyRole.ts b/src/lib/models/StickyRole.ts index a3928e7..c71ecb7 100644 --- a/src/lib/models/StickyRole.ts +++ b/src/lib/models/StickyRole.ts @@ -14,9 +14,31 @@ export interface StickyRoleModelCreationAttributes { } export class StickyRole extends BaseModel<StickyRoleModel, StickyRoleModelCreationAttributes> implements StickyRoleModel { - user: Snowflake; - guild: Snowflake; - roles: Snowflake[]; + /** + * The id of the user the roles belongs to + */ + + public get user(): Snowflake { + return null; + } + public set user(value: Snowflake) {} + + /** + * The guild where this should happen + */ + public get guild(): Snowflake { + return null; + } + public set guild(value: Snowflake) {} + + /** + * The roles that the user should have returned + */ + public get roles(): Snowflake[] { + return null; + } + public set roles(value: Snowflake[]) {} + static initModel(sequelize: Sequelize): void { StickyRole.init( { |