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.
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).@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, 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 |