Skip to content

PermissionOverwrites

classe · Source

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

Extends: Base

Properties

channel

readonly

channel: GuildChannel

The GuildChannel this overwrite is for Source

id

id: Snowflake

The overwrite's id, either a User or a Role id Source

type

type: OverwriteType

The type of this overwrite Source

deny

deny: Readonly<Permissions>

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

allow

allow: Readonly<Permissions>

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

client

readonly

client: Client

The client that instantiated this Source

Methods

edit

async

async edit(options: PermissionOverwriteOptions, reason?: string): Promise<PermissionOverwrites>

Edits this Permission Overwrite. Parameters

NameTypeDescription
optionsPermissionOverwriteOptionsThe options for the update
reason?stringReason for creating/editing this overwrite

Returns: Promise<PermissionOverwrites>

js
// Update permission overwrites
permissionOverwrites.edit({
  SEND_MESSAGES: false
})
  .then(channel => console.log(channel.permissionOverwrites.get(message.author.id)))
  .catch(console.error);

Source

delete

async

async delete(reason?: string): Promise<PermissionOverwrites>

Deletes this Permission Overwrite. Parameters

NameTypeDescription
reason?stringReason for deleting this overwrite

Returns: Promise<PermissionOverwrites>Source

resolveOverwriteOptions

static

resolveOverwriteOptions(options: PermissionOverwriteOptions, initialPermissions: ResolvedOverwriteOptions): ResolvedOverwriteOptions

Resolves bitfield permissions overwrites from an object. Parameters

NameTypeDescription
optionsPermissionOverwriteOptionsThe options for the update
initialPermissionsResolvedOverwriteOptionsThe initial permissions

Returns: ResolvedOverwriteOptionsSource

resolve

static

resolve(overwrite: OverwriteResolvable, guild?: Guild): RawOverwriteData

Resolves an overwrite into RawOverwriteData. Parameters

NameTypeDescription
overwriteOverwriteResolvableThe overwrite-like data to resolve
guild?GuildThe guild to resolve from

Returns: RawOverwriteDataSource

Unofficial software. Not affiliated with or supported by Discord.