Skip to content
SinisterRectus edited this page Mar 4, 2017 · 17 revisions

Wrapper for a Discord permissions bit set.

Class Properties

Name Type Mutable Description
value number Decimal representing the total permissions

Class Methods

Prototype Interface Description
complement([other]) Local Returns a new Permissions object with the permissions that are in other (or all) but not self.
difference(other) Local Returns a new Permissions object with the permissions that in self or other, but not both (bitwise XOR).
disable(flag[, ...]) Local Disables a permission or permissions.
disableAll() Local Disables all permissions.
enable(flag[, ...]) Local Enables a permission or permissions.
enableAll() Local Enables all permissions.
has(flag[, ...]) Local Returns a boolean indicating whether a permission or permissions is/are enabled.
intersection(other) Local Returns a new Permissions object with the permissions that are in self and other (bitwise AND).
toArray() Local Returns an array-like Lua table of all enabled flags.
toHex() Local Returns a hex string for the permission's value.
toTable() Local Returns a Lua table indicating whether each permission flag is enabled.
union(other) Local Returns a new Permissions object with the permissions that are in self or other (bitwise OR).
Clone this wiki locally