PermissionsBitField
bitfieldOn 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.
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
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
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
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.
Related APIs
Version: discord 1.2.9 · runtime 1.0.0