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
namestringNew role name.
permissionsPermissions?New role permissions.
colorDiscordColor?New role color.
hoistbool?New role hoist.
mentionablebool?Whether this role is mentionable.
reasonstringAudit 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
actionAction<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.