export class PermissionOverwriteManager extends CachedManager<Snowflake, PermissionOverwrites, PermissionOverwriteResolvable>
Manages API methods for guild channel permission overwrites and stores their cache.
readonlyCollection<Key, Holds> cache :
The cache of items for this manager.
Inherited from: DataManager
GuildChannel channel :
The channel of the permission overwrite this manager belongs to
readonlyConstructable<Holds> holds :
The data structure belonging to this manager.
Inherited from: DataManager
createuserOrRole: RoleResolvable | UserResolvableoptions: PermissionOverwriteOptionsoverwriteOptions?: GuildChannelOverwriteOptions) : Promise<NonThreadGuildBasedChannel> (
userOrRole: RoleResolvable | UserResolvable
options: PermissionOverwriteOptions
overwriteOptions?: GuildChannelOverwriteOptions
Creates permission overwrites for a user or role in this channel, or replaces them if already present.
Examples:
// Create or Replace permission overwrites for a message author
message.channel.permissionOverwrites.create(message.author, {
SendMessages: false
})
.then(channel => console.log(channel.permissionOverwrites.cache.get(message.author.id)))
.catch(console.error);
deleteuserOrRole: RoleResolvable | UserResolvablereason?: string) : Promise<NonThreadGuildBasedChannel> (
userOrRole: RoleResolvable | UserResolvable
reason?: string
Deletes permission overwrites for a user or role in this channel.
edituserOrRole: RoleResolvable | UserResolvableoptions: PermissionOverwriteOptionsoverwriteOptions?: GuildChannelOverwriteOptions) : Promise<NonThreadGuildBasedChannel> (
userOrRole: RoleResolvable | UserResolvable
options: PermissionOverwriteOptions
overwriteOptions?: GuildChannelOverwriteOptions
Edits permission overwrites for a user or role in this channel, or creates an entry if not already present.
Examples:
// Edit or Create permission overwrites for a message author
message.channel.permissionOverwrites.edit(message.author, {
SendMessages: false
})
.then(channel => console.log(channel.permissionOverwrites.cache.get(message.author.id)))
.catch(console.error);
Overload 1
Overload 2
Overload 1
Overload 2
setoverwrites: readonly OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>reason?: string) : Promise<NonThreadGuildBasedChannel> (
overwrites: readonly OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>
reason?: string
Replaces the permission overwrites in this channel.
Examples:
message.channel.permissionOverwrites.set([
{
id: message.author.id,
deny: [PermissionsFlagsBit.ViewChannel],
},
], 'Needed to change permissions');
valueOfCollection<Key, Holds> () :
Inherited from: DataManager