website/docs/user-guide/messaging/qqbot.md
Connect Hermes to QQ via the Official QQ Bot API (v2) — supporting private (C2C), group @-mentions, guild, and direct messages with voice transcription.
The QQ Bot adapter uses the Official QQ Bot API to:
QQ Bot Application — Register at q.qq.com:
Dependencies — The adapter requires aiohttp and httpx:
pip install aiohttp httpx
hermes gateway setup
Select QQ Bot from the platform list and follow the prompts.
Set the required environment variables in ~/.hermes/.env:
QQ_APP_ID=your-app-id
QQ_CLIENT_SECRET=your-app-secret
| Variable | Description | Default |
|---|---|---|
QQ_APP_ID | QQ Bot App ID (required) | — |
QQ_CLIENT_SECRET | QQ Bot App Secret (required) | — |
QQBOT_HOME_CHANNEL | OpenID for cron/notification delivery | — |
QQBOT_HOME_CHANNEL_NAME | Display name for home channel | Home |
QQ_ALLOWED_USERS | Comma-separated user OpenIDs for DM access | open (all users) |
QQ_GROUP_ALLOWED_USERS | Comma-separated group OpenIDs for group access | — |
QQ_ALLOW_ALL_USERS | Set to true to allow all DMs | false |
QQ_PORTAL_HOST | Override the QQ portal host (set to sandbox.q.qq.com for sandbox routing) | q.qq.com |
QQ_STT_API_KEY | API key for voice-to-text provider | — |
QQ_STT_BASE_URL | (Not read directly — set platforms.qqbot.extra.stt.baseUrl in config.yaml instead) | n/a |
QQ_STT_MODEL | STT model name | glm-asr |
For fine-grained control, add platform settings to ~/.hermes/config.yaml:
platforms:
qqbot:
enabled: true
extra:
app_id: "your-app-id"
client_secret: "your-secret"
markdown_support: true # enable QQ markdown (msg_type 2). Config-only; no env-var equivalent.
dm_policy: "open" # open | allowlist | disabled
allow_from:
- "user_openid_1"
group_policy: "open" # open | allowlist | disabled
group_allow_from:
- "group_openid_1"
stt:
provider: "zai" # zai (GLM-ASR), openai (Whisper), etc.
baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4"
apiKey: "your-stt-key"
model: "glm-asr"
Voice transcription works in two stages:
QQ built-in ASR (free, always tried first) — QQ provides asr_refer_text in voice message attachments, which uses Tencent's own speech recognition
Configured STT provider (fallback) — If QQ's ASR doesn't return text, the adapter calls an OpenAI-compatible STT API:
glm-asr modelQQ_STT_BASE_URL and QQ_STT_MODELThis usually means:
asr_refer_text is present in the attachment dataQQ_STT_API_KEY is set correctlyQQ_ALLOWED_USERS if DM access is restrictedQQBOT_HOME_CHANNEL for cron/notification deliveryaiohttp and httpx are installed: pip install aiohttp httpxapi.sgroup.qq.com and the WebSocket gateway