Permission

Permission

Represents a calculated permissions number

Constructor

new Permission()

Properties:
Name Type Description
allow BigInt

The allowed permissions number

deny BigInt

The denied permissions number

json Object

A JSON representation of the permissions number. If a permission key isn't there, it is not set by this permission. If a permission key is false, it is denied by the permission. If a permission key is true, it is allowed by the permission. i.e.: { "readMessages": true, "sendMessages": true, "manageMessages": false } In the above example, readMessages and sendMessages are allowed permissions, and manageMessages is denied. Everything else is not explicitly set. A full list of permission nodes can be found on the docs reference page

Source:

Methods

has(permission) → {Boolean}

Check if this permission allows a specific permission

Source:
Parameters:
Name Type Description
permission String | BigInt

The name of the permission, or bit of permissions. A full list of permission nodes can be found on the docs reference page. Pass a BigInt if you want to check multiple permissions.

Returns:
Type:
Boolean

Whether the permission allows the specified permission