Cooldown
Allows limitlimit uses per window, scoped by perper. A number durationduration is seconds, a string is a duration like 30m30m or 24h24h. An unparseable string throws a SeedcordTypeError at construction. The slot is charged in commit, only after the whole gate set passes, so a later refusal never burns the cooldown. That split also means two requests racing the same key can both pass before either charges the slot. The key combines the handler's route with the window settings, so two different handlers keep separate windows. Reword the refusal with messagemessage or replace it with noticenotice.
See also:the @Gated decorator from seedcord, IRateLimiter
Cooldown(
duration: number | ValidDuration,
options?: CooldownOptions
): EffectGate<GateContextBase, "Cooldown">Cooldown(
duration: number | ValidDuration,
options?: CooldownOptions
): EffectGate<GateContextBase, "Cooldown">duration
duration: number | ValidDurationduration: number | ValidDurationA number is seconds, a string is a duration like 30m30m or 24h24h. An unparseable string throws a SeedcordTypeError.
options?
options?: CooldownOptionsoptions?: CooldownOptionsSets the scope with perper, the uses per window with limitlimit, and the refusal text with messagemessage or noticenotice.