Tagscript

@tagscript/plugin-discord


Class: InteractionTransformer

Defined in: tagscript-plugin-discord/src/lib/Transformer/Interaction.ts:21

Transformer for Discord CommandInteraction

Remarks

You need to use StrictVarsParser parser to use this transformer.

Example

import { Interpreter, StrictVarsParser } from 'tagscript';
import { InteractionTransformer } from '@tagscript/plugin-discord';
 
const ts = new Interpreter(new StrictVarsParser());
 
await ts.run('You've used the command `{command.name}`', { command: new InteractionTransformer(Role) });
// You've used the command `ping`

Extends

Constructors

new InteractionTransformer()

new InteractionTransformer(base, safeValues): InteractionTransformer

Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:26

Parameters

base

CommandInteraction

safeValues

SafeValues<CommandInteraction> = {}

Returns

InteractionTransformer

Inherited from

BaseTransformer.constructor

Properties

base

protected base: CommandInteraction

Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:22

Inherited from

BaseTransformer.base


safeValues

protected safeValues: SafeValues<CommandInteraction> = {}

Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:24

Inherited from

BaseTransformer.safeValues

Methods

toJSON()

toJSON(): SafeValues<CommandInteraction>

Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:44

Returns

SafeValues<CommandInteraction>

Inherited from

BaseTransformer.toJSON


transform()

transform(tag): null | string

Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:36

Transforms the given tag.

Parameters

tag

Lexer

The tag that triggered the transformer.

Returns

null | string

Inherited from

BaseTransformer.transform


updateSafeValues()

protected updateSafeValues(): void

Defined in: tagscript-plugin-discord/src/lib/Transformer/Interaction.ts:22

Returns

void

Overrides

BaseTransformer.updateSafeValues