Tagscript

@tagscript/plugin-discord


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.

Examples

{ cooldown(seconds): response }

Aliases: cd

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

Extends

  • BaseParser

Implements

  • IParser

Constructors

new CooldownParser()

new CooldownParser(): CooldownParser

Returns

CooldownParser

Overrides

BaseParser.constructor

Defined in

tagscript-plugin-discord/src/lib/Parsers/Cooldown.ts:22

Properties

acceptedNames

protected acceptedNames: string[]

Inherited from

BaseParser.acceptedNames

Defined in

tagscript/dist/index.d.ts:381


requiredParameter

protected requiredParameter: boolean

Inherited from

BaseParser.requiredParameter

Defined in

tagscript/dist/index.d.ts:382


requiredPayload

protected requiredPayload: boolean

Inherited from

BaseParser.requiredPayload

Defined in

tagscript/dist/index.d.ts:383

Methods

parse()

parse(ctx): string

Parses the given tag.

Parameters

ctx

Context

The context of the tag.

Returns

string

Implementation of

IParser.parse

Defined in

tagscript-plugin-discord/src/lib/Parsers/Cooldown.ts:26


toJSON()

toJSON(): object

Returns

object

acceptedNames

acceptedNames: string[]

requiredParameter

requiredParameter: boolean

requiredPayload

requiredPayload: boolean

Inherited from

BaseParser.toJSON

Defined in

tagscript/dist/index.d.ts:386


willAccept()

willAccept(ctx): boolean

Parameters

ctx

Context

Returns

boolean

Implementation of

IParser.willAccept

Inherited from

BaseParser.willAccept

Defined in

tagscript/dist/index.d.ts:385