GuildTemplate
classe · Source
Represents the template for a guild.
Extends: Base
Properties
code
The unique code of this template Source
name
The name of this template Source
description
The description of this template Source
usageCount
The amount of times this template has been used Source
creatorId
The id of the user that created this template Source
creator
The user that created this template Source
createdAt
The time when this template was created at Source
updatedAt
The time when this template was last synced to the guild Source
guildId
The id of the guild that this template belongs to Source
serializedGuild
The data of the guild that this template would create Source
unSynced
Whether this template has unsynced changes Source
createdTimestamp
The timestamp of when this template was created at Source
updatedTimestamp
The timestamp of when this template was last synced to the guild Source
guild
The guild that this template belongs to Source
url
The URL of this template Source
client
The client that instantiated this Source
GUILD_TEMPLATES_PATTERN
Regular expression that globally matches guild template links Source
Methods
createGuild
Creates a guild based on this template. This is only available to bots in fewer than 10 guilds. Parameters
| Name | Type | Description |
|---|---|---|
name | string | The name of the guild |
icon? | BufferResolvable | Base64Resolvable | The icon for the guild |
Returns: Promise<Guild>Source
edit
Updates the metadata of this template. Parameters
| Name | Type | Description |
|---|---|---|
options? | EditGuildTemplateOptions | Options for editing the template |
Returns: Promise<GuildTemplate>Source
delete
Deletes this template. Returns: Promise<GuildTemplate>Source
sync
Syncs this template to the current state of the guild. Returns: Promise<GuildTemplate>Source
toString
When concatenated with a string, this automatically returns the template's code instead of the template object. Returns: string
// Logs: Template: FKvmczH2HyUf
console.log(`Template: ${guildTemplate}!`);