TypeDoc API
Plugins
Plugin Discord
classes
Guildtransformer

Class: GuildTransformer

Transformer for Discord Guild (opens in a new tab)

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.

Hierarchy

Constructors

constructor

new GuildTransformer(base, safeValues?)

Parameters

NameType
baseGuild (opens in a new tab)
safeValuesSafeValues<Guild (opens in a new tab)>

Inherited from

BaseTransformer.constructor

Properties

base

Protected base: Guild (opens in a new tab)

Inherited from

BaseTransformer.base


safeValues

Protected safeValues: SafeValues<Guild (opens in a new tab)> = {}

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