diff --git a/src/api/routes/guilds/#guild_id/bulk-ban.ts b/src/api/routes/guilds/#guild_id/bulk-ban.ts index f544103a..10505282 100644 --- a/src/api/routes/guilds/#guild_id/bulk-ban.ts +++ b/src/api/routes/guilds/#guild_id/bulk-ban.ts @@ -27,6 +27,7 @@ import { } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; +import { Config } from "@spacebar/util"; const router: Router = Router(); @@ -52,7 +53,9 @@ router.post( const userIds: Array = req.body.user_ids; if (!userIds) throw new HTTPError("The user_ids array is missing", 400); - if (userIds.length > 200) + + const bulkBanLimit = Config.get().limits.absoluteRate.bulkBan; + if (bulkBanLimit.enabled && userIds.length > bulkBanLimit.limit) throw new HTTPError( "The user_ids array must be between 1 and 200 in length", 400, diff --git a/src/util/config/types/subconfigurations/limits/GlobalRateLimits.ts b/src/util/config/types/subconfigurations/limits/GlobalRateLimits.ts index 835d7193..5a8a0d44 100644 --- a/src/util/config/types/subconfigurations/limits/GlobalRateLimits.ts +++ b/src/util/config/types/subconfigurations/limits/GlobalRateLimits.ts @@ -27,6 +27,11 @@ export class GlobalRateLimits { window: 60 * 1000, enabled: true, }; + bulkBan: GlobalRateLimit = { + limit: 200, + window: 0, + enabled: true, + }; } export class GlobalRateLimit {