Table of Contents

Class SocketRole

Namespace
HeyBox.WebSocket
Assembly
HeyBox.Net.WebSocket.dll

表示一个基于网关的身份组。

public class SocketRole : SocketEntity<ulong>, IRole, IEntity<ulong>, IMentionable, IDeletable
Inheritance
SocketRole
Implements
Inherited Members

Properties

Color

获取此角色的颜色。

public Color Color { get; }

Property Value

Color

Remarks

如果此用户所拥有的最高角色的颜色类型为渐变色,则此属性返回的颜色是渐变色权益失效后的回退颜色。

ColorType

获取此角色的颜色类型。

public ColorType ColorType { get; }

Property Value

ColorType

CreatedAt

获取此角色的创建时间。

public DateTimeOffset? CreatedAt { get; }

Property Value

DateTimeOffset?

CreatorId

获取此角色的创建者 ID。

public ulong CreatorId { get; }

Property Value

ulong

GradientColor

获取此角色的渐变色。

public GradientColor? GradientColor { get; }

Property Value

GradientColor?

Remarks

如果此角色的颜色类型 ColorType 不为 Gradient,则此属性会返回 null

Icon

获取此角色的图标。

public string Icon { get; }

Property Value

string

IsEveryone

获取此角色是否为 @全体成员 全体成员角色。

public bool IsEveryone { get; }

Property Value

bool

IsHoisted

获取拥有此角色的用户是否在用户列表中与普通在线成员分开显示。

public bool IsHoisted { get; }

Property Value

bool

IsMentionable

获取是否允许任何人提及此角色。

public bool IsMentionable { get; }

Property Value

bool

Mention

获取一个用于提及此对象的格式化字符串。

public string Mention { get; }

Property Value

string

Name

获取此角色的名称。

public string Name { get; }

Property Value

string

Permissions

获取此角色拥有的权限。

public RoomPermissions Permissions { get; }

Property Value

RoomPermissions

Position

获取此角色在房间角色列表中的位置。

public int Position { get; }

Property Value

int

Remarks

更小的数值表示更靠近列表顶部的位置。

Room

获取拥有此角色的房间。

public SocketRoom Room { get; }

Property Value

SocketRoom

Type

获取此角色的类型。

public RoleType Type { get; }

Property Value

RoleType

Methods

DeleteAsync(RequestOptions?)

删除此对实体象及其所有子实体对象。

public Task DeleteAsync(RequestOptions? options = null)

Parameters

options RequestOptions

发送请求时要使用的选项。

Returns

Task

ModifyAsync(Action<RoleProperties>, RequestOptions?)

修改此角色。

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

Parameters

func Action<RoleProperties>

一个包含修改角色属性的委托。

options RequestOptions

发送请求时要使用的选项。

Returns

Task

一个表示异步修改操作的任务。

Remarks

此方法使用指定的属性修改当前角色信息。要查看可用的属性,请参考 RoleProperties

ToString()

获取此角色的名称。

public override string ToString()

Returns

string