class GuildTemplate

extends

Base
export class GuildTemplate extends Base

Represents the template for a guild.

readonly
client : Client<true>

The client that instantiated this

Inherited from: Base

code : string

The unique code of this template

readonly
createdAt : Date

The time when this template was created at

createdTimestamp : number

The timestamp of when this template was created at

creator : User

The user that created this template

creatorId : Snowflake

The id of the user that created this template

description : string | null

The description of this template

readonly
guild : Guild | null

The guild that this template belongs to

guildId : Snowflake

The id of the guild that this template belongs to

static
GuildTemplatesPattern : RegExp

A regular expression that matches guild template links. The code group property is present on the exec() result of this expression.

name : string

The name of this template

The data of the guild that this template would create

unSynced : boolean | null

Whether this template has unsynced changes

readonly
updatedAt : Date

The time when this template was last synced to the guild

updatedTimestamp : number

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

readonly
url : string

The URL of this template

usageCount : number

The amount of times this template has been used

createGuild() : Promise<Guild>

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

delete() : Promise<GuildTemplate>

Deletes this template.

Updates the metadata of this template.

Syncs this template to the current state of the guild.

toJSON(
...props: Record<string, boolean | string>[]
) : unknown

Inherited from: Base

toString() : string

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

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

valueOf() : string

Inherited from: Base