Class: PermissionOverwrites

PermissionOverwrites

Represents a permission overwrite for a role or member in a guild channel.

Constructor

new PermissionOverwrites()

Source:

Members

allow :Readonly.<Permissions>

The permissions that are allowed for the user or role.
Type:
Source:

(readonly) channel :GuildChannel

The GuildChannel this overwrite is for
Type:
Source:

deny :Readonly.<Permissions>

The permissions that are denied for the user or role.
Type:
Source:

id :Snowflake

The ID of this overwrite, either a user ID or a role ID
Type:
Source:

type :OverwriteType

The type of this overwrite
Type:
Source:

Methods

(static) resolve(overwrite, guild) → {RawOverwriteData}

Resolves an overwrite into RawOverwriteData.
Parameters:
Name Type Description
overwrite OverwriteResolvable The overwrite-like data to resolve
guild Guild The guild to resolve from
Source:
Returns:
Type
RawOverwriteData

(static) resolveOverwriteOptions(options, initialPermissions) → {ResolvedOverwriteOptions}

Resolves bitfield permissions overwrites from an object.
Parameters:
Name Type Description
options PermissionOverwriteOptions The options for the update
initialPermissions Object The initial permissions
Properties
Name Type Description
allow PermissionResolvable Initial allowed permissions
deny PermissionResolvable Initial denied permissions
Source:
Returns:
Type
ResolvedOverwriteOptions

delete(reasonopt) → {Promise.<PermissionOverwrites>}

Deletes this Permission Overwrite.
Parameters:
Name Type Attributes Description
reason string <optional>
Reason for deleting this overwrite
Source:
Returns:
Type
Promise.<PermissionOverwrites>

update(options, reasonopt) → {Promise.<PermissionOverwrites>}

Updates this permissionOverwrites.
Parameters:
Name Type Attributes Description
options PermissionOverwriteOptions The options for the update
reason string <optional>
Reason for creating/editing this overwrite
Source:
Returns:
Type
Promise.<PermissionOverwrites>
Example
// Update permission overwrites
permissionOverwrites.update({
  SEND_MESSAGES: false
})
  .then(channel => console.log(channel.permissionOverwrites.get(message.author.id)))
  .catch(console.error);