DiscordLua
discorddiscord
v1.2.4
Install

GuildInviteManager

Manager
On this page

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

manager Module 1.2.4 REST Source

Constructor

GuildInviteManager.new(client, guild, channel)

The class table is callable, so GuildInviteManager(client, guild, channel) 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.
channel any required Passed through to the implementation as written.
lua
local discord = require("discord")
local object = discord.GuildInviteManager({}, {}, {})

Properties

GuildInviteManager.channel

# readonly
Name
channel
Type
any
Access
readonly
Description
Channel this GuildInviteManager belongs to, when resolved from cache.
Availability
Populated from the Gateway/REST payload or constructor for this GuildInviteManager.

GuildInviteManager.guild

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

Methods

GuildInviteManager:create()

#

Create a new resource through REST and cache the result.

Signature

GuildInviteManager:create(channelOrOptions, options, callback)

Parameters

NameTypeRequiredBehavior
channelOrOptions table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.
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

GuildInviteManager — the same instance, for chaining.

Example

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

GuildInviteManager:delete()

#

Permanently delete this resource through REST.

Signature

GuildInviteManager:delete(code, callback)

Parameters

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

GuildInviteManager — the same instance, for chaining.

Example

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

GuildInviteManager:fetch()

#

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

Signature

GuildInviteManager:fetch(code, callback)

Parameters

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

GuildInviteManager — the same instance, for chaining.

Example

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

Examples

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

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

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc