DiscordLua
discorddiscord
v1.2.4
Install

PermissionOverwrites

Class
On this page

PermissionOverwrites 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

PermissionOverwrites.allow

# readonly
Name
allow
Type
any
Access
readonly
Description
Instance field PermissionOverwrites.allow. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this PermissionOverwrites.

PermissionOverwrites.channel

# readonly
Name
channel
Type
any
Access
readonly
Description
Channel this PermissionOverwrites belongs to, when resolved from cache.
Availability
Populated from the Gateway/REST payload or constructor for this PermissionOverwrites.

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

PermissionOverwrites.deny

# readonly
Name
deny
Type
any
Access
readonly
Description
Instance field PermissionOverwrites.deny. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this PermissionOverwrites.

PermissionOverwrites.id

# readonly
Name
id
Type
any
Access
readonly
Description
Snowflake id of this PermissionOverwrites.
Availability
Populated from the Gateway/REST payload or constructor for this PermissionOverwrites.

PermissionOverwrites.raw

# readonly
Name
raw
Type
any
Access
readonly
Description
Instance field PermissionOverwrites.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 PermissionOverwrites.

PermissionOverwrites.type

# readonly
Name
type
Type
any
Access
readonly
Description
Instance field PermissionOverwrites.type. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this PermissionOverwrites.

Methods

PermissionOverwrites:allowBits()

#

Performs allow bits on this PermissionOverwrites. Call it from bot code when you need that operation on the current object.

Signature

PermissionOverwrites:allowBits()

Parameters

No parameters.

Returns

PermissionOverwrites — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a PermissionOverwrites
object:allowBits()

PermissionOverwrites:delete()

#

Permanently delete this resource through REST.

Signature

PermissionOverwrites:delete(reason, callback)

Parameters

NameTypeRequiredBehavior
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

PermissionOverwrites — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a PermissionOverwrites
object:delete(reason, function(err, result)
    if err then error(err) end
end)

PermissionOverwrites:denyBits()

#

Performs deny bits on this PermissionOverwrites. Call it from bot code when you need that operation on the current object.

Signature

PermissionOverwrites:denyBits()

Parameters

No parameters.

Returns

PermissionOverwrites — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a PermissionOverwrites
object:denyBits()

PermissionOverwrites:edit()

#

Apply a REST update to this resource.

Signature

PermissionOverwrites:edit(options, extra, callback)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.
extra any optional Passed through to the implementation as written.
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

PermissionOverwrites — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a PermissionOverwrites
object:edit({}, extra, function(err, result)
    if err then error(err) end
end)

PermissionOverwrites:isMember()

#

Predicate that returns whether this PermissionOverwrites matches isMember. Use it to branch before calling type-specific methods.

Signature

PermissionOverwrites:isMember()

Parameters

No parameters.

Returns

PermissionOverwrites — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a PermissionOverwrites
object:isMember()

PermissionOverwrites:isRole()

#

Predicate that returns whether this PermissionOverwrites matches isRole. Use it to branch before calling type-specific methods.

Signature

PermissionOverwrites:isRole()

Parameters

No parameters.

Returns

PermissionOverwrites — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a PermissionOverwrites
object:isRole()

PermissionOverwrites.resolve()

# static

Resolve a snowflake, object, or mention to a cached instance.

Signature

PermissionOverwrites.resolve(overwrite, guild)

Parameters

NameTypeRequiredBehavior
overwrite any required Passed through to the implementation as written.
guild any required Passed through to the implementation as written.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a PermissionOverwrites
PermissionOverwrites.resolve(overwrite, guild)

PermissionOverwrites.resolveOverwriteOptions()

# static

Performs resolve overwrite options on this PermissionOverwrites. Call it from bot code when you need that operation on the current object.

Signature

PermissionOverwrites.resolveOverwriteOptions(options, initial)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.
initial any required Passed through to the implementation as written.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a PermissionOverwrites
PermissionOverwrites.resolveOverwriteOptions({}, initial)

PermissionOverwrites:toJSON()

#

Serialize this PermissionOverwrites into a Lua table suitable for REST or debugging.

Signature

PermissionOverwrites:toJSON()

Parameters

No parameters.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a PermissionOverwrites
object:toJSON()

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