GuildTemplate
ClassOn this page
GuildTemplate is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.
Properties
- Name
client- Type
any- Access
- readonly
- Description
- Owning Client instance used for REST, cache, and event dispatch.
- Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
code- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.code. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
createdAt- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.createdAt. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
createdTimestamp- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.createdTimestamp. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
creator- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.creator. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
creatorId- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.creatorId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
description- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.description. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
guildId- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.guildId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
name- Type
any- Access
- readonly
- Description
- Display name of this GuildTemplate.
- Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
raw- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.raw. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
serializedGuild- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.serializedGuild. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
unSynced- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.unSynced. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
updatedAt- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.updatedAt. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
updatedTimestamp- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.updatedTimestamp. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
url- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.url. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
- Name
usageCount- Type
any- Access
- readonly
- Description
- Instance field
GuildTemplate.usageCount. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildTemplate.
Methods
GuildTemplate:createGuild()
#Create Guild through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
GuildTemplate:createGuild(name, icon, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
icon |
any |
required | Passed through to the implementation as written. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
GuildTemplate — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildTemplate
object:createGuild(name, icon, function(err, result)
if err then error(err) end
end)GuildTemplate:delete()
#Permanently delete this resource through REST.
Signature
GuildTemplate:delete(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
GuildTemplate — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildTemplate
object:delete(function(err, result)
if err then error(err) end
end)GuildTemplate:edit()
#Apply a REST update to this resource.
Signature
GuildTemplate:edit(options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
GuildTemplate — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildTemplate
object:edit({}, function(err, result)
if err then error(err) end
end)GuildTemplate:guild()
#Performs guild on this GuildTemplate. Call it from bot code when you need that operation on the current object.
Signature
GuildTemplate:guild() Parameters
No parameters.
Returns
GuildTemplate — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildTemplate
object:guild()GuildTemplate:sync()
#Performs sync on this GuildTemplate. Call it from bot code when you need that operation on the current object.
Signature
GuildTemplate:sync(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
GuildTemplate — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildTemplate
object:sync(function(err, result)
if err then error(err) end
end)GuildTemplate:toString()
#function toString() { [native code] }
Signature
GuildTemplate:toString() Parameters
No parameters.
Returns
GuildTemplate — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildTemplate
object:toString()Static members
-
GuildTemplate.GuildTemplatesPattern
Examples
Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.
Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0