GuildBan
ClassOn this page
GuildBan is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.
Properties
- Name
client- Type
any- Access
- readonly
- Description
- Owning Client instance used for REST, cache, and event dispatch.
- Availability
- Populated from the Gateway/REST payload or constructor for this GuildBan.
- Name
guild- Type
any- Access
- readonly
- Description
- Guild this GuildBan belongs to, when the payload included a guild id.
- Availability
- Populated from the Gateway/REST payload or constructor for this GuildBan.
- Name
partial- Type
any- Access
- readonly
- Description
- Instance field
GuildBan.partial. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildBan.
- Name
raw- Type
any- Access
- readonly
- Description
- Instance field
GuildBan.raw. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildBan.
- Name
reason- Type
any- Access
- readonly
- Description
- Instance field
GuildBan.reason. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this GuildBan.
Methods
GuildBan:fetch()
#Request a fresh copy of this resource from REST and update the cache.
Signature
GuildBan:fetch(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
GuildBan — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildBan
object:fetch({}, function(err, result)
if err then error(err) end
end)GuildBan:remove()
#Remove an item from this GuildBan.
Signature
GuildBan:remove(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
GuildBan — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a GuildBan
object:remove(function(err, result)
if err then error(err) end
end)Examples
Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.
Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0