Method ModifyAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
ModifyAsync(string, Permissions?, DiscordColor?, bool?, bool?, string)
Updates this role.
public Task ModifyAsync(string name = null, Permissions? permissions = null, DiscordColor? color = null, bool? hoist = null, bool? mentionable = null, string reason = null)
Parameters
name
stringNew role name.
permissions
Permissions?New role permissions.
color
DiscordColor?New role color.
hoist
bool?New role hoist.
mentionable
bool?Whether this role is mentionable.
reason
stringAudit log reason.
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the ManageRoles permission.
- NotFoundException
Thrown when the role does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.
ModifyAsync(Action<RoleEditModel>)
Updates this role.
public Task ModifyAsync(Action<RoleEditModel> action)
Parameters
action
Action<RoleEditModel>The action.
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the ManageRoles permission.
- NotFoundException
Thrown when the role does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.