TypeDoc API
Plugins
Plugin Discord
classes
Roletransformer

Class: RoleTransformer

Transformer for Discord Role.

Properties:

id: Gives role id.
name: Gives role name.
mention: Mentions the role.
color: Gives role color.
hoist: Gives true if the role is hoisted else false.
mentionable: Gives true if the role is mentionable else false.
position: Gives role position.
permissions: Gives role permissions.
createdAt: Gives role create date.
createdTimestamp: Gives role create date in ms.
memberCount: Gives role member count.

Remarks

You need to use StrictVarsParser parser to use this transformer.

Example

import { Interpreter, StrictVarsParser } from 'tagscript';
import { RoleTransformer } from 'tagscript-plugin-discord';
 
const ts = new Interpreter(new StrictVarsParser());
 
await ts.run('Ping {role}', { role: new RoleTransformer(Role) });
// Ping <@&868430685231271966>

Hierarchy

Constructors

constructor

new RoleTransformer(base, safeValues?)

Parameters

NameType
baseRole (opens in a new tab)
safeValuesSafeValues<Role (opens in a new tab)>

Inherited from

BaseTransformer.constructor

Properties

base

Protected base: Role (opens in a new tab)

Inherited from

BaseTransformer.base


safeValues

Protected safeValues: SafeValues<Role (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