Class: ChannelTransformer
Defined in: tagscript-plugin-discord/src/lib/Transformer/GuildTextBasedChannel.ts:39
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>
Extends
Constructors
Constructor
new ChannelTransformer(base
, safeValues
): ChannelTransformer
Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:26
Parameters
base
safeValues
SafeValues
<GuildChannel
> = {}
Returns
ChannelTransformer
Inherited from
Properties
base
protected
base: GuildChannel
Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:22
Inherited from
safeValues
protected
safeValues: SafeValues
<GuildChannel
> = {}
Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:24
Inherited from
Methods
toJSON()
toJSON(): SafeValues
<GuildChannel
>
Defined in: tagscript-plugin-discord/src/lib/Transformer/Base.ts:44
Returns
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/GuildTextBasedChannel.ts:40
Returns
void