Table of Contents

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 string

New 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 string

Reason why we made this change

icon Stream

The icon to add to this role

emoji DiscordEmoji

The 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.