DiscordLua
discorddiscord
v1.2.4
Install

GuildTemplate

Class
On 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.

class Module 1.2.4 REST Source

Properties

GuildTemplate.client

# readonly
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.

GuildTemplate.code

# readonly
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.

GuildTemplate.createdAt

# readonly
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.

GuildTemplate.createdTimestamp

# readonly
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.

GuildTemplate.creator

# readonly
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.

GuildTemplate.creatorId

# readonly
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.

GuildTemplate.description

# readonly
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.

GuildTemplate.guildId

# readonly
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.

GuildTemplate.name

# readonly
Name
name
Type
any
Access
readonly
Description
Display name of this GuildTemplate.
Availability
Populated from the Gateway/REST payload or constructor for this GuildTemplate.

GuildTemplate.raw

# readonly
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.

GuildTemplate.serializedGuild

# readonly
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.

GuildTemplate.unSynced

# readonly
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.

GuildTemplate.updatedAt

# readonly
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.

GuildTemplate.updatedTimestamp

# readonly
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.

GuildTemplate.url

# readonly
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.

GuildTemplate.usageCount

# readonly
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

NameTypeRequiredBehavior
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

lua
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

NameTypeRequiredBehavior
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

GuildTemplate — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
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

lua
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

lua
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

NameTypeRequiredBehavior
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

GuildTemplate — the same instance, for chaining.

Example

lua
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

lua
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.

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc