بوت QQ
QQ Bot
ما هذه الصفحة، وماذا تحتوي.
بوابة المراسلة: الوصلة التي تجعلك تكلّم Hermes من تطبيق تستعمله أصلًا، مثل Telegram أو WhatsApp، بدل الطرفية. الوكيل الذي تصله من هاتفك تستعمله فعلًا. الذي يحتاج فتح الحاسوب تنساه بعد أسبوع. ستستعمل هنا hermes gateway setup، والقراءة نحو 3 دقائق. انتبه: افتح القناة لنفسك فقط في البداية عبر قائمة سماح. القناة المفتوحة تعني أن أي شخص يراسل وكيلك.
نتائج مأخوذة من هذه الصفحة، لا من قالب.
- تعرف ما بوابة المراسلة ولماذا قد تحتاجه.
- تنفّذ
hermes gateway setupوتفهم ما يحدث بعدها. - تقرأ الجدول وتأخذ منه السطر الذي يخصّك فقط.
- تضبط
QQBOT_HOME_CHANNELفي المكان الصحيح.
كما تظهر تمامًا داخل Hermes.
hermes gateway setup
QQBOT_HOME_CHANNEL
انتقل مباشرة إلى ما تحتاجه.
بلا اختصار أو حذف.
النص أدناه منقول من المصدر الرسمي بالإنجليزية حتى تبقى الأوامر والأسماء دقيقة كما هي. قبل كل قسم شرح عربي يوضّح ما بداخله.
Connect Hermes to QQ via the Official QQ Bot API (v2) — supporting private (C2C), group @-mentions, guild, and direct messages with voice transcription.
Overview
شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه. تذكير: الوصلة التي تجعلك تكلّم Hermes من تطبيق تستعمله أصلًا، مثل Telegram أو WhatsApp، بدل الطرفية.
The QQ Bot adapter uses the Official QQ Bot API ↗ to:
- Receive messages via a persistent WebSocket connection to the QQ Gateway
- Send text and markdown replies via the REST API
- Download and process images, voice messages, and file attachments
- Transcribe voice messages using Tencent's built-in ASR or a configurable STT provider
Prerequisites
شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.
- QQ Bot Application — Register at q.qq.com ↗:
- Create a new application and note your App ID and App Secret
- Enable the required intents: C2C messages, Group @-messages, Guild messages
- Configure your bot in sandbox mode for testing, or publish for production
- Dependencies — The adapter requires
aiohttpandhttpx:
pip install aiohttp httpxConfiguration
أوامر تكتبها في الطرفية. افهم ما يفعله الأمر قبل نسخه. الأوامر هنا: hermes gateway setup.
Interactive setup
hermes gateway setupSelect QQ Bot from the platform list and follow the prompts.
Manual configuration
Set the required environment variables in ~/.hermes/.env:
QQ_APP_ID=your-app-id
QQ_CLIENT_SECRET=your-app-secretEnvironment Variables
جدول مرجعي. لا تقرأه كله، ابحث عن السطر الذي يخصّك فقط.
| 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 |
Advanced Configuration
إعدادات تضبطها مرة وتنساها. غيّر واحدًا في كل مرة حتى تعرف أثر كل تغيير.
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 Messages (STT)
شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.
Voice transcription works in two stages:
- QQ built-in ASR (free, always tried first) — QQ provides
asr_refer_textin 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:
- Zhipu/GLM (zai): Default provider, uses
glm-asrmodel - OpenAI Whisper: Set
QQ_STT_BASE_URLandQQ_STT_MODEL - Any OpenAI-compatible STT endpoint
Troubleshooting
قسم لحل المشكلات. ابحث فيه عن العطل الذي يشبه حالتك بدل قراءته كاملًا.
Bot disconnects immediately (quick disconnect)
This usually means:
- Invalid App ID / Secret — Double-check your credentials at q.qq.com
- Missing permissions — Ensure the bot has the required intents enabled
- Sandbox-only bot — If the bot is in sandbox mode, it can only receive messages from QQ's sandbox test channel
Voice messages not transcribed
- Check if QQ's built-in
asr_refer_textis present in the attachment data - If using a custom STT provider, verify
QQ_STT_API_KEYis set correctly - Check gateway logs for STT error messages
Messages not delivered
- Verify the bot's intents are enabled at q.qq.com
- Check
QQ_ALLOWED_USERSif DM access is restricted - For group messages, ensure the bot is @mentioned (group policy may require allowlisting)
- Check
QQBOT_HOME_CHANNELfor cron/notification delivery
Connection errors
- Ensure
aiohttpandhttpxare installed:pip install aiohttp httpx - Check network connectivity to
api.sgroup.qq.comand the WebSocket gateway - Review gateway logs for detailed error messages and reconnect behavior
4 أسئلة إجاباتها كلها في هذه الصفحة.
كل خيار اسم حقيقي من توثيق Hermes. حتى الخيارات الخاطئة حقيقية، لكنها من صفحات أخرى.