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
-
BaseTransformer<Role(opens in a new tab)>↳
RoleTransformer
Constructors
constructor
• new RoleTransformer(base, safeValues?)
Parameters
| Name | Type |
|---|---|
base | Role (opens in a new tab) |
safeValues | SafeValues<Role (opens in a new tab)> |
Inherited from
Properties
base
• Protected base: Role (opens in a new tab)
Inherited from
safeValues
• Protected safeValues: SafeValues<Role (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