docs/usage/channels/qq.mdx
By connecting a QQ channel to your LobeHub agent, users can interact with the AI assistant through QQ group chats, guild channels, and direct messages.
LobeHub supports two connection modes for QQ bots:
Note: On the QQ Open Platform, once a bot is configured with a Webhook callback URL, it cannot be switched to WebSocket mode. New bots that have not configured a callback URL should use WebSocket mode.
Visit q.qq.com and sign in with your QQ account.
In the QQ Open Platform dashboard, click Create Bot. Fill in the bot name, description, and avatar.
After the application is created, go to Development Settings and copy:
Important: Keep your App Secret confidential. Never share it publicly.
If you are using Webhook mode, navigate to Development Settings → Callback Configuration in the QQ Open Platform. You will need to paste the LobeHub Callback URL here after completing Step 2.
If you are using WebSocket mode (default), skip this step — no callback URL is needed. </Steps>
In LobeHub, navigate to your agent's settings, then select the Channels tab. Click QQ from the platform list.
Fill in the following fields:
In Advanced Settings, choose the Connection Mode:
Click Save Configuration. Your credentials will be encrypted and stored securely.
</Steps>
<Steps> ### Paste the Callback URLSkip this step if you are using WebSocket mode.
Go back to the QQ Open Platform, navigate to Development Settings → Callback Configuration. Paste the Callback URL you copied from LobeHub.
Subscribe to the message events your bot needs. Common events include:
GROUP_AT_MESSAGE_CREATE — Triggered when the bot is @mentioned in a groupC2C_MESSAGE_CREATE — Triggered when the bot receives a private messageAT_MESSAGE_CREATE — Triggered when the bot is @mentioned in a guild channelDIRECT_MESSAGE_CREATE — Triggered for direct messages in a guildThe QQ Open Platform will send a verification request to your Callback URL. LobeHub handles this automatically using Ed25519 signature verification. </Steps>
In the QQ Open Platform, go to Version Management and create a new version. Submit the bot for review.
QQ will review your bot. Once approved, the bot will be published and ready to use. For sandbox testing, you can add test users directly without publishing.
</Steps>
Click Test Connection in LobeHub's channel settings to verify the integration. Then open QQ, find your bot, and send a message. The bot should respond through your LobeHub agent.
One optional field under Advanced Settings carries a lot of weight in day-to-day use — fill it in once and most surprises go away.
This is your own QQ tiny_id (the platform-level user identifier — not the public-facing QQ number, which doesn't always match), used by:
/approve <code> is the owner's command and the runtime checks the sender against this ID.To get it: DM the bot once with any message and check the server logs for the tiny_id field on the inbound event payload (or read it from the OpenAPI dashboard if available). Paste the long numeric ID into Your Platform User ID in LobeHub's Advanced Settings.
QQ doesn't expose a single "default server" concept that AI tools can pivot on, so the Default Server field is not exposed for QQ channels.
To use the bot in QQ groups:
Two independent policies gate inbound traffic. Both default to Open.
A populated Allowed User IDs field is a global gate — DMs and group @mentions are restricted to listed QQ tiny_id values. Empty means "no user-level filter". Use the platform tiny_id from the OpenAPI event payload — the visible QQ number is not always the same as the platform ID.
Open only when the list is empty: Allowlist then fails closed (no DMs).Allowlist, but a non-listed sender receives a one-time pairing code instead of a flat rejection. Approve via /approve <code> and the applicant is auto-appended to Allowed User IDs. Requires Your Platform User ID to be set (the runtime checks the /approve sender against it) and a configured Redis backend.@mentions.Controls which QQ groups the bot will respond in.
@mentions in any group the bot has been added to.See the Channels overview for cross-platform details.
| Field | Required | Description |
|---|---|---|
| Application ID | Yes | Your bot's App ID from QQ Open Platform |
| App Secret | Yes | Your bot's App Secret from QQ Open Platform |
| Connection Mode | No | websocket (default) or webhook. Choose based on your QQ Open Platform configuration |
| Allowed User IDs | No | Comma- or whitespace-separated QQ tiny_id values. Global gate — applies to DMs and group @mentions |
| DM Policy | No | open (default), allowlist, pairing, or disabled — who is allowed to DM the bot |
| Group Policy | No | open (default), allowlist, or disabled — where the bot responds to @mentions |
| Allowed Channel IDs | No | Comma- or whitespace-separated QQ group IDs. Used when Group Policy is Allowlist |