PermissionOverwrites

export class PermissionOverwrites extends Base
export class PermissionOverwrites extends Base
Represents a permission overwrite for a role or member in a guild channel.

Extends

Base
The permissions that are allowed for the user or role.
The GuildChannel this overwrite is for
Readonly
client:Client<true>
The client that instantiated this
Inherited from Base
The permissions that are denied for the user or role.
The overwrite's id, either a or a Role id
The type of this overwrite
delete(reason?):Promise<PermissionOverwrites>
Deletes this Permission Overwrite.
NameTypeOptionalDescription
reasonstringYesReason for deleting this overwrite
edit(options, reason?):Promise<PermissionOverwrites>
Edits this Permission Overwrite.
Example
// Update permission overwrites
permissionOverwrites.edit({
SendMessages: false
})
.then(channel => console.log(channel.permissionOverwrites.get(message.author.id)))
.catch(console.error);
// Update permission overwrites
permissionOverwrites.edit({
SendMessages: false
})
.then(channel => console.log(channel.permissionOverwrites.get(message.author.id)))
.catch(console.error);
NameTypeOptionalDescription
optionsPermissionOverwriteOptionsNoThe options for the update
reasonstringYesReason for creating/editing this overwrite
Static
resolve(overwrite, guild):APIOverwrite
Resolves an overwrite into APIOverwrite.
NameTypeOptionalDescription
overwriteOverwriteResolvableNoThe overwrite-like data to resolve
guildGuildNoThe guild to resolve from
Static
resolveOverwriteOptions(options, initialPermissions):ResolvedOverwriteOptions
Resolves bitfield permissions overwrites from an object.
NameTypeOptionalDescription
optionsPermissionOverwriteOptionsNoThe options for the update
initialPermissions{ allow?: PermissionResolvable; deny?: PermissionResolvable }NoThe initial permissions
toJSON():unknown
valueOf():string