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
-
BaseTransformer<CommandInteraction(opens in a new tab)>↳
InteractionTransformer
Constructors
constructor
• new InteractionTransformer(base, safeValues?)
Parameters
| Name | Type |
|---|---|
base | CommandInteraction (opens in a new tab)<CacheType (opens in a new tab)> |
safeValues | SafeValues<CommandInteraction (opens in a new tab)<CacheType (opens in a new tab)>> |
Inherited from
Properties
base
• Protected base: CommandInteraction (opens in a new tab)<CacheType (opens in a new tab)>
Inherited from
safeValues
• Protected safeValues: SafeValues<CommandInteraction (opens in a new tab)<CacheType (opens in a new tab)>> = {}
Inherited from
Methods
transform
▸ transform(tag): null | string
Transforms the given tag.
Parameters
| Name | Type | Description |
|---|---|---|
tag | Lexer | The tag that triggered the transformer. |
Returns
null | string
Inherited from
updateSafeValues
▸ Protected updateSafeValues(): void
Returns
void