Functionseedcordv0.15.0
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. Each call gets its own bucket, so two handlers never share a window. Reword the refusal with messagemessage or replace it with noticenotice.
See also:Gated, RateLimiter
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.