diff options
Diffstat (limited to 'src/lib/models')
-rw-r--r-- | src/lib/models/ActivePunishment.ts | 28 | ||||
-rw-r--r-- | src/lib/models/Global.ts | 24 | ||||
-rw-r--r-- | src/lib/models/Guild.ts | 74 | ||||
-rw-r--r-- | src/lib/models/Level.ts | 14 | ||||
-rw-r--r-- | src/lib/models/ModLog.ts | 44 | ||||
-rw-r--r-- | src/lib/models/Stat.ts | 12 | ||||
-rw-r--r-- | src/lib/models/StickyRole.ts | 18 | ||||
-rw-r--r-- | src/lib/models/__helpers.ts | 2 |
8 files changed, 108 insertions, 108 deletions
diff --git a/src/lib/models/ActivePunishment.ts b/src/lib/models/ActivePunishment.ts index ec1b500..4512101 100644 --- a/src/lib/models/ActivePunishment.ts +++ b/src/lib/models/ActivePunishment.ts @@ -2,7 +2,7 @@ import { type Snowflake } from 'discord.js'; import { nanoid } from 'nanoid'; import { type Sequelize } from 'sequelize'; import { BaseModel } from './BaseModel.js'; -const { DataTypes } = (await import('sequelize')).default +const { DataTypes } = (await import('sequelize')).default; export enum ActivePunishmentType { BAN = 'BAN', @@ -35,38 +35,38 @@ export class ActivePunishment extends BaseModel<ActivePunishmentModel, ActivePunishmentModelCreationAttributes> implements ActivePunishmentModel { - /** - * The ID of this punishment (no real use just for a primary key) + /** + * The ID of this punishment (no real use just for a primary key) */ public declare id: string; - /** + /** * The type of punishment. */ public declare type: ActivePunishmentType; - /** - * The user who is punished. + /** + * The user who is punished. */ public declare user: Snowflake; - /** - * The guild they are punished in. + /** + * The guild they are punished in. */ public declare guild: Snowflake; - /** - * Additional info about the punishment if applicable. The channel id for channel blocks and role for punishment roles. + /** + * Additional info about the punishment if applicable. The channel id for channel blocks and role for punishment roles. */ public declare extraInfo: Snowflake; - /** - * The date when this punishment expires (optional). + /** + * The date when this punishment expires (optional). */ public declare expires: Date | null; - /** - * The reference to the modlog entry. + /** + * The reference to the modlog entry. */ public declare modlog: string; diff --git a/src/lib/models/Global.ts b/src/lib/models/Global.ts index b096c7f..e0cd7f9 100644 --- a/src/lib/models/Global.ts +++ b/src/lib/models/Global.ts @@ -3,7 +3,7 @@ import { type Sequelize } from 'sequelize'; import { BaseModel } from './BaseModel.js'; import { jsonArray } from './__helpers.js'; -const { DataTypes } = (await import('sequelize')).default +const { DataTypes } = (await import('sequelize')).default; export interface GlobalModel { environment: 'production' | 'development' | 'beta'; @@ -24,32 +24,32 @@ export interface GlobalModelCreationAttributes { } export class Global extends BaseModel<GlobalModel, GlobalModelCreationAttributes> implements GlobalModel { - /** - * The bot's environment. + /** + * The bot's environment. */ public declare environment: 'production' | 'development' | 'beta'; - /** - * Trusted users. + /** + * Trusted users. */ public declare superUsers: Snowflake[]; - /** - * Globally disabled commands. + /** + * Globally disabled commands. */ public declare disabledCommands: string[]; - /** - * Globally blacklisted users. + /** + * Globally blacklisted users. */ public declare blacklistedUsers: Snowflake[]; - /** - * Guilds blacklisted from using the bot. + /** + * Guilds blacklisted from using the bot. */ public declare blacklistedGuilds: Snowflake[]; - /** + /** * Channels where the bot is prevented from running commands in. */ public declare blacklistedChannels: Snowflake[]; diff --git a/src/lib/models/Guild.ts b/src/lib/models/Guild.ts index 78be846..02f487b 100644 --- a/src/lib/models/Guild.ts +++ b/src/lib/models/Guild.ts @@ -5,7 +5,7 @@ import { type BushClient } from '../extensions/discord-akairo/BushClient.js'; import { BaseModel } from './BaseModel.js'; import { jsonArray, jsonObject } from './__helpers.js'; -const { DataTypes } = (await import('sequelize')).default +const { DataTypes } = (await import('sequelize')).default; export interface GuildModel { id: Snowflake; @@ -50,93 +50,93 @@ export interface GuildModelCreationAttributes { } export class Guild extends BaseModel<GuildModel, GuildModelCreationAttributes> implements GuildModel { - /** - * The ID of the guild + /** + * The ID of the guild */ public declare id: Snowflake; - /** - * The bot's prefix for the guild + /** + * The bot's prefix for the guild */ public declare prefix: string; - /** - * Channels that will have their messages automatically published + /** + * Channels that will have their messages automatically published */ public declare autoPublishChannels: Snowflake[]; - /** - * Channels where the bot won't respond in. + /** + * Channels where the bot won't respond in. */ public declare blacklistedChannels: Snowflake[]; - /** - * Users that the bot ignores in this guild + /** + * Users that the bot ignores in this guild */ public declare blacklistedUsers: Snowflake[]; - /** - * The channels where the welcome messages are sent + /** + * The channels where the welcome messages are sent */ public declare welcomeChannel: Snowflake; - /** - * The role given out when muting someone + /** + * The role given out when muting someone */ public declare muteRole: Snowflake; - /** - * The message that gets sent after someone gets a punishment dm + /** + * The message that gets sent after someone gets a punishment dm */ public declare punishmentEnding: string; - /** - * Guild specific disabled commands + /** + * Guild specific disabled commands */ public declare disabledCommands: string[]; - /** - * Channels that should get locked down when the lockdown command gets used. + /** + * Channels that should get locked down when the lockdown command gets used. */ public declare lockdownChannels: Snowflake[]; - /** - * Custom automod phases + /** + * Custom automod phases */ public declare autoModPhases: BadWords; - /** - * The features enabled in a guild + /** + * The features enabled in a guild */ public declare enabledFeatures: GuildFeatures[]; - /** - * The roles to assign to a user if they are not assigned sticky roles + /** + * The roles to assign to a user if they are not assigned sticky roles */ public declare joinRoles: Snowflake[]; - /** - * The channels where logging messages will be sent. + /** + * The channels where logging messages will be sent. */ public declare logChannels: LogChannelDB; - /** - * These users will be able to use commands in channels blacklisted + /** + * These users will be able to use commands in channels blacklisted */ public declare bypassChannelBlacklist: Snowflake[]; - /** - * Channels where users will not earn xp for leveling. + /** + * Channels where users will not earn xp for leveling. */ public declare noXpChannels: Snowflake[]; - /** - * What roles get given to users when they reach certain levels. + /** + * What roles get given to users when they reach certain levels. */ public declare levelRoles: { [level: number]: Snowflake }; - /** - * The channel to send level up messages in instead of last channel. + /** + * The channel to send level up messages in instead of last channel. */ public declare levelUpChannel: Snowflake; diff --git a/src/lib/models/Level.ts b/src/lib/models/Level.ts index f1083fc..baf359b 100644 --- a/src/lib/models/Level.ts +++ b/src/lib/models/Level.ts @@ -2,7 +2,7 @@ import { type Snowflake } from 'discord.js'; import { type Sequelize } from 'sequelize'; import { BaseModel } from './BaseModel.js'; -const { DataTypes } = (await import('sequelize')).default +const { DataTypes } = (await import('sequelize')).default; export interface LevelModel { user: Snowflake; @@ -17,13 +17,13 @@ export interface LevelModelCreationAttributes { } export class Level extends BaseModel<LevelModel, LevelModelCreationAttributes> implements LevelModel { - /** - * The user's id. + /** + * The user's id. */ public declare user: Snowflake; - /** - * The guild where the user is gaining xp. + /** + * The guild where the user is gaining xp. */ public declare guild: Snowflake; @@ -32,8 +32,8 @@ export class Level extends BaseModel<LevelModel, LevelModelCreationAttributes> i */ public declare xp: number; - /** - * The user's level. + /** + * The user's level. */ public get level(): number { return Level.convertXpToLevel(this.xp); diff --git a/src/lib/models/ModLog.ts b/src/lib/models/ModLog.ts index bb1be8c..7d656a4 100644 --- a/src/lib/models/ModLog.ts +++ b/src/lib/models/ModLog.ts @@ -3,7 +3,7 @@ import { nanoid } from 'nanoid'; import { type Sequelize } from 'sequelize'; import { BaseModel } from './BaseModel.js'; import { jsonBoolean } from './__helpers.js'; -const { DataTypes } = (await import('sequelize')).default +const { DataTypes } = (await import('sequelize')).default; export enum ModLogType { PERM_BAN = 'PERM_BAN', @@ -49,53 +49,53 @@ export interface ModLogModelCreationAttributes { } export class ModLog extends BaseModel<ModLogModel, ModLogModelCreationAttributes> implements ModLogModel { - /** - * The primary key of the modlog entry. + /** + * The primary key of the modlog entry. */ public declare id: string; - - /** - * The type of punishment. + + /** + * The type of punishment. */ public declare type: ModLogType; - /** - * The user being punished. + /** + * The user being punished. */ public declare user: Snowflake; - /** - * The user carrying out the punishment. + /** + * The user carrying out the punishment. */ public declare moderator: Snowflake; - /** - * The reason the user is getting punished. + /** + * The reason the user is getting punished. */ public declare reason: string | null; - /** - * The amount of time the user is getting punished for. + /** + * The amount of time the user is getting punished for. */ public declare duration: number | null; - /** - * The guild the user is getting punished in. + /** + * The guild the user is getting punished in. */ public declare guild: Snowflake; - /** - * Evidence of what the user is getting punished for. + /** + * Evidence of what the user is getting punished for. */ public declare evidence: string; - /** - * Not an actual modlog just used so a punishment entry can be made. + /** + * Not an actual modlog just used so a punishment entry can be made. */ public declare pseudo: boolean; - /** - * Hides from the modlog command unless show hidden is specified. + /** + * Hides from the modlog command unless show hidden is specified. */ public declare hidden: boolean; diff --git a/src/lib/models/Stat.ts b/src/lib/models/Stat.ts index 31111df..4ecabb8 100644 --- a/src/lib/models/Stat.ts +++ b/src/lib/models/Stat.ts @@ -1,7 +1,7 @@ import { type Sequelize } from 'sequelize'; import { BaseModel } from './BaseModel.js'; import { jsonBigint } from './__helpers.js'; -const { DataTypes } = (await import('sequelize')).default +const { DataTypes } = (await import('sequelize')).default; type Environment = 'production' | 'development' | 'beta'; @@ -16,14 +16,14 @@ export interface StatModelCreationAttributes { } export class Stat extends BaseModel<StatModel, StatModelCreationAttributes> implements StatModel { - /** - * The bot's environment. + /** + * The bot's environment. */ public declare environment: Environment; - /** - * The number of commands used - */ + /** + * The number of commands used + */ public declare commandsUsed: bigint; public static initModel(sequelize: Sequelize): void { diff --git a/src/lib/models/StickyRole.ts b/src/lib/models/StickyRole.ts index 63c9726..64f0b4d 100644 --- a/src/lib/models/StickyRole.ts +++ b/src/lib/models/StickyRole.ts @@ -2,7 +2,7 @@ import { type Snowflake } from 'discord.js'; import { type Sequelize } from 'sequelize'; import { BaseModel } from './BaseModel.js'; import { jsonArray } from './__helpers.js'; -const { DataTypes } = (await import('sequelize')).default +const { DataTypes } = (await import('sequelize')).default; export interface StickyRoleModel { user: Snowflake; @@ -18,23 +18,23 @@ export interface StickyRoleModelCreationAttributes { } export class StickyRole extends BaseModel<StickyRoleModel, StickyRoleModelCreationAttributes> implements StickyRoleModel { - /** - * The id of the user the roles belongs to. + /** + * The id of the user the roles belongs to. */ public declare user: Snowflake; - /** - * The guild where this should happen. + /** + * The guild where this should happen. */ public declare guild: Snowflake; - /** - * The roles that the user should have returned + /** + * The roles that the user should have returned */ public declare roles: Snowflake[]; - /** - * The user's previous nickname + /** + * The user's previous nickname */ public declare nickname: string; diff --git a/src/lib/models/__helpers.ts b/src/lib/models/__helpers.ts index 8c98d5b..75737c5 100644 --- a/src/lib/models/__helpers.ts +++ b/src/lib/models/__helpers.ts @@ -1,6 +1,6 @@ import { type Model } from 'sequelize'; -const { DataTypes } = (await import('sequelize')).default +const { DataTypes } = (await import('sequelize')).default; export function jsonParseGet(this: Model, key: string): any { return JSON.parse(this.getDataValue(key)); |