1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-25 11:43:07 +01:00

Refactored max limit for bulk-bans from AbsoluteRateLimits to GuildLimits as suggested by @devtomatocake

This commit is contained in:
aintDatCap 2024-07-24 19:22:40 +02:00
parent 5a20924477
commit e4a14d659a
4 changed files with 657 additions and 7 deletions

File diff suppressed because it is too large Load Diff

View File

@ -54,8 +54,7 @@ router.post(
const userIds: Array<string> = req.body.user_ids;
if (!userIds) throw new HTTPError("The user_ids array is missing", 400);
const bulkBanLimit = Config.get().limits.absoluteRate.bulkBan;
if (bulkBanLimit.enabled && userIds.length > bulkBanLimit.limit)
if (userIds.length > Config.get().limits.guild.maxBulkBanUsers)
throw new HTTPError(
"The user_ids array must be between 1 and 200 in length",
400,

View File

@ -27,11 +27,6 @@ export class GlobalRateLimits {
window: 60 * 1000,
enabled: true,
};
bulkBan: GlobalRateLimit = {
limit: 200,
window: 0,
enabled: true,
};
}
export class GlobalRateLimit {

View File

@ -21,5 +21,6 @@ export class GuildLimits {
maxEmojis: number = 2000;
maxMembers: number = 25000000;
maxChannels: number = 65535;
maxBulkBanUsers: number = 200;
maxChannelsInCategory: number = 65535;
}