KookBotConfiguration

KookBot 需要使用的配置类。

配置类不应在bot构建完成之后再做修改。

Author

ForteScarlet

Constructors

Link copied to clipboard

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class TimeoutConfiguration(var connectTimeoutMillis: Long? = null, var requestTimeoutMillis: Long? = null, var socketTimeoutMillis: Long? = null)

api请求的统一超时时间配置。

Functions

Link copied to clipboard

禁用事件的异步调度。即 set isEventProcessAsync = false

Link copied to clipboard

禁用超时配置。

Link copied to clipboard
fun httpClientConfig(block: HttpClientConfig<*>.() -> Unit)

配置bot内部要使用的httpclient。

Link copied to clipboard
fun preEventProcessor(block: suspend (bot: KookBot, sessionId: String) -> Unit)

在执行 KookBot.start 建立连接成功后、进行事件处理之前执行此函数。

Properties

Link copied to clipboard
var clientEngine: HttpClientEngine? = null

配置bot内部要使用的client Engine。

Link copied to clipboard
var clientEngineFactory: HttpClientEngineFactory<*>? = null

配置bot内部要使用的client Engine factory。

Link copied to clipboard

api请求的连接超时时间。

Link copied to clipboard

为bot提供一个 CoroutineContext. 如果其中存在 kotlinx.coroutines.Job, 则会作为parent job。

Link copied to clipboard
var decoder: Json

Bot用于解析api请求或其他用途的解析器。

Link copied to clipboard
var httpClientConfig: HttpClientConfig<*>.() -> Unit

配置bot内部要使用的httpclient。

Link copied to clipboard
var isCompress: Boolean = true

设置bot进行连接的时候使用要使用压缩数据。

Link copied to clipboard

在进行事件处理时是否进行异步处理(使用 launch { ... } 调度)。

Link copied to clipboard
var preEventProcessor: suspend (bot: KookBot, sessionId: String) -> Unit

在执行 KookBot.start 建立连接成功后、进行事件处理之前执行此函数。

Link copied to clipboard

api请求的请求超时时间。

Link copied to clipboard

api请求的请求超时时间。

Link copied to clipboard

api请求的超时配置。 如果为null则不会在 httpClient 中安装 io.ktor.client.plugins.HttpTimeout

Link copied to clipboard

ws连接超时时间。默认为 DEFAULT_WS_CONNECT_TIMEOUT.

Extensions

Link copied to clipboard