Skip to content

Class: CooldownManager

Constructors

constructor

new CooldownManager(cooldown?)

Creates a new cooldown manager

Parameters

Name Type Default value Description
cooldown number 0 The default cooldown in miliseconds

Properties

cooldown

cooldown: number

The default cooldown in miliseconds


cooldowns

cooldowns: Keyv<number>

All current cooldowns

Methods

add

add(key, cooldown?): Promise<void>

Adds a new cooldown

Parameters

Name Type Description
key string The identifier for this cooldown
cooldown number How long this cooldown should last for, in miliseconds

Returns

Promise<void>


check

check(key): Promise<number | false>

Checks if a cooldown exists

Parameters

Name Type Description
key string The identifier for this cooldown

Returns

Promise<number | false>

How long this cooldown still lasts, if found

Back to top