Skip to content
GitHub

CooldownVerdict

interface in meocord/common Since 4.1.0

interface CooldownVerdict

Whether a call may run, and if not, how long until one may.

Members

allowed

allowed: boolean

Whether the call may run.

retryAfterMs

retryAfterMs: number

0 when allowed; otherwise how long until the oldest call in the window leaves it.

retryTimestamp

retryTimestamp?: number

With a refusal, when the next call is allowed, as a Unix timestamp in milliseconds on the store's own clock. Every refusal in one wait gives the same one, so messages.dmOnCooldown tells one wait from the next by it, across processes and however late the answer arrives. The built-in stores give it; a store without it is told apart by retryAfterMs and the bot's clock instead.