TypeDoc API
Plugins
Plugin Discord
Classes
Cooldownparser

Class: CooldownParser

The cooldown tag implements cooldowns when running a tag. The parameter is the number of seconds to wait before running the tag again. The payload is the optional cooldown message to send if the tag is on cooldown. Payload can have {retryAfter}, {name} which will be replaced with the time remaining and the name of the tag respectively.

Example

{ cooldown(seconds): response }

Aliases: cd

Example

{ cooldown(5): This tag is on cooldown. }
{ cooldown(5): The tag {name} is on cooldown. Please try again in {retryAfter}. }

Hierarchy

Implements

Constructors

constructor

new CooldownParser()

Overrides

BaseParser.constructor

Properties

acceptedNames

Protected acceptedNames: string[]

Inherited from

BaseParser.acceptedNames


requiredParameter

Protected requiredParameter: boolean

Inherited from

BaseParser.requiredParameter


requiredPayload

Protected requiredPayload: boolean

Inherited from

BaseParser.requiredPayload

Methods

parse

parse(ctx): string

Parses the given tag.

Parameters

NameTypeDescription
ctxContextThe context of the tag.

Returns

string

Implementation of

IParser.parse


willAccept

willAccept(ctx): boolean

Whether the parser can handle the given tag.

Parameters

NameTypeDescription
ctxContextThe context of the tag.

Returns

boolean

Implementation of

IParser.willAccept

Inherited from

BaseParser.willAccept