Skip to content
Interfacecorev0.10.0

CooldownOptions

Options for Cooldown. per sets the bucket the window applies to and limit the uses allowed per window. message rewords the refusal and notice replaces it, both receiving the epoch ms the key frees up so the refusal can show the retry time.

interface CooldownOptions

limit

Uses allowed inside one window before the gate refuses.

limit?: number

Default:1

message

Reword the refusal, keeping the standard notice card. Receives the epoch ms the key frees up, to show the retry time with <t:${Math.round(resetAt / 1000)}:R>.

message?: (resetAt: EpochMs) => string

notice

Replace the refusal Notice entirely, for full control or a translated copy. Receives the epoch ms the key frees up.

notice?: (resetAt: EpochMs) => Notice

per

The bucket the cooldown window applies to. 'user' scopes by user ID (falls back to global when the source carries no user id). 'guild' scopes by guild ID (falls back to global if no guild), and 'channel' scopes by channel ID (falls back to global if no channel).

per?: 'user' | 'guild' | 'channel'

Default:'user'