GuildTemplate

export class GuildTemplate extends Base
export class GuildTemplate extends Base
Represents the template for a guild.

Extends

Base
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(name, icon?):Promise<Guild>
Creates a guild based on this template. This is only available to bots in fewer than 10 guilds.
NameTypeOptionalDescription
namestringNoThe name of the guild
iconBufferResolvable | Base64ResolvableYesThe icon for the guild
Deletes this template.
edit(options?):Promise<GuildTemplate>
Updates the metadata of this template.
NameTypeOptionalDescription
optionsGuildTemplateEditOptionsYesOptions for editing the template
Syncs this template to the current state of the guild.
toJSON(...props):unknown
NameTypeOptionalDescription
...propsRecord<string, boolean | string>[]NoNone
Inherited from Base
toString():string
When concatenated with a string, this automatically returns the template's code instead of the template object.
Example
// Logs: Template: FKvmczH2HyUf
console.log(`Template: ${guildTemplate}!`);
// Logs: Template: FKvmczH2HyUf
console.log(`Template: ${guildTemplate}!`);
valueOf():string