Class: ChannelTransformer
Transformer for Discord GuildChannel
Properties:
id: Gives channel id.
mention: Mentions the channel.
name: Gives channel name.
topic: Gives channel topic.
type: Gives channel type.
position: Gives channel position.
nsfw: Gives true if the channel is nsfw else false.
parentId: Gives channel parent id.
parentName: Gives channel parent name.
parentType: Gives channel parent type.
parentPosition: Gives channel parent position.
createdAt: Gives channel create date.
createdTimestamp: Gives channel create date in ms.
slowmode: Gives channel slowmode.Remarks
You need to use StrictVarsParser parser to use this transformer.
Example
import { Interpreter, StrictVarsParser } from 'tagscript';
import { ChannelTransformer } from 'tagscript-plugin-discord';
const ts = new Interpreter(new StrictVarsParser());
await ts.run('channel: {channel}', { channel: new ChannelTransformer(message.channel) });
// channel: <#870354581115256852>Hierarchy
-
↳
ChannelTransformer
Constructors
constructor
• new ChannelTransformer(base, safeValues?)
Parameters
| Name | Type |
|---|---|
base | GuildChannel |
safeValues | SafeValues<GuildChannel> |
Inherited from
Properties
base
• Protected base: GuildChannel
Inherited from
safeValues
• Protected safeValues: SafeValues<GuildChannel> = {}
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