Method ModifyAsync
- Namespace
- DSharpPlus.Entities
- Assembly
- DSharpPlus.dll
ModifyAsync(string, DiscordPermissions?, DiscordColor?, bool?, bool?, string, Stream, DiscordEmoji)
Updates this role.
public Task ModifyAsync(string name = null, DiscordPermissions? permissions = null, DiscordColor? color = null, bool? hoist = null, bool? mentionable = null, string reason = null, Stream icon = null, DiscordEmoji emoji = null)
Parameters
name
stringNew role name
permissions
DiscordPermissions?New role permissions
color
DiscordColor?New role color
hoist
bool?New role hoist
mentionable
bool?Whether this role is mentionable
reason
stringReason why we made this change
icon
StreamThe icon to add to this role
emoji
DiscordEmojiThe emoji to add to this role. Must be unicode.
Returns
- Task
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>)
public Task ModifyAsync(Action<RoleEditModel> action)
Parameters
action
Action<RoleEditModel>
Returns
- Task
Exceptions
- UnauthorizedException
Thrown when the client does not have theManageRoles 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.