Table of Contents

Class HeyBoxRestClient

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

表示一个基于 REST 的黑盒语音客户端。

public class HeyBoxRestClient : BaseHeyBoxClient, IHeyBoxClient, IDisposable
Inheritance
HeyBoxRestClient
Implements
Derived
Inherited Members

Constructors

HeyBoxRestClient()

使用默认配置初始化一个 HeyBoxRestClient 类的新实例。

public HeyBoxRestClient()

HeyBoxRestClient(HeyBoxRestConfig)

使用指定的配置初始化一个 HeyBoxRestClient 类的新实例。

public HeyBoxRestClient(HeyBoxRestConfig config)

Parameters

config HeyBoxRestConfig

用于初始化客户端的配置。

Properties

CurrentUser

获取登录到此客户端的当前用户;如果未登录,则为 null

public RestSelfUser? CurrentUser { get; }

Property Value

RestSelfUser

Methods

AddReactionAsync(ulong, ulong, ulong, IEmote, RequestOptions?)

向指定的消息添加一个回应。

public Task AddReactionAsync(ulong messageId, ulong channelId, ulong roomId, IEmote emote, RequestOptions? options = null)

Parameters

messageId ulong

要为其添加回应的消息的 ID。

channelId ulong

要为其添加回应的消息所在的频道的 ID。

roomId ulong

要为其添加回应的消息所在的房间的 ID。

emote IEmote

要用于向指定消息添加回应的表情符号。

options RequestOptions

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

Returns

Task

一个表示添加添加异步操作的任务。

CreateDMChannel(uint)

创建一个用于与指定用户收发私信的频道。

public RestDMChannel CreateDMChannel(uint userId)

Parameters

userId uint

Returns

RestDMChannel

与指定用户相关的私信频道。

GetRoomAsync(ulong, RequestOptions?)

获取一个房间。

public Task<RestRoom?> GetRoomAsync(ulong id, RequestOptions? options = null)

Parameters

id ulong

房间的 ID。

options RequestOptions

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

Returns

Task<RestRoom>

一个表示异步获取操作的任务。任务的结果是具有指定 ID 的房间。若指定 ID 的房间不存在,则为 null

GetRoomsAsync(RequestOptions?)

获取当前用户所在的所有房间。

public Task<IReadOnlyCollection<RestRoom>> GetRoomsAsync(RequestOptions? options = null)

Parameters

options RequestOptions

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

Returns

Task<IReadOnlyCollection<RestRoom>>

一个表示异步获取操作的任务。任务的结果是当前用户所在的所有房间。

RemoveReactionAsync(ulong, ulong, ulong, IEmote, RequestOptions?)

从指定的消息移除一个回应。

public Task RemoveReactionAsync(ulong messageId, ulong channelId, ulong roomId, IEmote emote, RequestOptions? options = null)

Parameters

messageId ulong

要从中移除回应的消息的 ID。

channelId ulong

要从中移除回应的消息所在的频道的 ID。

roomId ulong

要从中移除回应的消息所在的房间的 ID。

emote IEmote

要从指定消息移除的回应的表情符号。

options RequestOptions

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

Returns

Task

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