TypeDoc API
Plugins
Plugin Discord
classes
Interactiontransformer

Class: InteractionTransformer

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`

Hierarchy

Constructors

constructor

new InteractionTransformer(base, safeValues?)

Parameters

NameType
baseCommandInteraction (opens in a new tab)<CacheType (opens in a new tab)>
safeValuesSafeValues<CommandInteraction (opens in a new tab)<CacheType (opens in a new tab)>>

Inherited from

BaseTransformer.constructor

Properties

base

Protected base: CommandInteraction (opens in a new tab)<CacheType (opens in a new tab)>

Inherited from

BaseTransformer.base


safeValues

Protected safeValues: SafeValues<CommandInteraction (opens in a new tab)<CacheType (opens in a new tab)>> = {}

Inherited from

BaseTransformer.safeValues

Methods

transform

transform(tag): null | string

Transforms the given tag.

Parameters

NameTypeDescription
tagLexerThe tag that triggered the transformer.

Returns

null | string

Inherited from

BaseTransformer.transform


updateSafeValues

Protected updateSafeValues(): void

Returns

void

Overrides

BaseTransformer.updateSafeValues