BaseGuildEmojiManager
ManagerOn this page
BaseGuildEmojiManager is the cache and REST facade for BaseGuildEmoji objects owned by the parent. Typical calls are fetch, create, edit, delete, resolve, and resolveId.
Constructor
BaseGuildEmojiManager.new(client, guild) The class table is callable, so BaseGuildEmojiManager(client, guild) 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. |
local discord = require("discord")
local object = discord.BaseGuildEmojiManager({}, {})Properties
- Name
guild- Type
any- Access
- readonly
- Description
- Guild this BaseGuildEmojiManager belongs to, when the payload included a guild id.
- Availability
- Populated from the Gateway/REST payload or constructor for this BaseGuildEmojiManager.
Methods
BaseGuildEmojiManager:create()
#Create a new resource through REST and cache the result.
Signature
BaseGuildEmojiManager:create(options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
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
BaseGuildEmojiManager — the same instance, for chaining.
Throws
A DiscordLua error when arguments are invalid or the request fails without a callback.
Example
local discord = require("discord")
-- object is a BaseGuildEmojiManager
object:create({}, function(err, result)
if err then error(err) end
end)BaseGuildEmojiManager:delete()
#Permanently delete this resource through REST.
Signature
BaseGuildEmojiManager:delete(id, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
id |
string |
required | Snowflake id string. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
BaseGuildEmojiManager — the same instance, for chaining.
Throws
A DiscordLua error when arguments are invalid or the request fails without a callback.
Example
local discord = require("discord")
-- object is a BaseGuildEmojiManager
object:delete("123", function(err, result)
if err then error(err) end
end)BaseGuildEmojiManager:edit()
#Apply a REST update to this resource.
Signature
BaseGuildEmojiManager:edit(id, options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
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
BaseGuildEmojiManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a BaseGuildEmojiManager
object:edit("123", {}, function(err, result)
if err then error(err) end
end)BaseGuildEmojiManager:fetch()
#Request a fresh copy of this resource from REST and update the cache.
Signature
BaseGuildEmojiManager:fetch(id, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
id |
string |
required | Snowflake id string. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
BaseGuildEmojiManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a BaseGuildEmojiManager
object:fetch("123", function(err, result)
if err then error(err) end
end)BaseGuildEmojiManager:fetchAuthor()
#Fetch Author from REST and update the local cache when the request succeeds.
Signature
BaseGuildEmojiManager:fetchAuthor(emoji, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
emoji |
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
BaseGuildEmojiManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a BaseGuildEmojiManager
object:fetchAuthor(emoji, function(err, result)
if err then error(err) end
end)BaseGuildEmojiManager:resolveIdentifier()
#Performs resolve identifier on this BaseGuildEmojiManager. Call it from bot code when you need that operation on the current object.
Signature
BaseGuildEmojiManager:resolveIdentifier(emoji) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
emoji |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a BaseGuildEmojiManager
object:resolveIdentifier(emoji)Examples
local discord = require("discord")
local object = discord.BaseGuildEmojiManager({})Related APIs
ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · AutoModerationRuleManager · BaseManager · CachedManager · CategoryChannelChildManager · ChannelManager
Version: discord 1.2.4 · runtime 1.0.0