diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/extensions/discord-akairo/BushClientUtil.ts | 4 | ||||
-rw-r--r-- | src/lib/models/Shared.ts | 10 | ||||
-rw-r--r-- | src/lib/utils/BushCache.ts | 1 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts index 3e066c8..12becd3 100644 --- a/src/lib/extensions/discord-akairo/BushClientUtil.ts +++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts @@ -476,7 +476,7 @@ export class BushClientUtil extends ClientUtil { * @param key The key of the element in the shared cache to update. * @param value The value to add/remove from the array. */ - public async insertOrRemoveFromShared<K extends Exclude<keyof typeof client['cache']['shared'], 'badWords'>>( + public async insertOrRemoveFromShared<K extends Exclude<keyof typeof client['cache']['shared'], 'badWords' | 'autoBanCode'>>( action: 'add' | 'remove', key: K, value: typeof client['cache']['shared'][K][0] @@ -510,7 +510,7 @@ export class BushClientUtil extends ClientUtil { * @param key The key in the shared cache to update. * @param value The value to set the key to. */ - public async setShared<K extends Exclude<keyof typeof client['cache']['shared'], 'badWords'>>( + public async setShared<K extends Exclude<keyof typeof client['cache']['shared'], 'badWords' | 'autoBanCode'>>( key: K, value: typeof client['cache']['shared'][K] ): Promise<Shared | void> { diff --git a/src/lib/models/Shared.ts b/src/lib/models/Shared.ts index a240ef9..acb5c1e 100644 --- a/src/lib/models/Shared.ts +++ b/src/lib/models/Shared.ts @@ -11,6 +11,7 @@ export interface SharedModel { badLinksSecret: string[]; badLinks: string[]; badWords: BadWords; + autoBanCode: string | null; } export interface SharedModelCreationAttributes { @@ -20,6 +21,7 @@ export interface SharedModelCreationAttributes { badLinksSecret?: string[]; badLinks?: string[]; badWords?: BadWords; + autoBanCode?: string; } export class Shared extends BaseModel<SharedModel, SharedModelCreationAttributes> implements SharedModel { @@ -54,6 +56,11 @@ export class Shared extends BaseModel<SharedModel, SharedModelCreationAttributes public declare badWords: BadWords; /** + * Code that is used to match for auto banning users in moulberry's bush + */ + public declare autoBanCode: string; + + /** * Initializes the model. * @param sequelize The sequelize instance. */ @@ -65,7 +72,8 @@ export class Shared extends BaseModel<SharedModel, SharedModelCreationAttributes privilegedUsers: { type: DataTypes.JSONB, allowNull: false, defaultValue: [] }, badLinksSecret: { type: DataTypes.JSONB, allowNull: false, defaultValue: [] }, badLinks: { type: DataTypes.JSONB, allowNull: false, defaultValue: [] }, - badWords: { type: DataTypes.JSONB, allowNull: false, defaultValue: {} } + badWords: { type: DataTypes.JSONB, allowNull: false, defaultValue: {} }, + autoBanCode: { type: DataTypes.TEXT } }, { sequelize, freezeTableName: true } ); diff --git a/src/lib/utils/BushCache.ts b/src/lib/utils/BushCache.ts index 1f50fba..22a13ef 100644 --- a/src/lib/utils/BushCache.ts +++ b/src/lib/utils/BushCache.ts @@ -20,6 +20,7 @@ export class SharedCache implements Omit<SharedModel, 'primaryKey'> { public badLinksSecret: string[] = []; public badLinks: string[] = []; public badWords: BadWords = {}; + public autoBanCode: string | null = null; } export class GuildCache extends Collection<Snowflake, Guild> {} |