Skip to content
SinisterRectus edited this page Sep 27, 2017 · 17 revisions

Permissions()

Wrapper for a bitfield that is more specifically used to represent Discord permissions. See the permission enumeration for acceptable permission values.

Methods

Permissions all()

Constructs a new Permissions object that represents all has all known Discord permissions enabled.

enable(...)

  • ...: Permissions Resolveable(s)

Enables a specific permission or permissions. See the permission enumeration for acceptable permission values.

disable(...)

  • ...: Permissions Resolveable(s)

Disables a specific permission or permissions. See the permission enumeration for acceptable permission values.

boolean has(...)

  • ...: Permissions Resolveable(s)

Returns whether this set has a specific permission or permissions. See the permission enumeration for acceptable permission values.

enableAll()

Enables all permissions values.

disableAll()

Disables all permissions values.

string toHex()

Returns the hexadecimal string that represents the permissions value.

table toTable()

Returns a table that represents the permissions value, where the keys are the permission names and the values are true or false.

table toArray()

Returns an array of the names of the permissions that this objects represents.

Permissions union(other)

  • other: Permissions

Returns a new Permissions object that contains the permissions that are in either self or other (bitwise OR).

Permissions intersection(other)

  • other: Permissions

Returns a new Permissions object that contains the permissions that are in both self and other (bitwise AND).

Permissions difference(other)

  • other: Permissions

Returns a new Permissions object that contains the permissions that are not in self or other (bitwise XOR).

Permissions complement(other)

Returns a new Permissions object that contains the permissions that are not in self, but are in other (or the set of all permissions if omitted).

Permissions copy()

Returns a new copy of the original permissions object.

Properties

number value

The raw decimal value that represents the permissions value.

Clone this wiki locally