Skip to main content

Module platform

Module platform 

Source
Expand description

QQ Official Bot platform adapter.

Implements robit_chatbot::PlatformAdapter for the QQ Official Bot API:

  • Access token: obtained via the OAuth2 getAppAccessToken endpoint (app_id + app_secret), refreshed before expiry, and used for both the WebSocket Identify and HTTP message sends.
  • WebSocket gateway: connects, sends Identify (op=2), then runs a heartbeat task and a dispatch task. Dispatch converts C2C_MESSAGE_CREATE / GROUP_AT_MESSAGE_CREATE events into PlatformEvent::Message.
  • HTTP send: POSTs text to the group or user messages endpoint.

chat_id encoding: "group:{group_openid}" for group chats, "private:{user_openid}" for C2C chats.

Structsยง

QqConfig
QQ Bot configuration parsed from [channels.qq_bot].
QqPlatformAdapter
QQ Official Bot platform adapter.