Package-level declarations

Types

Link copied to clipboard
data class CanSendImageResult @ApiResultConstructor constructor(val yes: Boolean)

CanSendImageApi 的响应体。

Link copied to clipboard
data class CanSendRecordResult @ApiResultConstructor constructor(val yes: Boolean)

CanSendRecordApi 的响应体。

Link copied to clipboard
Link copied to clipboard
data class GetCookiesResult @ApiResultConstructor constructor(val cookies: String)

GetCookiesApi 的响应体。

Link copied to clipboard
data class GetCredentialsResult @ApiResultConstructor constructor(val cookies: String, val csrfToken: Int)

GetCredentialsApi 的响应体。

Link copied to clipboard
data class GetCsrfTokenResult @ApiResultConstructor constructor(val token: Int)

GetCsrfTokenApi 的响应体。

Link copied to clipboard
class GetForwardMsgResult @ApiResultConstructor constructor(messageInternal: List<OneBotForwardNode>? = null, messagesInternal: List<OneBotForwardNode>? = null)

GetForwardMsgApi 的响应体。

Link copied to clipboard
data class GetFriendListResult @ApiResultConstructor constructor(val userId: LongID, val nickname: String, val remark: String)

GetFriendListApi 的响应体。

Link copied to clipboard
data class GetGroupHonorInfoResult @ApiResultConstructor constructor(val groupId: LongID, val currentTalkative: GetGroupHonorInfoResult.CurrentTalkative? = null, val talkativeList: List<GetGroupHonorInfoResult.HonorInfo>? = null, val performerList: List<GetGroupHonorInfoResult.HonorInfo>? = null, val legendList: List<GetGroupHonorInfoResult.HonorInfo>? = null, val strongNewbieList: List<GetGroupHonorInfoResult.HonorInfo>? = null, val emotionList: List<GetGroupHonorInfoResult.HonorInfo>? = null)

GetGroupHonorInfoApi 的响应体。

Link copied to clipboard
data class GetGroupInfoResult @ApiResultConstructor constructor(val groupId: LongID, val groupName: String, val memberCount: Int, val maxMemberCount: Int)

GetGroupInfoApi 的响应体。

Link copied to clipboard
data class GetGroupMemberInfoResult @ApiResultConstructor constructor(val groupId: LongID, val userId: LongID, val nickname: String, val card: String = "", val sex: String = "unknown", val age: Int = -1, val area: String = "", val joinTime: Int = -1, val lastSentTime: Int = -1, val level: String = "", val role: String = "member", val unfriendly: Boolean = false, val title: String = "", val titleExpireTime: Int = -1, val cardChangeable: Boolean = false)

GetGroupMemberInfoApi 的响应体。

Link copied to clipboard
data class GetImageResult @ApiResultConstructor constructor(val file: String)

GetImageApi 的响应体。

Link copied to clipboard
data class GetLoginInfoResult @ApiResultConstructor constructor(val userId: LongID, val nickname: String)

GetLoginInfoApi 的响应体。

Link copied to clipboard
Link copied to clipboard
data class GetMsgResult @ApiResultConstructor constructor(val time: Int, val messageType: String, val messageId: IntID, val realId: IntID, val sender: JsonObject, val message: List<OneBotMessageSegment> = emptyList())

GetMsgApi 的响应体。

Link copied to clipboard
data class GetRecordResult @ApiResultConstructor constructor(val file: String)

GetRecordApi 的响应体。

Link copied to clipboard
data class GetStrangerInfoResult @ApiResultConstructor constructor(val userId: LongID, val nickname: String, val sex: String, val age: Int)

GetStrangerInfoApi 的响应体。

Link copied to clipboard
data class GetVersionInfoResult @ApiResultConstructor constructor(val appName: String, val appVersion: String, val protocolVersion: String)

GetVersionInfoApi 的响应体。

Link copied to clipboard
Link copied to clipboard
interface OneBotApi<T : Any>

一个 OneBot 的 API

Link copied to clipboard

与 OneBot 的 Api 相关的异常。

Link copied to clipboard

可以用于执行 OneBotApi 的执行器接口描述。

Link copied to clipboard

OneBotApiExecutable 的基础上提供更多作用域API, 允许在 Kotlin 中使用DSL的风格请求API。

Link copied to clipboard
open class OneBotApiResponseNotSuccessException(val status: HttpStatusCode, message: String? = "status: ", cause: Throwable? = null) : OneBotApiException

OneBotApi 请求的响应结果状态码不是成功状态 (即不是2xx)

Link copied to clipboard
data class OneBotApiResult<T : Any>(val retcode: Int, val status: String? = null, val data: T? = null)
Link copied to clipboard

代表一个用于OneBot API中作为 message 发送的消息内容。 它是一个仅用于序列化的类型。

Link copied to clipboard

OneBotMessageOutgoing 的序列化器实现。 仅保证序列化,反序列化很可能会产生异常,且尽可能避免使用。

Link copied to clipboard
Link copied to clipboard
data class SendMsgResult @ApiResultConstructor constructor(val messageId: IntID)

SendMsgApi 的响应体。

Properties

Link copied to clipboard

用于在对 OneBotApi 发起请求时或得到想用后输出相关日志日志收集器。

Functions

Link copied to clipboard
inline fun <T> withExecutableScope(executable: OneBotApiExecutable, action: OneBotApiExecutableScope.() -> T): T

OneBotApiExecutableScope 的作用域下执行 action

Inherited functions

Link copied to clipboard

OneBotApiExecutableScope 的作用域下执行 action

Link copied to clipboard
suspend fun OneBotApi<*>.request(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null): HttpResponse
suspend fun OneBotApi<*>.request(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null): HttpResponse

this 发起一次请求,并得到相应的 HttpResponse 响应。

Link copied to clipboard
fun OneBotApi<*>.requestAsync(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, scope: CoroutineScope? = null): CompletableFuture<out HttpResponse>
fun OneBotApi<*>.requestAsync(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, scope: CoroutineScope? = null): CompletableFuture<out HttpResponse>

异步地请求 OneBotApi.

Link copied to clipboard
fun OneBotApi<*>.requestBlocking(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null): HttpResponse
fun OneBotApi<*>.requestBlocking(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null): HttpResponse

阻塞地请求 OneBotApi.

Link copied to clipboard
suspend fun <T : Any> OneBotApi<T>.requestData(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, decoder: Json = OneBot11.DefaultJson): T

this 发起一次请求,并得到响应体的 T 类型结果。

suspend fun <T : Any> OneBotApi<T>.requestData(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, decoder: Json = OneBot11.DefaultJson): T

this 发起一次请求,并得到响应体的 T 结果。

Link copied to clipboard
fun <T : Any> OneBotApi<T>.requestDataAsync(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, scope: CoroutineScope? = null, decoder: Json = OneBot11.DefaultJson): CompletableFuture<out T>
fun <T : Any> OneBotApi<T>.requestDataAsync(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, scope: CoroutineScope? = null, decoder: Json = OneBot11.DefaultJson): CompletableFuture<out T>

异步地请求 OneBotApi.

Link copied to clipboard
fun <T : Any> OneBotApi<T>.requestDataBlocking(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, decoder: Json = OneBot11.DefaultJson): T
fun <T : Any> OneBotApi<T>.requestDataBlocking(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, decoder: Json = OneBot11.DefaultJson): T

阻塞地请求 OneBotApi.

Link copied to clipboard
fun <T : Any> OneBotApi<T>.requestDataReserve(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, scope: CoroutineScope? = null, decoder: Json = OneBot11.DefaultJson): SuspendReserve<T>
fun <T : Any> OneBotApi<T>.requestDataReserve(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, scope: CoroutineScope? = null, decoder: Json = OneBot11.DefaultJson): SuspendReserve<T>

异步地请求 OneBotApi.

Link copied to clipboard
suspend fun OneBotApi<*>.requestRaw(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8): String
suspend fun OneBotApi<*>.requestRaw(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8): String

this 发起一次请求,并得到响应体的字符串内容。

Link copied to clipboard
fun OneBotApi<*>.requestRawAsync(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, scope: CoroutineScope? = null): CompletableFuture<out String>
fun OneBotApi<*>.requestRawAsync(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, scope: CoroutineScope? = null): CompletableFuture<out String>

异步地请求 OneBotApi.

Link copied to clipboard
fun OneBotApi<*>.requestRawBlocking(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8): String
fun OneBotApi<*>.requestRawBlocking(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8): String

阻塞地请求 OneBotApi.

Link copied to clipboard
fun OneBotApi<*>.requestRawReserve(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, scope: CoroutineScope? = null): SuspendReserve<String>
fun OneBotApi<*>.requestRawReserve(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, scope: CoroutineScope? = null): SuspendReserve<String>

异步地请求 OneBotApi.

Link copied to clipboard
fun OneBotApi<*>.requestReserve(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, scope: CoroutineScope? = null): SuspendReserve<HttpResponse>
fun OneBotApi<*>.requestReserve(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, scope: CoroutineScope? = null): SuspendReserve<HttpResponse>

异步地请求 OneBotApi.

Link copied to clipboard
suspend fun <T : Any> OneBotApi<T>.requestResult(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, decoder: Json = OneBot11.DefaultJson): OneBotApiResult<T>
suspend fun <T : Any> OneBotApi<T>.requestResult(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, decoder: Json = OneBot11.DefaultJson): OneBotApiResult<T>

this 发起一次请求,并得到响应体的 OneBotApiResult 结果。

Link copied to clipboard
fun <T : Any> OneBotApi<T>.requestResultAsync(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, scope: CoroutineScope? = null, decoder: Json = OneBot11.DefaultJson): CompletableFuture<out OneBotApiResult<T>>
fun <T : Any> OneBotApi<T>.requestResultAsync(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, scope: CoroutineScope? = null, decoder: Json = OneBot11.DefaultJson): CompletableFuture<out OneBotApiResult<T>>

异步地请求 OneBotApi.

Link copied to clipboard
fun <T : Any> OneBotApi<T>.requestResultBlocking(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, decoder: Json = OneBot11.DefaultJson): OneBotApiResult<T>
fun <T : Any> OneBotApi<T>.requestResultBlocking(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, decoder: Json = OneBot11.DefaultJson): OneBotApiResult<T>

阻塞地请求 OneBotApi.

Link copied to clipboard
fun <T : Any> OneBotApi<T>.requestResultReserve(client: HttpClient, host: Url, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, scope: CoroutineScope? = null, decoder: Json = OneBot11.DefaultJson): SuspendReserve<OneBotApiResult<T>>
fun <T : Any> OneBotApi<T>.requestResultReserve(client: HttpClient, host: String, accessToken: String? = null, actionSuffixes: Collection<String>? = null, charset: Charset = Charsets.UTF_8, scope: CoroutineScope? = null, decoder: Json = OneBot11.DefaultJson): SuspendReserve<OneBotApiResult<T>>

异步地请求 OneBotApi.