TypeDoc API
Plugins
Plugin Discord
classes
Channeltransformer

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

Constructors

constructor

new ChannelTransformer(base, safeValues?)

Parameters

NameType
baseGuildChannel
safeValuesSafeValues<GuildChannel>

Inherited from

BaseTransformer.constructor

Properties

base

Protected base: GuildChannel

Inherited from

BaseTransformer.base


safeValues

Protected safeValues: SafeValues<GuildChannel> = {}

Inherited from

BaseTransformer.safeValues

Methods

transform

transform(tag): null | string

Transforms the given tag.

Parameters

NameTypeDescription
tagLexerThe tag that triggered the transformer.

Returns

null | string

Inherited from

BaseTransformer.transform


updateSafeValues

Protected updateSafeValues(): void

Returns

void

Overrides

BaseTransformer.updateSafeValues