Tagscript

@tagscript/plugin-discord


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>

Extends

Constructors

new RoleTransformer()

new RoleTransformer(base, safeValues): RoleTransformer

Parameters

base

Role

safeValues

SafeValues<Role> = {}

Returns

RoleTransformer

Inherited from

BaseTransformer.constructor

Defined in

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

Properties

base

protected base: Role

Inherited from

BaseTransformer.base

Defined in

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


safeValues

protected safeValues: SafeValues<Role> = {}

Inherited from

BaseTransformer.safeValues

Defined in

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

Methods

toJSON()

toJSON(): SafeValues<Role>

Returns

SafeValues<Role>

Inherited from

BaseTransformer.toJSON

Defined in

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


transform()

transform(tag): null | string

Transforms the given tag.

Parameters

tag

Lexer

The tag that triggered the transformer.

Returns

null | string

Inherited from

BaseTransformer.transform

Defined in

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


updateSafeValues()

protected updateSafeValues(): void

Returns

void

Overrides

BaseTransformer.updateSafeValues

Defined in

tagscript-plugin-discord/src/lib/Transformer/Role.ts:37