PermissionOverwrites
classe · Source
Represents a permission overwrite for a role or member in a guild channel.
Extends: Base
Properties
channel
readonly
The GuildChannel this overwrite is for Source
id
The overwrite's id, either a User or a Role id Source
type
The type of this overwrite Source
deny
The permissions that are denied for the user or role. Source
allow
The permissions that are allowed for the user or role. Source
client
readonly
The client that instantiated this Source
Methods
edit
async
Edits this Permission Overwrite. Parameters
| Name | Type | Description |
|---|---|---|
options | PermissionOverwriteOptions | The options for the update |
reason? | string | Reason for creating/editing this overwrite |
Returns: Promise<PermissionOverwrites>
// Update permission overwrites
permissionOverwrites.edit({
SEND_MESSAGES: false
})
.then(channel => console.log(channel.permissionOverwrites.get(message.author.id)))
.catch(console.error);2
3
4
5
6
delete
async
Deletes this Permission Overwrite. Parameters
| Name | Type | Description |
|---|---|---|
reason? | string | Reason for deleting this overwrite |
Returns: Promise<PermissionOverwrites>Source
resolveOverwriteOptions
static
Resolves bitfield permissions overwrites from an object. Parameters
| Name | Type | Description |
|---|---|---|
options | PermissionOverwriteOptions | The options for the update |
initialPermissions | ResolvedOverwriteOptions | The initial permissions |
Returns: ResolvedOverwriteOptionsSource
resolve
static
Resolves an overwrite into RawOverwriteData. Parameters
| Name | Type | Description |
|---|---|---|
overwrite | OverwriteResolvable | The overwrite-like data to resolve |
guild? | Guild | The guild to resolve from |
Returns: RawOverwriteDataSource