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:
parent
5a20924477
commit
e4a14d659a
File diff suppressed because it is too large
Load Diff
@ -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,
|
||||
|
@ -27,11 +27,6 @@ export class GlobalRateLimits {
|
||||
window: 60 * 1000,
|
||||
enabled: true,
|
||||
};
|
||||
bulkBan: GlobalRateLimit = {
|
||||
limit: 200,
|
||||
window: 0,
|
||||
enabled: true,
|
||||
};
|
||||
}
|
||||
|
||||
export class GlobalRateLimit {
|
||||
|
@ -21,5 +21,6 @@ export class GuildLimits {
|
||||
maxEmojis: number = 2000;
|
||||
maxMembers: number = 25000000;
|
||||
maxChannels: number = 65535;
|
||||
maxBulkBanUsers: number = 200;
|
||||
maxChannelsInCategory: number = 65535;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user