Class RoleProperties
Properties that are used to modify an IRole with the specified changes.
Inheritance
Inherited Members
Namespace: Discord
Assembly: Discord.Net.Core.dll
Syntax
public class RoleProperties
Examples
The following example modifies the role to a mentionable one, renames the role into Sonic, and
changes the color to a light-blue.
await role.ModifyAsync(x =>
{
x.Name = "Sonic";
x.Color = new Color(0x1A50BC);
x.Mentionable = true;
});
Properties
| Improve this Doc View SourceColor
Gets or sets the color of the role.
Declaration
public Optional<Color> Color { get; set; }
Property Value
| Type | Description |
|---|---|
| Optional<Color> |
Remarks
This value may not be set if the role is an @everyone role.
Hoist
Gets or sets whether or not this role should be displayed independently in the user list.
Declaration
public Optional<bool> Hoist { get; set; }
Property Value
| Type | Description |
|---|---|
| Optional<System.Boolean> |
Remarks
This value may not be set if the role is an @everyone role.
Mentionable
Gets or sets whether or not this role can be mentioned.
Declaration
public Optional<bool> Mentionable { get; set; }
Property Value
| Type | Description |
|---|---|
| Optional<System.Boolean> |
Remarks
This value may not be set if the role is an @everyone role.
Name
Gets or sets the name of the role.
Declaration
public Optional<string> Name { get; set; }
Property Value
| Type | Description |
|---|---|
| Optional<System.String> |
Remarks
This value may not be set if the role is an @everyone role.
Permissions
Gets or sets the role's GuildPermission.
Declaration
public Optional<GuildPermissions> Permissions { get; set; }
Property Value
| Type | Description |
|---|---|
| Optional<GuildPermissions> |
Position
Gets or sets the position of the role. This is 0-based!
Declaration
public Optional<int> Position { get; set; }
Property Value
| Type | Description |
|---|---|
| Optional<System.Int32> |
Remarks
This value may not be set if the role is an @everyone role.