From 2356d2c44736fb83021dacb551625852111c8ce6 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:42:12 -0400 Subject: restructure, experimental presence and member automod, fixed bugs probably made some more bugs --- src/lib/models/instance/Highlight.ts | 81 ------------------------------------ 1 file changed, 81 deletions(-) delete mode 100644 src/lib/models/instance/Highlight.ts (limited to 'src/lib/models/instance/Highlight.ts') diff --git a/src/lib/models/instance/Highlight.ts b/src/lib/models/instance/Highlight.ts deleted file mode 100644 index 5889fad..0000000 --- a/src/lib/models/instance/Highlight.ts +++ /dev/null @@ -1,81 +0,0 @@ -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; - -export interface HighlightModel { - pk: string; - user: Snowflake; - guild: Snowflake; - words: HighlightWord[]; - blacklistedChannels: Snowflake[]; - blacklistedUsers: Snowflake[]; -} - -export interface HighLightCreationAttributes { - pk?: string; - user: Snowflake; - guild: Snowflake; - words?: HighlightWord[]; - blacklistedChannels?: Snowflake[]; - blacklistedUsers?: Snowflake[]; -} - -export interface HighlightWord { - word: string; - regex: boolean; -} - -/** - * List of words that should cause the user to be notified for if found in the specified guild. - */ -export class Highlight extends BaseModel<HighlightModel, HighLightCreationAttributes> implements HighlightModel { - /** - * The primary key of the highlight. - */ - public declare pk: string; - - /** - * The user that the highlight is for. - */ - public declare user: Snowflake; - - /** - * The guild to look for highlights in. - */ - public declare guild: Snowflake; - - /** - * The words to look for. - */ - public declare words: HighlightWord[]; - - /** - * Channels that the user choose to ignore highlights in. - */ - public declare blacklistedChannels: Snowflake[]; - - /** - * Users that the user choose to ignore highlights from. - */ - public declare blacklistedUsers: Snowflake[]; - - /** - * Initializes the model. - * @param sequelize The sequelize instance. - */ - public static initModel(sequelize: Sequelize): void { - Highlight.init( - { - pk: { type: DataTypes.STRING, primaryKey: true, defaultValue: nanoid }, - user: { type: DataTypes.STRING, allowNull: false }, - guild: { type: DataTypes.STRING, allowNull: false }, - words: { type: DataTypes.JSONB, allowNull: false, defaultValue: [] }, - blacklistedChannels: { type: DataTypes.JSONB, allowNull: false, defaultValue: [] }, - blacklistedUsers: { type: DataTypes.JSONB, allowNull: false, defaultValue: [] } - }, - { sequelize } - ); - } -} -- cgit