fix(slowmode): stop the local cooldown from outgrowing the channel setting (#1795)

This commit is contained in:
Hampus
2026-08-20 19:56:02 +02:00
committed by GitHub
parent 8f4f9a8601
commit 631bc2307a
15 changed files with 497 additions and 147 deletions
@@ -929,9 +929,8 @@ export class MessageSendService {
algorithm: 'leaky_bucket',
});
if (!slowmodeResult.allowed) {
const retryAfter = Math.max(0, slowmodeResult.resetTime.getTime() - Date.now());
throw new SlowmodeRateLimitError({
retryAfter,
retryAfter: slowmodeResult.retryAfter,
retryAfterDecimal: slowmodeResult.retryAfterDecimal,
});
}