DiscordLua
discorddiscord
v1.2.9
Install

PermissionsBitField

bitfield
On this page

PermissionsBitField is a DiscordLua bitfield representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.

bitfield Module 1.2.9 Source

Methods

PermissionsBitField:any()

#

Performs any on this PermissionsBitField. Call it from bot code when you need that operation on the current object.

Signature

PermissionsBitField:any(permission, checkAdmin)

Parameters

NameTypeRequiredBehavior
permission any required Passed through to the implementation as written.
checkAdmin any required Passed through to the implementation as written.

Returns

PermissionsBitField — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a PermissionsBitField
object:any(permission, checkAdmin)

PermissionsBitField:has()

#

Performs has on this PermissionsBitField. Call it from bot code when you need that operation on the current object.

Signature

PermissionsBitField:has(permission, checkAdmin)

Parameters

NameTypeRequiredBehavior
permission any required Passed through to the implementation as written.
checkAdmin any required Passed through to the implementation as written.

Returns

PermissionsBitField — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a PermissionsBitField
object:has(permission, checkAdmin)

PermissionsBitField:missing()

#

Performs missing on this PermissionsBitField. Call it from bot code when you need that operation on the current object.

Signature

PermissionsBitField:missing(permission, checkAdmin)

Parameters

NameTypeRequiredBehavior
permission any required Passed through to the implementation as written.
checkAdmin any required Passed through to the implementation as written.

Returns

PermissionsBitField — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a PermissionsBitField
object:missing(permission, checkAdmin)

PermissionsBitField:toArray()

#

Performs to array on this PermissionsBitField. Call it from bot code when you need that operation on the current object.

Signature

PermissionsBitField:toArray()

Parameters

No parameters.

Returns

PermissionsBitField — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a PermissionsBitField
object:toArray()

Static members

  • PermissionsBitField.All
  • PermissionsBitField.Default
  • PermissionsBitField.StageModerator

Examples

Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.

BitField

Version: discord 1.2.9 · runtime 1.0.0

Search Ctrl K Navigate Open Esc