Table of Contents

Class RoleProperties

Namespace
Discord
Assembly
Discord.Net.Core.dll

Properties that are used to modify an IRole with the specified changes.

public class RoleProperties
Inheritance
RoleProperties
Inherited Members

Examples

The following example uses ModifyAsync to apply changes specified in the properties,

var role = guild.GetRole(id);
if (role == null) return;

await role.ModifyAsync(x =>
{
    x.Name = "cool boi";
    x.Color = Color.Gold;
    x.Hoist = true;
    x.Mentionable = true;
});

Properties

Color

Gets or sets the color of the role.

public Optional<Color> Color { get; set; }

Property Value

Optional<Color>

Remarks

This value may not be set if the role is an @everyone role.

Emoji

Gets or sets the unicode emoji of the role.

public Optional<Emoji> Emoji { get; set; }

Property Value

Optional<Emoji>

Remarks

This value cannot be set at the same time as Icon, as they are both exclusive.

Setting an Emoji will override a currently existing Icon if present.

Hoist

Gets or sets whether or not this role should be displayed independently in the user list.

public Optional<bool> Hoist { get; set; }

Property Value

Optional<bool>

Remarks

This value may not be set if the role is an @everyone role.

Icon

Gets or sets the icon of the role.

public Optional<Image?> Icon { get; set; }

Property Value

Optional<Image?>

Remarks

This value cannot be set at the same time as Emoji, as they are both exclusive.

Setting an Icon will override a currently existing Emoji if present.

Mentionable

Gets or sets whether or not this role can be mentioned.

public Optional<bool> Mentionable { get; set; }

Property Value

Optional<bool>

Remarks

This value may not be set if the role is an @everyone role.

Name

Gets or sets the name of the role.

public Optional<string> Name { get; set; }

Property Value

Optional<string>

Remarks

This value may not be set if the role is an @everyone role.

Permissions

Gets or sets the role's GuildPermission.

public Optional<GuildPermissions> Permissions { get; set; }

Property Value

Optional<GuildPermissions>

Position

Gets or sets the position of the role. This is 0-based!

public Optional<int> Position { get; set; }

Property Value

Optional<int>

Remarks

This value may not be set if the role is an @everyone role.

See Also