Class RestRole
表示一个基于 REST 的身份组。
public class RestRole : RestEntity<ulong>, IRole, IEntity<ulong>, IMentionable, IDeletable
- Inheritance
-
RestRole
- Implements
- Inherited Members
Properties
Color
获取此角色的颜色。
public Color Color { get; }
Property Value
Remarks
如果此用户所拥有的最高角色的颜色类型为渐变色,则此属性返回的颜色是渐变色权益失效后的回退颜色。
ColorType
获取此角色的颜色类型。
public ColorType ColorType { get; }
Property Value
CreatedAt
获取此角色的创建时间。
public DateTimeOffset? CreatedAt { get; }
Property Value
CreatorId
获取此角色的创建者 ID。
public ulong CreatorId { get; }
Property Value
GradientColor
获取此角色的渐变色。
public GradientColor? GradientColor { get; }
Property Value
Remarks
Icon
获取此角色的图标。
public string Icon { get; }
Property Value
IsEveryone
获取此角色是否为 @全体成员
全体成员角色。
public bool IsEveryone { get; }
Property Value
IsHoisted
获取拥有此角色的用户是否在用户列表中与普通在线成员分开显示。
public bool IsHoisted { get; }
Property Value
IsMentionable
获取是否允许任何人提及此角色。
public bool IsMentionable { get; }
Property Value
Mention
获取一个用于提及此对象的格式化字符串。
public string Mention { get; }
Property Value
Name
获取此角色的名称。
public string Name { get; }
Property Value
Permissions
获取此角色拥有的权限。
public RoomPermissions Permissions { get; }
Property Value
Position
获取此角色在房间角色列表中的位置。
public int Position { get; }
Property Value
Remarks
更小的数值表示更靠近列表顶部的位置。
Room
获取拥有此角色的房间。
public IRoom Room { get; }
Property Value
Type
获取此角色的类型。
public RoleType Type { get; }
Property Value
Methods
DeleteAsync(RequestOptions?)
删除此对实体象及其所有子实体对象。
public Task DeleteAsync(RequestOptions? options = null)
Parameters
options
RequestOptions发送请求时要使用的选项。
Returns
ModifyAsync(Action<RoleProperties>, RequestOptions?)
修改此角色。
public Task ModifyAsync(Action<RoleProperties> func, RequestOptions? options = null)
Parameters
func
Action<RoleProperties>一个包含修改角色属性的委托。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步修改操作的任务。
Remarks
此方法使用指定的属性修改当前角色信息。要查看可用的属性,请参考 RoleProperties。