Package-level declarations

QQ频道开发者文档中定义的API进行对照实现的模块。

QQ频道开发者文档中定义的API进行对照实现的模块。

Types

Link copied to clipboard
interface ApiDescription

对一个 API 类型的描述,属性格式与 接口权限对象 中的相关信息保持一致。

Link copied to clipboard
Link copied to clipboard
@SerialName(value = "n")
data class Gateway(val url: String) : GatewayInfo

一个用于连接 websocket 的地址。GatewayApis.Normal 的响应体。

Link copied to clipboard
sealed class GatewayApis<R : GatewayInfo>(val path: Array<String>, val resultDeserializationStrategy: DeserializationStrategy<R>) : GetQQGuildApi<R>

获取网关信息。

Link copied to clipboard

Base sealed class for Gateway and GatewayWithShard.

Link copied to clipboard
@SerialName(value = "s")
data class GatewayWithShard(val url: String, val shards: Int, val sessionStartLimit: SessionStartLimit) : GatewayInfo

一个用于连接 websocket 的地址。同时返回建议的分片数,以及目前连接数使用情况。 GatewayApis.Shared 的响应体。

Link copied to clipboard
abstract class GetQQGuildApi<R : Any> : GetApiDefinition<R> , QQGuildApi<R>
Link copied to clipboard

消息被审核' 异常。 当推送、回复消息时响应的 code 错误码为 304023304024 时会在响应数据包 data 中返回 MessageAudit 审核消息的信息, 例如:

Link copied to clipboard
data class MessageAuditedId(val auditId: String)

推送、回复消息时响应的 '消息被审核' 数据信息。

Link copied to clipboard
abstract class PatchQQGuildApi<R : Any> : PutQQGuildApi<R> , QQGuildApi<R>
Link copied to clipboard
Link copied to clipboard
abstract class PutQQGuildApi<R : Any> : PutApiDefinition<R> , QQGuildApi<R>
Link copied to clipboard
interface QQGuildApi<out R : Any> : ApiDefinition<R>

表示为一个QQ频道的API。

Link copied to clipboard
Link copied to clipboard
data class SessionStartLimit(val total: Int, val remaining: Int, val resetAfter: Int, val maxConcurrency: Int)
Link copied to clipboard
abstract class SimpleApiDescription(method: HttpMethod, val path: String) : ApiDescription

ApiDescription 的基本抽象实现类,直接通过构造进行继承。

Link copied to clipboard

SimpleApiDescription 的基本抽象实现,method 提供为 HttpMethod.Delete

Link copied to clipboard

SimpleApiDescription 的基本抽象实现,method 提供为 GET

Link copied to clipboard

SimpleApiDescription 的基本抽象实现,method 提供为 HttpMethod.Patch

Link copied to clipboard

SimpleApiDescription 的基本抽象实现,method 提供为 POST

Link copied to clipboard

SimpleApiDescription 的基本抽象实现,method 提供为 HttpMethod.Put

Properties

Link copied to clipboard

用于在 QQGuildApi.request 及其衍生API中输出相关日志的 Logger。 开启 love.forte.simbot.qguild.apiDEBUG 级别日志可以得到更多在 API 请求过程中产生的信息。 注意:这可能会暴露其中的参数、返回值等,请注意保护敏感信息。

Link copied to clipboard

格式值:"BOT_APPID", 机器人 AppID

Functions

Link copied to clipboard

用于在Java中构建一个默认的 HttpClient

Link copied to clipboard
fun newJson(build: Consumer<JsonBuilder> = Consumer { it.apply { isLenient = true ignoreUnknownKeys = true } }): Json

用于在Java中构建一个 Json

Inherited functions

Link copied to clipboard

用于判断两个 ApiDescription 中的两个属性是否相同。

Link copied to clipboard
suspend fun <R : Any> QQGuildApi<R>.request(client: HttpClient, token: String? = null, server: Url? = null, appId: String? = null): HttpResponse

使用 client 向当前目标 API QQGuildApi 发起请求。

Link copied to clipboard
fun QQGuildApi<*>.requestAsync(client: HttpClient, token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, appId: String? = null): CompletableFuture<HttpResponse>
Link copied to clipboard
fun QQGuildApi<*>.requestBlocking(client: HttpClient, token: String?, server: Url = QQGuild.URL, appId: String? = null): HttpResponse
Link copied to clipboard
suspend fun <R : Any> QQGuildApi<R>.requestData(client: HttpClient, token: String?, server: Url? = QQGuild.URL, decoder: Json = QQGuild.DefaultJson, appId: String? = null): R

使用此api发起一次请求,并得到预期中的结果。

Link copied to clipboard
fun <R : Any> QQGuildApi<R>.requestDataAsync(client: HttpClient, token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, appId: String? = null): CompletableFuture<R>
Link copied to clipboard
fun <R : Any> QQGuildApi<R>.requestDataBlocking(client: HttpClient, token: String?, server: Url = QQGuild.URL, appId: String? = null): R
Link copied to clipboard
fun <R : Any> QQGuildApi<R>.requestDataReserve(client: HttpClient, token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, appId: String? = null): SuspendReserve<R>
Link copied to clipboard
fun QQGuildApi<*>.requestReserve(client: HttpClient, token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, appId: String? = null): SuspendReserve<HttpResponse>
Link copied to clipboard
inline suspend fun <R : Any> QQGuildApi<R>.requestText(client: HttpClient, token: String?, server: Url? = QQGuild.URL, appId: String? = null, useResp: (HttpResponse) -> Unit = {}): String

通过 request 得到响应,读取为文本并输出debug日志后返回。 不会进行校验。

Link copied to clipboard
fun QQGuildApi<*>.requestTextAsync(client: HttpClient, token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, appId: String? = null): CompletableFuture<String>
Link copied to clipboard
fun QQGuildApi<*>.requestTextBlocking(client: HttpClient, token: String?, server: Url = QQGuild.URL, appId: String? = null): String
Link copied to clipboard
fun QQGuildApi<*>.requestTextReserve(client: HttpClient, token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, appId: String? = null): SuspendReserve<String>