Table of Contents

Class RestRoom

Namespace
HeyBox.Rest
Assembly
HeyBox.Net.Rest.dll

表示一个基于 REST 的房间。

public class RestRoom : RestEntity<ulong>, IRoom, IEntity<ulong>, IUpdateable
Inheritance
RestRoom
Implements
Inherited Members

Properties

Banner

获取此房间横幅图像的 URL。

public string Banner { get; }

Property Value

string

CreatorId

获取此房间所有者的用户 ID。

public uint CreatorId { get; }

Property Value

uint

EveryoneRole

获取此房间中的 @全体成员 全体成员角色。

public RestRole EveryoneRole { get; }

Property Value

RestRole

Icon

获取此房间图标的 URL。

public string Icon { get; }

Property Value

string

IsHot

获取此房间是否热门。

public bool IsHot { get; }

Property Value

bool

IsPublic

获取此房间是否为公开房间。

public bool IsPublic { get; }

Property Value

bool

JoinedAt

获取加入到此房间的时间。

public DateTimeOffset JoinedAt { get; }

Property Value

DateTimeOffset

Name

获取此房间的名称。

public string Name { get; }

Property Value

string

PublicId

获取此房间的公开 ID。

public uint? PublicId { get; }

Property Value

uint?

Remarks

IsPublictrue 时,此属性应该返回一个有效的公开房间 ID; 如果 IsPublicfalse,则此属性应该返回 null

Roles

获取此房间的所有角色。

public IReadOnlyCollection<RestRole> Roles { get; }

Property Value

IReadOnlyCollection<RestRole>

Methods

CreateRoleAsync(Action<RoleProperties>, RequestOptions?)

在此房间内创建一个新角色。

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

Parameters

func Action<RoleProperties>

一个用于填充新角色属性的委托。

options RequestOptions

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

Returns

Task<RestRole>

一个表示异步创建操作的任务。任务的结果包含新创建的角色。

Remarks

此方法使用指定的属性创建新角色。要查看可用的属性,请参考 RoleProperties

DeleteEmoteAsync(RoomEmote, RequestOptions?)

删除此房间内的现有自定义小表情。

public Task DeleteEmoteAsync(RoomEmote emote, RequestOptions? options = null)

Parameters

emote RoomEmote

要删除的自定义小表情。

options RequestOptions

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

Returns

Task

一个表示异步删除操作的任务。

DeleteStickerAsync(RoomSticker, RequestOptions?)

删除此房间内的现有自定义大表情。

public Task DeleteStickerAsync(RoomSticker sticker, RequestOptions? options = null)

Parameters

sticker RoomSticker

要删除的自定义大表情。

options RequestOptions

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

Returns

Task

一个表示异步删除操作的任务。

GetChannelAsync(ulong, RequestOptions?)

获取此房间内的频道。

public Task<RestRoomChannel> GetChannelAsync(ulong id, RequestOptions? options = null)

Parameters

id ulong

要获取的频道的 ID。

options RequestOptions

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

Returns

Task<RestRoomChannel>

一个表示异步获取操作的任务。任务的结果包含与指定的 id 关联的频道;如果未找到,则返回 null

GetEmoteAsync(ulong, RequestOptions?)

获取此房间的指定自定义小表情。

public Task<RoomEmote?> GetEmoteAsync(ulong id, RequestOptions? options = null)

Parameters

id ulong

要获取的自定义表情的 ID。

options RequestOptions

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

Returns

Task<RoomEmote>

一个表示异步获取操作的任务。任务的结果包含与指定的 id 关联的自定义小表情;如果未找到,则返回 null

GetEmotesAsync(RequestOptions?)

获取此房间的所有自定义小表情。

public Task<IReadOnlyCollection<RoomEmote>> GetEmotesAsync(RequestOptions? options = null)

Parameters

options RequestOptions

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

Returns

Task<IReadOnlyCollection<RoomEmote>>

一个表示异步获取操作的任务。任务的结果包含此房间的所有自定义小表情。

GetStickerAsync(ulong, RequestOptions?)

获取此房间的指定自定义大表情。

public Task<RoomSticker?> GetStickerAsync(ulong id, RequestOptions? options = null)

Parameters

id ulong

要获取的自定义表情的 ID。

options RequestOptions

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

Returns

Task<RoomSticker>

一个表示异步获取操作的任务。任务的结果包含与指定的 id 关联的自定义大表情;如果未找到,则返回 null

GetStickersAsync(RequestOptions?)

获取此房间的所有自定义大表情。

public Task<IReadOnlyCollection<RoomSticker>> GetStickersAsync(RequestOptions? options = null)

Parameters

options RequestOptions

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

Returns

Task<IReadOnlyCollection<RoomSticker>>

一个表示异步获取操作的任务。任务的结果包含此房间的所有自定义大表情。

GetTextChannelAsync(ulong, RequestOptions?)

获取此房间内指定具有文字聊天能力的频道。

public Task<RestTextChannel> GetTextChannelAsync(ulong id, RequestOptions? options = null)

Parameters

id ulong

要获取的频道的 ID。

options RequestOptions

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

Returns

Task<RestTextChannel>

一个表示异步获取操作的任务。任务的结果包含与指定的 id 关联的频道;如果未找到,则返回 null

Remarks

语音频道也是一种文字频道,此方法本意用于获取具有文字聊天能力的频道。如果通过此方法传入的 ID 对应的频道是语音频道,那么也会返回对应的语音频道实体。 如需获取频道的实际类型,请参考 GetChannelType(IChannel)

ModifyEmoteAsync(RoomEmote, Action<EmoteProperties>, RequestOptions?)

修改此房间内的现有自定义小表情。

public Task ModifyEmoteAsync(RoomEmote emote, Action<EmoteProperties> func, RequestOptions? options = null)

Parameters

emote RoomEmote

要修改的自定义小表情。

func Action<EmoteProperties>

一个用于设置自定义表情属性的委托。

options RequestOptions

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

Returns

Task

一个表示异步修改操作的任务。任务的结果包含修改后的自定义表情。

ModifyStickerAsync(RoomSticker, Action<EmoteProperties>, RequestOptions?)

修改此房间内的现有自定义大表情。

public Task ModifyStickerAsync(RoomSticker sticker, Action<EmoteProperties> func, RequestOptions? options = null)

Parameters

sticker RoomSticker

要修改的自定义大表情。

func Action<EmoteProperties>

一个用于设置自定义表情属性的委托。

options RequestOptions

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

Returns

Task

一个表示异步修改操作的任务。任务的结果包含修改后的自定义表情。

ToString()

获取此房间的名称。

public override string ToString()

Returns

string

UpdateAsync(RequestOptions?)

通过 REST API 获取此实体对象的最新状态,并替换当前对象的属性。

public Task UpdateAsync(RequestOptions? options = null)

Parameters

options RequestOptions

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

Returns

Task

一个表示异步更新操作的任务。

Remarks

warning

此方法将从黑盒语音 REST API 获取最新数据,并替换当前对象的属性,而非使用指定的属性修改黑盒语音服务端的数据。