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

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

@method all

**Returns: **`Permissions

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

@method enable

  • ...: Permissions Resolveable(s)

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

@method disable

  • ...: Permissions Resolveable(s)

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

@method has

  • ...: Permissions Resolveable(s) **Returns: **`boolean

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

@method enableAll

Enables all permissions values.

@method disableAll

Disables all permissions values.

@method toHex

**Returns: **`string

Returns the hexadecimal string that represents the permissions value.

@method toTable

**Returns: **`table

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

@method toArray

**Returns: **`table

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

@method union

  • other: Permissions **Returns: **`Permissions

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

@method intersection

  • other: Permissions **Returns: **`Permissions

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

@method difference

  • other: Permissions **Returns: **`Permissions

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

@method complement

  • **Returns: **`Permissions

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

@method copy

**Returns: **`Permissions

Returns a new copy of the original permissions object.

@property value: number

The raw decimal value that represents the permissions value.

Clone this wiki locally