QQ Bot β AI in QQ
QQ Bot β AI in QQ β easy-to-understand guide based on official docs
Imagine your favorite group chat suddenly has a super-smart friend who can answer questions, summarize voice messages, and even send formatted replies β thatβs exactly what Hermes Agent brings to QQ.
What Is This?
Hermes Agent is an open-source framework that lets you connect AI assistants to messaging platforms. The QQ Bot adapter is the bridge between Hermes and QQβs official bot API. It listens for messages (private chats, group @-mentions, guild channels) and responds automatically β no coding required beyond setup.
How It Works (in Plain Terms)
Think of it like setting up a new phone:
- Get a bot identity β You register your bot at q.qq.com and receive an App ID and App Secret (like a username and password for your bot).
- Connect the wires β Hermes opens a persistent WebSocket connection to QQβs gateway, so it hears messages instantly.
- Teach it to listen β You decide which conversations it can join: private DMs, group mentions, or guild channels.
- Let it talk back β When someone sends a message, Hermes processes it and replies with text or rich markdown.
Step-by-Step Setup
1. Install the dependencies
pip install aiohttp httpx
2. Configure your bot (easiest way)
hermes gateway setup
Select QQ Bot and follow the prompts. It will ask for your App ID and Secret.
3. Manual configuration (if you prefer)
Create or edit ~/.hermes/.env:
QQ_APP_ID=your-app-id
QQ_CLIENT_SECRET=your-app-secret
Thatβs the minimum. For more control, edit ~/.hermes/config.yaml:
platforms:
qqbot:
enabled: true
extra:
markdown_support: true
dm_policy: "open" # open | allowlist | disabled
group_policy: "open"
Cool Feature: Voice Messages
QQ gives you free transcription (Tencentβs ASR) for every voice message. If that fails, Hermes can fall back to a custom STT provider like GLM-ASR or OpenAI Whisper. This means your bot can βhearβ voice notes and reply with text summaries.
Security Settings You Should Know
QQ_ALLOWED_USERSβ restrict DMs to specific OpenIDs (default: everyone)QQ_GROUP_ALLOWED_USERSβ restrict group access to specific group OpenIDsdm_policy/group_policyβ set to"allowlist"for strict control, or"disabled"to turn off that channel entirely
Summary & Practical Tip
Connecting Hermes to QQ is like giving your group chat a personal assistant β it takes about 10 minutes of setup, and then you can customize everything from who can talk to it, to whether it supports markdown or voice transcription.
My tip for beginners: Start in sandbox mode (set QQ_PORTAL_HOST=sandbox.q.qq.com). Test with your own account first, then gradually open it up to friends. And always set QQ_ALLOWED_USERS to your own OpenID before going public β you donβt want strangers chatting with your bot on day one.
Once itβs live, try asking your bot to summarize a long voice message or format a quick announcement β thatβs where the magic really shows.
π Official Docs
This article is based on the official Hermes Agent documentation:Official docs βΊ user-guide/messaging/qqbot