OneBotTransport

interface OneBotTransport

Low-level transport contract for OneBot action and event exchange.

Properties

Link copied to clipboard
open val incomingEvents: Flow<JsonObject>

Incoming raw event payloads from the transport channel.

Link copied to clipboard
open val isStarted: Boolean

Whether the transport has started its underlying connections/servers.

Functions

Link copied to clipboard
open suspend fun close()

Closes transport resources.

Link copied to clipboard
abstract suspend fun postAction(action: String, params: JsonObject = JsonObject(emptyMap())): JsonObject

Sends an action with JSON params and returns raw JSON response payload.

Link copied to clipboard
open suspend fun start()

Starts transport background resources (WS loop / reverse server) if needed.

Link copied to clipboard
open suspend fun stop()

Stops transport background resources but keeps the instance reusable when supported.