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 = default, DiscordPermissions deny = default, string? reason = null)
Parameters
member
DiscordMemberThe member to have the permission added.
allow
DiscordPermissionsThe permissions to allow.
deny
DiscordPermissionsThe permissions to deny.
reason
stringReason for audit logs.
Returns
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 = default, DiscordPermissions deny = default, string? reason = null)
Parameters
role
DiscordRoleThe role to have the permission added.
allow
DiscordPermissionsThe permissions to allow.
deny
DiscordPermissionsThe permissions to deny.
reason
stringReason for audit logs.
Returns
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.