Skip to content

GuildTemplate ​

classe · Source

Represents the template for a guild.

Extends: Base

Properties ​

code ​

code: string

The unique code of this template Source

name ​

name: string

The name of this template Source

description ​

nullable

description: string

The description of this template Source

usageCount ​

usageCount: number

The amount of times this template has been used Source

creatorId ​

creatorId: Snowflake

The id of the user that created this template Source

creator ​

creator: User

The user that created this template Source

createdAt ​

createdAt: Date

The time when this template was created at Source

updatedAt ​

updatedAt: Date

The time when this template was last synced to the guild Source

guildId ​

guildId: Snowflake

The id of the guild that this template belongs to Source

serializedGuild ​

serializedGuild: APIGuild

The data of the guild that this template would create Source

unSynced ​

nullable

unSynced: boolean

Whether this template has unsynced changes Source

createdTimestamp ​

readonly

createdTimestamp: number

The timestamp of when this template was created at Source

updatedTimestamp ​

readonly

updatedTimestamp: number

The timestamp of when this template was last synced to the guild Source

guild ​

readonly · nullable

guild: Guild

The guild that this template belongs to Source

url ​

readonly

url: string

The URL of this template Source

client ​

readonly

client: Client

The client that instantiated this Source

GUILD_TEMPLATES_PATTERN ​

static

GUILD_TEMPLATES_PATTERN: RegExp

Regular expression that globally matches guild template links Source

Methods ​

createGuild ​

async

async createGuild(name: string, icon?: BufferResolvable | Base64Resolvable): Promise<Guild>

Creates a guild based on this template. This is only available to bots in fewer than 10 guilds. Parameters

NameTypeDescription
namestringThe name of the guild
icon?BufferResolvable | Base64ResolvableThe icon for the guild

Returns: Promise<Guild>Source

edit ​

async

async edit(options?: EditGuildTemplateOptions): Promise<GuildTemplate>

Updates the metadata of this template. Parameters

NameTypeDescription
options?EditGuildTemplateOptionsOptions for editing the template

Returns: Promise<GuildTemplate>Source

delete ​

async

async delete(): Promise<GuildTemplate>

Deletes this template. Returns: Promise<GuildTemplate>Source

sync ​

async

async sync(): Promise<GuildTemplate>

Syncs this template to the current state of the guild. Returns: Promise<GuildTemplate>Source

toString ​

toString(): string

When concatenated with a string, this automatically returns the template's code instead of the template object. Returns: string

js
// Logs: Template: FKvmczH2HyUf
console.log(`Template: ${guildTemplate}!`);

Source

Unofficial software. Not affiliated with or supported by Discord.