Tagscript

Class: GuildTransformer

Transformer for Discord Guild.

Properties:

id: Gives guild id.
name: Gives guild name.
description: Gives guild description.
icon: Gives guild icon.
splash: Gives guild splash.
banner: Gives guild banner.
features: Gives guild features.
ownerId: Gives guild owner id.
createdAt: Gives guild create date.
createdTimestamp: Gives guild create date in ms.
large: Gives true if the guild is large else false.
memberCount: Gives guild member count.
random: Gives random guild member.
roles: Gives guild roles.
roleIds: Gives guild roles ids.
roleNames: Gives guild roles names.
roleCount: Gives guild roles count.
channels: Gives guild channels.
channelIds: Gives guild channels ids.
channelNames: Gives guild channels names.
channelCount: Gives guild channels count.
emojiCount: Gives guild emojis count.
stickerCount: Gives guild stickers count.
bots: Gives guild bots count.
humans: Gives guild humans count.
afkTimeout: Gives guild afk timeout.
afkChannel: Gives guild afk channel.
verificationLevel: Gives guild verification level.

Example

import { Interpreter, StrictVarsParser } from 'tagscript';
import { GuildTransformer } from '@tagscript/plugin-discord';
 
const ts = new Interpreter(new StrictVarsParser());
 
await ts.run('server name: {guild.name}', { guild: new GuildTransformer(interaction.guild) });
// server name: My Server

Remarks

Some properties like emojiCount, stickerCount, bots, humans depends on cache so it might be inaccurate. You need to use StrictVarsParser parser to use this transformer.

Extends

Constructors

new GuildTransformer()

new GuildTransformer(base, safeValues): GuildTransformer

Parameters

base: Guild

safeValues: SafeValues<Guild> = {}

Returns

GuildTransformer

Inherited from

BaseTransformer.constructor

Defined in

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

Properties

base

protected base: Guild

Inherited from

BaseTransformer.base

Defined in

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


safeValues

protected safeValues: SafeValues<Guild> = {}

Inherited from

BaseTransformer.safeValues

Defined in

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

Methods

toJSON()

toJSON(): SafeValues<Guild>

Returns

SafeValues<Guild>

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/Guild.ts:55

On this page