Expand description
QQ Official Bot platform adapter.
Implements robit_chatbot::PlatformAdapter for the QQ Official Bot API:
- Access token: obtained via the OAuth2
getAppAccessTokenendpoint (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 convertsC2C_MESSAGE_CREATE/GROUP_AT_MESSAGE_CREATEevents intoPlatformEvent::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]. - QqPlatform
Adapter - QQ Official Bot platform adapter.