RoleTransformer
Class: RoleTransformer
Defined in: tagscript-plugin-discord/src/lib/Transformer/Role.ts:36
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
BaseTransformer<Role>
Constructors
Constructor
new RoleTransformer(base, safeValues): RoleTransformer
Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:26
Parameters
base
Role
safeValues
SafeValues<Role> = {}
Returns
RoleTransformer
Inherited from
Properties
base
protected base: Role
Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:22
Inherited from
safeValues
protected safeValues: SafeValues<Role> = {}
Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:24
Inherited from
Methods
toJSON()
toJSON(): SafeValues<Role>
Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:44
Returns
SafeValues<Role>
Inherited from
transform()
transform(tag): null | string
Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:36
Transforms the given tag.
Parameters
tag
Lexer
The tag that triggered the transformer.
Returns
null | string
Inherited from
updateSafeValues()
protected updateSafeValues(): void
Defined in: tagscript-plugin-discord/src/lib/Transformer/Role.ts:37
Returns
void