Interfacecorev0.14.0
CooldownOptions
Options for Cooldown. per sets the bucket that the window applies to and limit the uses allowed per
window. notice replaces the refusal.
interface CooldownOptions// one use per channel, refusing with your own Notice class
class SlowDown extends Notice {
public constructor(resetAt: EpochMs) {
super(`Slow down. Try again <t:${toEpochSeconds(resetAt)}:R>.`);
}
}
Cooldown('10s', { per: 'channel', notice: SlowDown });// five uses per minute, per user
Cooldown('1m', { limit: 5 });limit?: numberDefault:1
notice?: NoticeConstructor<[resetAt: EpochMs]>The bucket the cooldown window applies to. 'user' scopes by user ID (falls back to global when the source doesn't have a user id). 'guild' scopes by guild ID (falls back to global when the source doesn't have a guild), and 'channel' scopes by channel ID (falls back to global when the source doesn't have a channel).
per?: CooldownScopeDefault:'user'