Tagscript

@tagscript/plugin-discord


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>

Extends

Constructors

new ChannelTransformer()

new ChannelTransformer(base, safeValues): ChannelTransformer

Parameters

base

GuildChannel

safeValues

SafeValues<GuildChannel> = {}

Returns

ChannelTransformer

Inherited from

BaseTransformer.constructor

Defined in

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

Properties

base

protected base: GuildChannel

Inherited from

BaseTransformer.base

Defined in

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


safeValues

protected safeValues: SafeValues<GuildChannel> = {}

Inherited from

BaseTransformer.safeValues

Defined in

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

Methods

toJSON()

Returns

SafeValues<GuildChannel>

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/GuildTextBasedChannel.ts:40