GuildBanManager
ManagerOn this page
GuildBanManager is the cache and REST facade for GuildBan objects owned by the parent. Typical calls are fetch, create, edit, delete, resolve, and resolveId.
Constructor
GuildBanManager.new(client, guild) The class table is callable, so GuildBanManager(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.GuildBanManager({}, {})Properties
- Name
guild- Type
any- Access
- readonly
- Description
- Guild this GuildBanManager belongs to, when the payload included a guild id.
- Availability
- Populated from the Gateway/REST payload or constructor for this GuildBanManager.
Methods
GuildBanManager:bulkCreate()
#Performs bulk create on this GuildBanManager. Call it from bot code when you need that operation on the current object.
Signature
GuildBanManager:bulkCreate(users, options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
users |
any |
required | Passed through to the implementation as written. |
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
GuildBanManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildBanManager
object:bulkCreate(users, {}, function(err, result)
if err then error(err) end
end)GuildBanManager:create()
#Create a new resource through REST and cache the result.
Signature
GuildBanManager:create(user, options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
user |
any |
required | Passed through to the implementation as written. |
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
GuildBanManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildBanManager
object:create(user, {}, function(err, result)
if err then error(err) end
end)GuildBanManager:fetch()
#Request a fresh copy of this resource from REST and update the cache.
Signature
GuildBanManager:fetch(userId, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
userId |
string |
required | Snowflake id string. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
GuildBanManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildBanManager
object:fetch("123", function(err, result)
if err then error(err) end
end)GuildBanManager:remove()
#Remove an item from this GuildBanManager.
Signature
GuildBanManager:remove(user, reason, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
user |
any |
required | Passed through to the implementation as written. |
reason |
string |
optional | Audit-log reason sent as X-Audit-Log-Reason on REST mutations. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
GuildBanManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildBanManager
object:remove(user, reason, function(err, result)
if err then error(err) end
end)GuildBanManager:resolveId()
#Resolve a snowflake, object, or mention to an id string.
Signature
GuildBanManager:resolveId(userOrBan) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
userOrBan |
any |
required | Passed through to the implementation as written. |
Returns
GuildBanManager — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildBanManager
object:resolveId(userOrBan)Examples
local discord = require("discord")
local object = discord.GuildBanManager({})Related APIs
ApplicationCommandManager · ApplicationCommandPermissionsManager · ApplicationEmojiManager · AutoModerationRuleManager · BaseGuildEmojiManager · BaseManager · CachedManager · CategoryChannelChildManager
Version: discord 1.2.4 · runtime 1.0.0