Table of Contents

Interface IRole

Namespace
Discord
Assembly
Discord.Net.Core.dll

Represents a generic role object to be given to a guild user.

public interface IRole : ISnowflakeEntity, IEntity<ulong>, IDeletable, IMentionable, IComparable<IRole>
Inherited Members

Properties

Color

Gets the color given to users of this role.

Color Color { get; }

Property Value

Color

A Color struct representing the color of this role.

Emoji

Gets the unicode emoji of this role.

Emoji Emoji { get; }

Property Value

Emoji

Remarks

This field is mutually exclusive with Icon, either icon is set or emoji is set.

Flags

Gets flags related to this role.

RoleFlags Flags { get; }

Property Value

RoleFlags

Guild

Gets the guild that owns this role.

IGuild Guild { get; }

Property Value

IGuild

A guild representing the parent guild of this role.

Icon

Gets the icon of this role.

string Icon { get; }

Property Value

string

A string containing the hash of this role's icon.

IsHoisted

Gets a value that indicates whether the role can be separated in the user list.

bool IsHoisted { get; }

Property Value

bool

true if users of this role are separated in the user list; otherwise false.

IsManaged

Gets a value that indicates whether the role is managed by Discord.

bool IsManaged { get; }

Property Value

bool

true if this role is automatically managed by Discord; otherwise false.

IsMentionable

Gets a value that indicates whether the role is mentionable.

bool IsMentionable { get; }

Property Value

bool

true if this role may be mentioned in messages; otherwise false.

Name

Gets the name of this role.

string Name { get; }

Property Value

string

A string containing the name of this role.

Permissions

Gets the permissions granted to members of this role.

GuildPermissions Permissions { get; }

Property Value

GuildPermissions

A GuildPermissions struct that this role possesses.

Position

Gets this role's position relative to other roles in the same guild.

int Position { get; }

Property Value

int

An int representing the position of the role in the role list of the guild.

Tags

Gets the tags related to this role.

RoleTags Tags { get; }

Property Value

RoleTags

A RoleTags object containing all tags related to this role.

Methods

GetIconUrl()

Gets the image url of the icon role.

string GetIconUrl()

Returns

string

An image url of the icon role.

ModifyAsync(Action<RoleProperties>, RequestOptions)

Modifies this role.

Task ModifyAsync(Action<RoleProperties> func, RequestOptions options = null)

Parameters

func Action<RoleProperties>

A delegate containing the properties to modify the role with.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous modification operation.

Remarks

This method modifies this role with the specified properties. To see an example of this method and what properties are available, please refer to RoleProperties.