Table of Contents

Method AddOverwriteAsync

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

AddOverwriteAsync(DiscordMember, DiscordPermissions, DiscordPermissions, string?)

Adds a channel permission overwrite for specified member.

public Task AddOverwriteAsync(DiscordMember member, DiscordPermissions allow = DiscordPermissions.None, DiscordPermissions deny = DiscordPermissions.None, string? reason = null)

Parameters

member DiscordMember

The member to have the permission added.

allow DiscordPermissions

The permissions to allow.

deny DiscordPermissions

The permissions to deny.

reason string

Reason for audit logs.

Returns

Task

Exceptions

UnauthorizedException

Thrown when the client does not have the ManageRoles permission.

NotFoundException

Thrown when the channel does not exist.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.

AddOverwriteAsync(DiscordRole, DiscordPermissions, DiscordPermissions, string?)

Adds a channel permission overwrite for specified role.

public Task AddOverwriteAsync(DiscordRole role, DiscordPermissions allow = DiscordPermissions.None, DiscordPermissions deny = DiscordPermissions.None, string? reason = null)

Parameters

role DiscordRole

The role to have the permission added.

allow DiscordPermissions

The permissions to allow.

deny DiscordPermissions

The permissions to deny.

reason string

Reason for audit logs.

Returns

Task

Exceptions

UnauthorizedException

Thrown when the client does not have the ManageRoles permission.

NotFoundException

Thrown when the channel does not exist.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.