Table of Contents

Interface IRole

Namespace
Kook
Assembly
Kook.Net.Core.dll

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

public interface IRole : IEntity<uint>, 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.

ColorType

Gets the type of the color given to users of this role.

ColorType ColorType { get; }

Property Value

ColorType

A ColorType struct representing the color type of this role.

GradientColor

Gets the gradient color given to users of this role.

GradientColor? GradientColor { get; }

Property Value

GradientColor?

A GradientColor struct representing the gradient color of this role; null if the role does not have a gradient color.

Guild

Gets the guild that owns this role.

IGuild Guild { get; }

Property Value

IGuild

A guild representing the parent guild of this role.

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.

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.

Type

Gets the type of this role.

RoleType Type { get; }

Property Value

RoleType

A RoleType representing the type of this role.

Methods

GetUsersAsync(CacheMode, RequestOptions?)

Gets a collection of users with this role.

IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> GetUsersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions? options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

IAsyncEnumerable<IReadOnlyCollection<IGuildUser>>

Paged collection of users with this 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.