Table of Contents

Class KookRestClientExperimentalExtensions

Namespace
Kook.Rest
Assembly
Kook.Net.Experimental.dll

提供用于 KookRestClient 的实验性功能的扩展方法。

public static class KookRestClientExperimentalExtensions
Inheritance
KookRestClientExperimentalExtensions
Inherited Members

Methods

GetAdminGuildsAsync(KookRestClient, RequestOptions?)

获取当前用户具有 Administrator 权限的服务器的集合。

public static Task<IReadOnlyCollection<RestGuild>> GetAdminGuildsAsync(this KookRestClient client, RequestOptions? options = null)

Parameters

client KookRestClient

KOOK REST 客户端实例。

options RequestOptions

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

Returns

Task<IReadOnlyCollection<RestGuild>>

一个表示异步操作的任务,任务的结果包含当前用户具有 Administrator 权限的使用服务器。

GetVoiceGatewayTokenAsync(KookRestClient, IVoiceChannel, RequestOptions?)

获取指定语音频道的语音信令网关令牌。

public static Task<VoiceGatewayToken> GetVoiceGatewayTokenAsync(this KookRestClient client, IVoiceChannel channel, RequestOptions? options = null)

Parameters

client KookRestClient

KOOK REST 客户端实例。

channel IVoiceChannel

语音频道。

options RequestOptions

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

Returns

Task<VoiceGatewayToken>

一个表示异步操作的任务,任务的结果包含语音信令网关令牌。

Remarks

此接口并非官方文档化的接口,行为可能随时变化。返回的令牌包含临时鉴权信息,请勿将其写入日志。 Bot 需要被授权才能获取令牌:实测中,没有任何服务器角色的 Bot 会被拒绝(HTTP 403)。 通常不需要直接调用此方法,使用 ConnectWebRtcAsync(SocketVoiceChannel, Action<IWebRtcAudioClient>?) 即可。

GetVoiceGatewayTokenAsync(KookRestClient, ulong, RequestOptions?)

获取指定语音频道的语音信令网关令牌。

public static Task<VoiceGatewayToken> GetVoiceGatewayTokenAsync(this KookRestClient client, ulong channelId, RequestOptions? options = null)

Parameters

client KookRestClient

KOOK REST 客户端实例。

channelId ulong

语音频道的 ID。

options RequestOptions

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

Returns

Task<VoiceGatewayToken>

一个表示异步操作的任务,任务的结果包含语音信令网关令牌。

Remarks

此接口并非官方文档化的接口,行为可能随时变化。返回的令牌包含临时鉴权信息,请勿将其写入日志。 Bot 需要被授权才能获取令牌:实测中,没有任何服务器角色的 Bot 会被拒绝(HTTP 403)。 通常不需要直接调用此方法,使用 ConnectWebRtcAsync(SocketVoiceChannel, Action<IWebRtcAudioClient>?) 即可。

QueryThreadTagsAsync(KookRestClient, string, RequestOptions?)

查询与指定关键字相关的帖子话题标签。

public static Task<IReadOnlyCollection<ThreadTag>> QueryThreadTagsAsync(this KookRestClient client, string keyword, RequestOptions? options = null)

Parameters

client KookRestClient

KOOK REST 客户端实例。

keyword string

要查询的关键字。

options RequestOptions

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

Returns

Task<IReadOnlyCollection<ThreadTag>>

一个表示异步操作的任务,任务的结果包含与指定关键字相关的帖子话题标签集合。

ValidateCardAsync(KookRestClient, ICard, RequestOptions?)

验证卡片。

public static Task ValidateCardAsync(this KookRestClient client, ICard card, RequestOptions? options = null)

Parameters

client KookRestClient

KOOK REST 客户端实例。

card ICard

要验证的卡片。

options RequestOptions

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

Returns

Task

一个表示异步验证操作的任务。

ValidateCardsAsync(KookRestClient, IEnumerable<ICard>, RequestOptions?)

验证卡片。

public static Task ValidateCardsAsync(this KookRestClient client, IEnumerable<ICard> cards, RequestOptions? options = null)

Parameters

client KookRestClient

KOOK REST 客户端实例。

cards IEnumerable<ICard>

要验证的卡片。

options RequestOptions

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

Returns

Task

一个表示异步验证操作的任务。

ValidateCardsAsync(KookRestClient, string, RequestOptions?)

验证卡片。

public static Task ValidateCardsAsync(this KookRestClient client, string cardsJson, RequestOptions? options = null)

Parameters

client KookRestClient

KOOK REST 客户端实例。

cardsJson string

要验证的卡片的 JSON 字符串。

options RequestOptions

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

Returns

Task

一个表示异步验证操作的任务。