class GuildTemplate
extends
Baseexport class GuildTemplate extends BaseRepresents the template for a guild.
code : string
The unique code of this template
readonlycreatedAt : 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
guildId : Snowflake
The id of the guild that this template belongs to
staticGuildTemplatesPattern : 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
serializedGuild : APITemplateSerializedSourceGuild
The data of the guild that this template would create
readonlyupdatedAt : 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
readonlyurl : string
The URL of this template
usageCount : number
The amount of times this template has been used
createGuild(name: stringicon?: BufferResolvable | Base64Resolvable) : 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.
edit(options?: GuildTemplateEditOptions) : Promise<GuildTemplate>
Updates the metadata of this template.
sync() : Promise<GuildTemplate>
Syncs this template to the current state of the guild.
toString() : string
When concatenated with a string, this automatically returns the template's code instead of the template object.
// Logs: Template: FKvmczH2HyUf
console.log(`Template: ${guildTemplate}!`);