DiscordLua
discorddiscord
v1.2.4
Install

GuildScheduledEventManager

Manager
On this page

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

manager Module 1.2.4 REST Source

Constructor

GuildScheduledEventManager.new(client, guild)

The class table is callable, so GuildScheduledEventManager(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.GuildScheduledEventManager({}, {})

Properties

GuildScheduledEventManager.guild

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

Methods

GuildScheduledEventManager:create()

#

Create a new resource through REST and cache the result.

Signature

GuildScheduledEventManager: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

GuildScheduledEventManager — the same instance, for chaining.

Throws

A DiscordLua error when arguments are invalid or the request fails without a callback.

Example

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

GuildScheduledEventManager:delete()

#

Permanently delete this resource through REST.

Signature

GuildScheduledEventManager:delete(id, callback)

Parameters

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

Returns

GuildScheduledEventManager — the same instance, for chaining.

Example

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

GuildScheduledEventManager:edit()

#

Apply a REST update to this resource.

Signature

GuildScheduledEventManager:edit(id, options, callback)

Parameters

NameTypeRequiredBehavior
id 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

GuildScheduledEventManager — the same instance, for chaining.

Example

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

GuildScheduledEventManager:fetch()

#

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

Signature

GuildScheduledEventManager:fetch(id, options, callback)

Parameters

NameTypeRequiredBehavior
id 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

GuildScheduledEventManager — the same instance, for chaining.

Example

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

GuildScheduledEventManager:fetchSubscribers()

#

Fetch Subscribers from REST and update the local cache when the request succeeds.

Signature

GuildScheduledEventManager:fetchSubscribers(id, options, callback)

Parameters

NameTypeRequiredBehavior
id 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

GuildScheduledEventManager — the same instance, for chaining.

Example

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

Examples

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

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

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc