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
ColorType
Gets the type of the color given to users of this role.
ColorType ColorType { get; }
Property Value
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; otherwisefalse
.
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; otherwisefalse
.
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
Type
Gets the type of this role.
RoleType Type { get; }
Property Value
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
CacheModeThe CacheMode that determines whether the object should be fetched from cache.
options
RequestOptionsThe 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
RequestOptionsThe 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.