Connect QQ via QQ Official Bot (Websockets)
Supported Basic Message Types
Version v4.15.0.
| Message Type | Receive | Send | Notes |
|---|---|---|---|
| Text | Yes | Yes | |
| Image | Yes | Yes | |
| Voice | No | No | |
| Video | No | No | |
| File | No | No |
Proactive message push: Not supported.
Apply for a Bot
WARNING
- QQ Official Bot currently requires an IP whitelist.
- It supports group chat, private chat, channel chat, and channel private chat.
- Tencent is phasing out Websockets access, so this method is no longer recommended. Please use Webhook instead.
Open QQ Official Bot and sign in.
Create a bot, fill in name/description/avatar, then submit for review. After security verification passes, creation is complete.
Open the created bot to enter its management page:

Allow Bot in Channel / Group / Private Chat
Open Sandbox Configuration to set a sandbox channel / QQ group / QQ private chat (up to 20 members).
Then configure QQ groups, private chat QQ accounts, and QQ channels as needed.

Get appid and secret
After adding the bot where you need it, open Development -> Development Settings, then copy appid and secret.
Add IP Whitelist
Open Development -> Development Settings, find IP whitelist, and add your server IP.

TIP
If you do not know your server IP, run curl ifconfig.me or check ip138.com.
In NAT environments without a public IP, the observed IP may change depending on your carrier. Use proxy/tunnel if needed.
Configure in AstrBot
- Open AstrBot Dashboard.
- Click
Botsin the left sidebar. - Click
+ Create Bot. - Select
qq_official.
Fill in:
- ID (
id): any unique identifier. - Enable (
enable): checked. appid: from QQ Official Bot platform.secret: from QQ Official Bot platform.
Click Save.
Done
AstrBot should now be connected. Send /help to the bot in QQ private chat to verify.
