Class: CooldownParser
Defined in: tagscript-plugin-discord/src/lib/Parsers/Cooldown.ts:21
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.
Examples
Aliases: cd
Extends
BaseParser
Implements
IParser
Constructors
new CooldownParser()
new CooldownParser(): CooldownParser
Defined in: tagscript-plugin-discord/src/lib/Parsers/Cooldown.ts:22
Returns
Overrides
BaseParser.constructor
Properties
acceptedNames
protected
acceptedNames: string
[]
Defined in: tagscript/dist/index.d.ts:381
Inherited from
BaseParser.acceptedNames
requiredParameter
protected
requiredParameter: boolean
Defined in: tagscript/dist/index.d.ts:382
Inherited from
BaseParser.requiredParameter
requiredPayload
protected
requiredPayload: boolean
Defined in: tagscript/dist/index.d.ts:383
Inherited from
BaseParser.requiredPayload
Methods
parse()
parse(ctx
): string
Defined in: tagscript-plugin-discord/src/lib/Parsers/Cooldown.ts:26
Parses the given tag.
Parameters
ctx
Context
The context of the tag.
Returns
string
Implementation of
IParser.parse
toJSON()
toJSON(): object
Defined in: tagscript/dist/index.d.ts:386
Returns
object
acceptedNames
acceptedNames: string
[]
requiredParameter
requiredParameter: boolean
requiredPayload
requiredPayload: boolean
Inherited from
BaseParser.toJSON
willAccept()
willAccept(ctx
): boolean
Defined in: tagscript/dist/index.d.ts:385
Parameters
ctx
Context
Returns
boolean
Implementation of
IParser.willAccept
Inherited from
BaseParser.willAccept