OneBotV11Client

interface OneBotV11Client

Core OneBot V11 client abstraction.

Inheritors

Properties

Link copied to clipboard
abstract val events: Flow<OneBotV11Event>

Stream of typed OneBot V11 events decoded from transport incoming payloads.

Link copied to clipboard
abstract val isStarted: Boolean

Whether underlying transport lifecycle has started.

Functions

Link copied to clipboard
abstract suspend fun <T> call(action: String, params: JsonObject, serializer: KSerializer<T>): ApiResponse<T>

Calls a OneBot action and decodes the data field with serializer.

Link copied to clipboard
abstract suspend fun close()

Releases transport resources.

Link copied to clipboard
abstract suspend fun deleteMessage(messageId: Long): ApiResponse<JsonObject>

Calls delete_msg.

Link copied to clipboard
abstract suspend fun getLoginInfo(): ApiResponse<LoginInfo>

Calls get_login_info.

Link copied to clipboard
fun OneBotV11Client.listenEventsAnnotated(listener: Any, scope: CoroutineScope, onHandlerError: (Throwable, OneBotV11Event) -> Unit = { error, _ -> throw error }): Job

Subscribes to OneBotV11Client.events and dispatches each event to methods annotated with Event.

Link copied to clipboard

Calls send_group_msg.

Link copied to clipboard

Calls send_private_msg.

Link copied to clipboard
abstract suspend fun start()

Starts lifecycle-managed transport resources.

Link copied to clipboard
abstract suspend fun stop()

Stops lifecycle-managed transport resources.

Link copied to clipboard

Creates a OneBotV11Api wrapper from an existing OneBotV11Client.