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 ServerRemarks
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
-
BaseTransformer<Guild(opens in a new tab)>↳
GuildTransformer
Constructors
constructor
• new GuildTransformer(base, safeValues?)
Parameters
| Name | Type |
|---|---|
base | Guild (opens in a new tab) |
safeValues | SafeValues<Guild (opens in a new tab)> |
Inherited from
Properties
base
• Protected base: Guild (opens in a new tab)
Inherited from
safeValues
• Protected safeValues: SafeValues<Guild (opens in a new tab)> = {}
Inherited from
Methods
transform
▸ transform(tag): null | string
Transforms the given tag.
Parameters
| Name | Type | Description |
|---|---|---|
tag | Lexer | The tag that triggered the transformer. |
Returns
null | string
Inherited from
updateSafeValues
▸ Protected updateSafeValues(): void
Returns
void