GuildInviteManager
ManagerOn 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.
Constructor
GuildInviteManager.new(client, guild, channel) The class table is callable, so GuildInviteManager(client, guild, channel) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
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. |
local discord = require("discord")
local object = discord.GuildInviteManager({}, {}, {})Properties
- 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.
- 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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
local discord = require("discord")
-- object is a GuildInviteManager
object:fetch(code, function(err, result)
if err then error(err) end
end)Examples
local discord = require("discord")
local object = discord.GuildInviteManager({})Related APIs
ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · AutoModerationRuleManager · BaseGuildEmojiManager · BaseManager · CachedManager · CategoryChannelChildManager
Version: discord 1.2.4 · runtime 1.0.0