Features
- ✅ WebSocket connection (no public IP required)
- ✅ botpy SDK integration
- ✅ Private message support
- ✅ Open ID-based access control
- ✅ Sandbox environment for testing
Prerequisites
- QQ account registered as a developer
- QQ mobile app for testing
Setup
Register as QQ developer
- Visit QQ Open Platform
- Click Register (注册)
- Choose Personal or Enterprise developer type
- Complete verification process
Create a bot application
- In QQ Open Platform, click Create Application (创建应用)
- Choose Bot (机器人) type
- Fill in bot name and description
- Submit for review
Get credentials
- Go to Developer Settings (开发设置)
- Copy:
- AppID — Your application ID
- AppSecret — Your application secret
Set up sandbox for testing
- In bot management console, find Sandbox Config (沙箱配置)
- Under Message List Config (在消息列表配置), click Add Member (添加成员)
- Add your own QQ number
- Once added, scan the bot’s QR code with mobile QQ
- Open bot profile → tap Send Message (发消息) to start chatting
Find your Open ID
- Send a message to the bot from QQ
- Check nanobot logs — it will display your Open ID
- Copy the Open ID and add it to
allowFromin config - Restart gateway
["*"] to allow all users (not recommended for production).Configuration Options
Enable the QQ channel
App ID from QQ Open Platform
App Secret from QQ Open Platform
List of QQ Open IDs allowed to interact with the botExamples:
- Single user:
["11A2B3C4D5E6F7G8H9I0J"] - Multiple users:
["11A2B3C4D5E6F7G8H9I0J", "22K3L4M5N6O7P8Q9R0S1T"] - All users:
["*"](not recommended for production)
Find Open IDs in nanobot logs when users message the bot
Sandbox vs Production
Understanding sandbox and production modes
Understanding sandbox and production modes
Sandbox Mode (Testing)
- For development and testing only
- Limited to pre-configured QQ numbers
- Immediate access without review
- Add members in Sandbox Config
- Use this to test your bot before publishing
Production Mode (Public)
- Available to all QQ users (after approval)
- Requires submission and review
- May take several days for approval
- See QQ Bot Docs for publishing flow
- Complete bot development and testing
- Submit bot for review in console
- Wait for approval
- Once approved, bot is publicly available
Limitations
Troubleshooting
Bot doesn't respond
Bot doesn't respond
- Check sandbox config: Verify your QQ number is added to sandbox
- Check Open ID: Ensure your Open ID is in
allowFrom - Check credentials: Verify AppID and AppSecret are correct
- Check bot status: Ensure bot is active in QQ Open Platform
- Check logs: Run
nanobot gateway -vfor detailed logs
WebSocket connection fails
WebSocket connection fails
- Verify AppID and AppSecret are correct
- Check internet connectivity
- Ensure no firewall blocks WebSocket connections
- Try restarting gateway:
nanobot gateway - Check QQ Open Platform status
Cannot message bot in QQ
Cannot message bot in QQ
If you can’t find or message the bot:
- Verify your QQ number is added to Sandbox Config
- Scan the bot’s QR code with mobile QQ (not desktop)
- Open bot profile page
- Tap 发消息 (Send Message) button
- If still not working, wait a few minutes and try again
Cannot find Open ID
Cannot find Open ID
To get your Open ID:
- Temporarily set
allowFrom: ["*"] - Restart gateway
- Send a message to the bot
- Check logs — Open ID will be displayed
- Copy the Open ID and add it to
allowFrom - Remove
"*"and restart gateway
Authentication errors
Authentication errors
If you see “authentication failed” errors:
- Go to QQ Open Platform → Your App → Developer Settings
- Verify AppID and AppSecret are correct
- If credentials changed, update config.json
- Restart gateway after updating
Complete Example
Full configuration with all options:Publishing to Production
How to publish your bot
How to publish your bot
Once testing is complete:For detailed publishing requirements, see QQ Bot Docs.
Submit for review
- Go to bot console in QQ Open Platform
- Click Submit for Review (提交审核)
- Fill in required information
- Upload any required materials
Wait for approval
- Review typically takes 3-7 business days
- Check review status in console
- You may be asked for additional information
Related Pages
Configuration Overview
Learn about channel configuration
Security Settings
Set up access control