summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authoraintDatCap <default.pentagon042@passinbox.com>2024-07-24 19:06:12 +0200
committeraintDatCap <default.pentagon042@passinbox.com>2024-07-24 19:06:12 +0200
commit5a20924477eae54c7353c0aecf7a56f4e052e3b5 (patch)
treed9d2e26f58c46111e66c14170f0202fe05c32626 /src/api
parentMake channel ID optional when replying (diff)
downloadserver-ts-5a20924477eae54c7353c0aecf7a56f4e052e3b5.tar.xz
Implemented proposal described in the issue #1122
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/guilds/#guild_id/bulk-ban.ts5
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,