Skip to content
SinisterRectus edited this page Nov 5, 2016 · 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 Description
complement([other]) Returns a new Permissions object with the permissions that are in other (or all) but not self.
difference(other) Returns a new Permissions object with the permissions that in self or other, but not both (bitwise XOR).
disable(flag[, ...]) Disables a permission or permissions.
disableAll() Disables all permissions.
enable(flag[, ...]) Enables a permission or permissions.
enableAll() Enables all permissions.
has(flag[, ...]) Returns a boolean indicating whether a permission or permissions is/are enabled.
intersection(other) Returns a new Permissions object with the permissions that are in self and other (bitwise AND).
toHex() Returns a hex string for the permission's value.
toTable() Returns an array-like Lua table of the object's enabled flags.
union(other) Returns a new Permissions object with the permissions that are in self or other (bitwise OR).
Clone this wiki locally