DiscordLua
discorddiscord
v1.2.4
Install

StageInstanceManager

Manager
On this page

StageInstanceManager is the cache and REST facade for StageInstance objects owned by the parent. Typical calls are fetch, create, edit, delete, resolve, and resolveId.

manager Module 1.2.4 REST Source

Constructor

StageInstanceManager.new(client, guild)

The class table is callable, so StageInstanceManager(client, guild) is the same as .new.

NameTypeRequiredBehavior
client any required Passed through to the implementation as written.
guild any required Passed through to the implementation as written.
lua
local discord = require("discord")
local object = discord.StageInstanceManager({}, {})

Properties

StageInstanceManager.cache

# readonly
Name
cache
Type
any
Access
readonly
Description
In-memory Collection of cached objects owned by this StageInstanceManager.
Availability
Populated from the Gateway/REST payload or constructor for this StageInstanceManager.

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

StageInstanceManager.guild

# readonly
Name
guild
Type
any
Access
readonly
Description
Guild this StageInstanceManager belongs to, when the payload included a guild id.
Availability
Populated from the Gateway/REST payload or constructor for this StageInstanceManager.

Methods

StageInstanceManager:create()

#

Create a new resource through REST and cache the result.

Signature

StageInstanceManager:create(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

StageInstanceManager — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a StageInstanceManager
object:create({}, function(err, result)
    if err then error(err) end
end)

StageInstanceManager:delete()

#

Permanently delete this resource through REST.

Signature

StageInstanceManager:delete(channelId, callback)

Parameters

NameTypeRequiredBehavior
channelId string required Snowflake id string.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

StageInstanceManager — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a StageInstanceManager
object:delete("123", function(err, result)
    if err then error(err) end
end)

StageInstanceManager:edit()

#

Apply a REST update to this resource.

Signature

StageInstanceManager:edit(channelId, options, callback)

Parameters

NameTypeRequiredBehavior
channelId string required Snowflake id string.
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

StageInstanceManager — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a StageInstanceManager
object:edit("123", {}, function(err, result)
    if err then error(err) end
end)

StageInstanceManager:fetch()

#

Request a fresh copy of this resource from REST and update the cache.

Signature

StageInstanceManager:fetch(channelId, callback)

Parameters

NameTypeRequiredBehavior
channelId string required Snowflake id string.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

StageInstanceManager — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a StageInstanceManager
object:fetch("123", function(err, result)
    if err then error(err) end
end)

Examples

lua
local discord = require("discord")
local object = discord.StageInstanceManager({})

ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · AutoModerationRuleManager · BaseGuildEmojiManager · BaseManager · CachedManager · CategoryChannelChildManager

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc