Class KookRestClientExperimentalExtensions
提供用于 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
clientKookRestClientKOOK REST 客户端实例。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task<IReadOnlyCollection<RestGuild>>
一个表示异步操作的任务,任务的结果包含当前用户具有 Administrator 权限的使用服务器。
GetVoiceGatewayTokenAsync(KookRestClient, IVoiceChannel, RequestOptions?)
获取指定语音频道的语音信令网关令牌。
public static Task<VoiceGatewayToken> GetVoiceGatewayTokenAsync(this KookRestClient client, IVoiceChannel channel, RequestOptions? options = null)
Parameters
clientKookRestClientKOOK REST 客户端实例。
channelIVoiceChannel语音频道。
optionsRequestOptions发送请求时要使用的选项。
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
clientKookRestClientKOOK REST 客户端实例。
channelIdulong语音频道的 ID。
optionsRequestOptions发送请求时要使用的选项。
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
clientKookRestClientKOOK REST 客户端实例。
keywordstring要查询的关键字。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task<IReadOnlyCollection<ThreadTag>>
一个表示异步操作的任务,任务的结果包含与指定关键字相关的帖子话题标签集合。
ValidateCardAsync(KookRestClient, ICard, RequestOptions?)
验证卡片。
public static Task ValidateCardAsync(this KookRestClient client, ICard card, RequestOptions? options = null)
Parameters
clientKookRestClientKOOK REST 客户端实例。
cardICard要验证的卡片。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步验证操作的任务。
ValidateCardsAsync(KookRestClient, IEnumerable<ICard>, RequestOptions?)
验证卡片。
public static Task ValidateCardsAsync(this KookRestClient client, IEnumerable<ICard> cards, RequestOptions? options = null)
Parameters
clientKookRestClientKOOK REST 客户端实例。
cardsIEnumerable<ICard>要验证的卡片。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步验证操作的任务。
ValidateCardsAsync(KookRestClient, string, RequestOptions?)
验证卡片。
public static Task ValidateCardsAsync(this KookRestClient client, string cardsJson, RequestOptions? options = null)
Parameters
clientKookRestClientKOOK REST 客户端实例。
cardsJsonstring要验证的卡片的 JSON 字符串。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步验证操作的任务。