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
-
↳
CooldownParser
Implements
Constructors
constructor
• new CooldownParser()
Overrides
Properties
acceptedNames
• Protected
acceptedNames: string
[]
Inherited from
requiredParameter
• Protected
requiredParameter: boolean
Inherited from
requiredPayload
• Protected
requiredPayload: boolean
Inherited from
Methods
parse
▸ parse(ctx
): string
Parses the given tag.
Parameters
Name | Type | Description |
---|---|---|
ctx | Context | The context of the tag. |
Returns
string
Implementation of
willAccept
▸ willAccept(ctx
): boolean
Whether the parser can handle the given tag.
Parameters
Name | Type | Description |
---|---|---|
ctx | Context | The context of the tag. |
Returns
boolean