DiscordLua
discorddiscord
v1.2.4
Install

GuildBan

Class
On 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.

class Module 1.2.4 Source

Properties

GuildBan.client

# readonly
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.

GuildBan.guild

# readonly
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.

GuildBan.partial

# readonly
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.

GuildBan.raw

# readonly
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.

GuildBan.reason

# readonly
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.

GuildBan.user

# readonly
Name
user
Type
User
Access
readonly
Description
User object associated with this GuildBan.
Availability
Populated from the Gateway/REST payload or constructor for this GuildBan.
Related
User

Methods

GuildBan:fetch()

#

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

Signature

GuildBan:fetch(options, callback)

Parameters

NameTypeRequiredBehavior
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

lua
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

NameTypeRequiredBehavior
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

GuildBan — the same instance, for chaining.

Example

lua
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.

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc