aboutsummaryrefslogtreecommitdiff
path: root/lib/models
diff options
context:
space:
mode:
Diffstat (limited to 'lib/models')
-rw-r--r--lib/models/instance/ActivePunishment.ts8
-rw-r--r--lib/models/instance/Guild.ts10
-rw-r--r--lib/models/instance/Level.ts3
-rw-r--r--lib/models/instance/ModLog.ts123
4 files changed, 71 insertions, 73 deletions
diff --git a/lib/models/instance/ActivePunishment.ts b/lib/models/instance/ActivePunishment.ts
index 9bd9d01..1b57f47 100644
--- a/lib/models/instance/ActivePunishment.ts
+++ b/lib/models/instance/ActivePunishment.ts
@@ -4,10 +4,10 @@ import { DataTypes, type Sequelize } from 'sequelize';
import { BaseModel } from '../BaseModel.js';
export enum ActivePunishmentType {
- BAN = 'BAN',
- MUTE = 'MUTE',
- ROLE = 'ROLE',
- BLOCK = 'BLOCK'
+ Ban = 'BAN',
+ Mute = 'MUTE',
+ Role = 'ROLE',
+ Block = 'BLOCK'
}
export interface ActivePunishmentModel {
diff --git a/lib/models/instance/Guild.ts b/lib/models/instance/Guild.ts
index 72091ca..462beee 100644
--- a/lib/models/instance/Guild.ts
+++ b/lib/models/instance/Guild.ts
@@ -210,7 +210,7 @@ export const guildSettingsObj = asGuildSetting({
name: 'Auto Publish Channels',
description: 'Channels were every message is automatically published.',
type: 'channel-array',
- subType: [ChannelType.GuildNews]
+ subType: [ChannelType.GuildAnnouncement]
},
welcomeChannel: {
name: 'Welcome Channel',
@@ -218,10 +218,10 @@ export const guildSettingsObj = asGuildSetting({
type: 'channel',
subType: [
ChannelType.GuildText,
- ChannelType.GuildNews,
- ChannelType.GuildNewsThread,
- ChannelType.GuildPublicThread,
- ChannelType.GuildPrivateThread
+ ChannelType.GuildAnnouncement,
+ ChannelType.AnnouncementThread,
+ ChannelType.PublicThread,
+ ChannelType.PrivateThread
]
},
muteRole: {
diff --git a/lib/models/instance/Level.ts b/lib/models/instance/Level.ts
index e22d63b..27def46 100644
--- a/lib/models/instance/Level.ts
+++ b/lib/models/instance/Level.ts
@@ -18,6 +18,9 @@ export interface LevelModelCreationAttributes {
* Leveling information for a user in a guild.
*/
export class Level extends BaseModel<LevelModel, LevelModelCreationAttributes> implements LevelModel {
+ public static MAX_XP = 2147483647;
+ public static MAX_LEVEL = Level.convertXpToLevel(Level.MAX_XP);
+
/**
* The user's id.
*/
diff --git a/lib/models/instance/ModLog.ts b/lib/models/instance/ModLog.ts
index 324ad83..7a1a60a 100644
--- a/lib/models/instance/ModLog.ts
+++ b/lib/models/instance/ModLog.ts
@@ -4,104 +4,98 @@ import { DataTypes, type Sequelize } from 'sequelize';
import { BaseModel } from '../BaseModel.js';
export enum ModLogType {
- PERM_BAN = 'PERM_BAN',
- TEMP_BAN = 'TEMP_BAN',
- UNBAN = 'UNBAN',
- KICK = 'KICK',
- PERM_MUTE = 'PERM_MUTE',
- TEMP_MUTE = 'TEMP_MUTE',
- UNMUTE = 'UNMUTE',
- WARN = 'WARN',
- PERM_PUNISHMENT_ROLE = 'PERM_PUNISHMENT_ROLE',
- TEMP_PUNISHMENT_ROLE = 'TEMP_PUNISHMENT_ROLE',
- REMOVE_PUNISHMENT_ROLE = 'REMOVE_PUNISHMENT_ROLE',
- PERM_CHANNEL_BLOCK = 'PERM_CHANNEL_BLOCK',
- TEMP_CHANNEL_BLOCK = 'TEMP_CHANNEL_BLOCK',
- CHANNEL_UNBLOCK = 'CHANNEL_UNBLOCK',
- TIMEOUT = 'TIMEOUT',
- REMOVE_TIMEOUT = 'REMOVE_TIMEOUT'
+ PermBan = 'PERM_BAN',
+ TempBan = 'TEMP_BAN',
+ Unban = 'UNBAN',
+ Kick = 'KICK',
+ PermMute = 'PERM_MUTE',
+ TempMute = 'TEMP_MUTE',
+ Unmute = 'UNMUTE',
+ Warn = 'WARN',
+ PermPunishmentRole = 'PERM_PUNISHMENT_ROLE',
+ TempPunishmentRole = 'TEMP_PUNISHMENT_ROLE',
+ RemovePunishmentRole = 'REMOVE_PUNISHMENT_ROLE',
+ PermChannelBlock = 'PERM_CHANNEL_BLOCK',
+ TempChannelBlock = 'TEMP_CHANNEL_BLOCK',
+ ChannelUnblock = 'CHANNEL_UNBLOCK',
+ Timeout = 'TIMEOUT',
+ RemoveTimeout = 'REMOVE_TIMEOUT'
}
-export interface ModLogModel {
- id: string;
- type: ModLogType;
- user: Snowflake;
- moderator: Snowflake;
- reason: string | null;
- duration: number | null;
- guild: Snowflake;
- evidence: string;
- pseudo: boolean;
- hidden: boolean;
-}
-
-export interface ModLogModelCreationAttributes {
- id?: string;
- type: ModLogType;
- user: Snowflake;
- moderator: Snowflake;
- reason?: string | null;
- duration?: number;
- guild: Snowflake;
- evidence?: string;
- pseudo?: boolean;
- hidden?: boolean;
+export enum AppealStatus {
+ None = 'NONE',
+ Submitted = 'SUBMITTED',
+ Accepted = 'ACCEPTED',
+ Denied = 'DENIED'
}
-/**
- * A mod log case.
- */
-export class ModLog extends BaseModel<ModLogModel, ModLogModelCreationAttributes> implements ModLogModel {
+export interface ModLogModel {
/**
* The primary key of the modlog entry.
*/
- public declare id: string;
-
+ id: string;
/**
* The type of punishment.
*/
- public declare type: ModLogType;
-
+ type: ModLogType;
/**
* The user being punished.
*/
- public declare user: Snowflake;
-
+ user: Snowflake;
/**
* The user carrying out the punishment.
*/
- public declare moderator: Snowflake;
-
+ moderator: Snowflake;
/**
* The reason the user is getting punished.
*/
- public declare reason: string | null;
-
+ reason: string | null;
/**
* The amount of time the user is getting punished for.
*/
- public declare duration: number | null;
-
+ duration: number | null;
/**
* The guild the user is getting punished in.
*/
- public declare guild: Snowflake;
-
+ guild: Snowflake;
/**
* Evidence of what the user is getting punished for.
*/
- public declare evidence: string;
-
+ evidence: string;
/**
* Not an actual modlog just used so a punishment entry can be made.
*/
- public declare pseudo: boolean;
-
+ pseudo: boolean;
/**
* Hides from the modlog command unless show hidden is specified.
*/
- public declare hidden: boolean;
+ hidden: boolean;
+ /**
+ * The status of an appeal for this punishment
+ */
+ appeal: AppealStatus;
+}
+export interface ModLogModelCreationAttributes {
+ id?: string;
+ type: ModLogType;
+ user: Snowflake;
+ moderator: Snowflake;
+ reason?: string | null;
+ duration?: number;
+ guild: Snowflake;
+ evidence?: string;
+ pseudo?: boolean;
+ hidden?: boolean;
+ appeal?: AppealStatus;
+}
+
+export interface ModLog extends ModLogModel {}
+
+/**
+ * A mod log case.
+ */
+export class ModLog extends BaseModel<ModLogModel, ModLogModelCreationAttributes> {
/**
* Initializes the model.
* @param sequelize The sequelize instance.
@@ -118,7 +112,8 @@ export class ModLog extends BaseModel<ModLogModel, ModLogModelCreationAttributes
guild: { type: DataTypes.STRING, references: { model: 'Guilds', key: 'id' } },
evidence: { type: DataTypes.TEXT, allowNull: true },
pseudo: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: false },
- hidden: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: false }
+ hidden: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: false },
+ appeal: { type: DataTypes.STRING, allowNull: false, defaultValue: AppealStatus.None }
},
{ sequelize }
);