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
namestringNew role name
permissionsDiscordPermissions?New role permissions
colorDiscordColor?New role color
hoistbool?New role hoist
mentionablebool?Whether this role is mentionable
reasonstringReason why we made this change
iconStreamThe icon to add to this role
emojiDiscordEmojiThe emoji to add to this role. Must be unicode.
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>)
public Task ModifyAsync(Action<RoleEditModel> action)
Parameters
actionAction<RoleEditModel>
Returns
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.