1 files changed, 4 insertions, 1 deletions
diff --git a/src/api/routes/guilds/#guild_id/bulk-ban.ts b/src/api/routes/guilds/#guild_id/bulk-ban.ts
index f544103a5..10505282a 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<string> = 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,
|