QQ Bot
QQ Bot adapter for Chat SDK. Connects to the QQ Bot Gateway over WebSocket or HTTP callback, supporting DM, group, and text-channel scenes with images, video, voice, and files.
Install
pnpm add @agentor/chat-qq chat @chat-adapter/state-memoryQuick start
QQ bots receive events in one of two modes. WebSocket mode is the default; set
mode: "callback" to use webhooks.
WebSocket mode
The adapter connects directly to the QQ Bot Gateway, so you don't need a public endpoint:
Webhook (callback) mode
The adapter receives events over HTTP and verifies their Ed25519 signatures. The two modes are mutually exclusive: once you configure an HTTPS callback URL on the bot, WebSocket mode is no longer available.
Configuration
| Prop | Type | Default | Description |
|---|---|---|---|
mode? | "websocket" | "callback" | "websocket" | Connection mode. The two modes are mutually exclusive. |
appId? | string | QQ Bot application ID. | |
clientSecret? | string | QQ Bot client secret. | |
intents? | number | Event intent bitmask. | |
sandbox? | boolean | false | Use the sandbox environment (WebSocket mode). |
userName? | string | "QQ Bot" | Bot display name. |
Environment variables
| Variable | Required | Description |
|---|---|---|
QQ_BOT_APP_ID | Yes | QQ Bot application ID. |
QQ_BOT_CLIENT_SECRET | Yes | QQ Bot client secret. |
Rich media
postMessage uploads local files (FileUpload) and URL attachments, then
sends them as rich-media messages. Scenarios that don't support rich media fall
back to text.
Scenes
The adapter supports four QQ scenes: QQ DM (C2C), QQ Group, Text Channel, and
Channel DM. File upload in group chats is not currently available. Text
channels and channel DMs send images and videos via msg_type: 7.
Feature support
Messaging
| Feature | Supported |
|---|---|
| Post message | |
| Message replies | |
| Edit message | |
| Delete message | |
| File uploads | |
| Streaming | |
| Scheduled messages |
Rich content
| Feature | Supported |
|---|---|
| Card format | |
| Buttons | |
| Link buttons | |
| Select menus | |
| Tables | |
| Charts | |
| Fields | |
| Images in cards | |
| Modals |
Conversations
| Feature | Supported |
|---|---|
| Slash commands | |
| Mentions | |
| Add reactions | |
| Remove reactions | |
| Typing indicator | |
| Mark as read | |
| Message edit events | |
| Message delete events | |
| DMs | |
| Ephemeral messages | |
| User lookup | |
| Parent subject | |
| Native client | |
| Custom API endpoint |
Message history
| Feature | Supported |
|---|---|
| Fetch messages | |
| Fetch single message | |
| Fetch thread info | |
| Fetch channel messages | |
| List threads | |
| Fetch channel info | |
| Post channel message |