Skip to main content

Module protocol

Module protocol 

Source
Expand description

QQ Official Bot WebSocket gateway protocol types (opcodes, payloads).

The QQ Bot gateway is Discord-like: a WebSocket connection exchanging JSON GatewayPayload frames keyed by op (opcode). The client identifies, heartbeats, and receives op=0 dispatch events (C2C_MESSAGE_CREATE, GROUP_AT_MESSAGE_CREATE, etc.). Message sending is done over HTTP.

Reference: QQ Official Bot API (https://bot.q.qq.com).

Modules§

event_type
Dispatch event type strings (the t field of an op=0 payload).
file_type
File type constants for the upload API.
msg_type
Message type for the send-message HTTP API.
op
Gateway opcode values.

Structs§

AccessTokenRequest
Request body for the getAppAccessToken endpoint.
AccessTokenResponse
Response body for the getAppAccessToken endpoint.
Author
GatewayPayload
Top-level gateway payload, exchanged over the WebSocket connection.
HelloData
d payload of the Hello (op=10) event.
MediaFileInfo
Media file info for sending media messages (msg_type=7).
MessageEvent
Common fields of an incoming message event (C2C_MESSAGE_CREATE, GROUP_AT_MESSAGE_CREATE).
QqAttachment
An attachment in a QQ message event (image, file, etc.).
SendMessageRequest
Request body for POSTing a message to a group or user.
SendMessageResponse
Response body for the send-message HTTP API.
UploadMediaRequest
Request body for uploading a file to QQ. Uses JSON body (not multipart). Either url (public URL for QQ to download) or file_data (base64-encoded binary) must be provided.
UploadMediaResponse
Response body for the upload media API.

Constants§

INTENT_C2C
Intent for C2C (private) messages.
INTENT_GROUP_AT_MESSAGE
Intent for group @-mention messages.