Connect the official QQ bot
Connect an official bot from the QQ Open Platform through webhooks and reply in private and group chats.
Besides signing in to a personal QQ account through OneBot, ShiritaiBot can connect to an official bot on the QQ Open Platform. An official bot doesn't need a QQ account of its own, but it does need an HTTPS domain reachable from the internet to receive callbacks.
Create the bot
- Create a bot on the QQ Open Platform and note its App ID and App Secret.
- In the ShiritaiBot WebUI, open Settings → Channels, click Add a bot, choose Official QQ bot, enter the App ID and App Secret, then enable and save.
Set the callback address
In the platform's event subscription and callback settings, enter the callback path shown on the channel's page, with your public HTTPS domain in front. For an instance with the ID qq-official:
https://bot.example.com/api/adapters/qq-official/qq-official/callbackThen:
- Forward that path to ShiritaiBot with a reverse proxy.
- Add the domain to the allowed hosts when starting ShiritaiBot, for example
shiritaibot run --allowed-host bot.example.com. - Subscribe to
C2C_MESSAGE_CREATE(private chats) andGROUP_AT_MESSAGE_CREATE(group messages that @ the bot). If the platform has opened regular group messages for your app, you can also subscribe toGROUP_MESSAGE_CREATE. - If the platform asks for an IP allowlist, enter the outbound IP of the server running ShiritaiBot.
Allowlist and owner
The official QQ API identifies private chat users, groups and group members by OpenID. Add the groups and users you allow to the channel's allowlist.
To find an OpenID, send a test message from that account or group, then switch to the Debug level in Monitor → Logs to see the OpenID of the chat that isn't set up yet.
Only the owner's private chat gets owner permissions; group chats follow the group's chat permissions. See Permissions.
Current limits
- Text messages in private and group chats, with passive replies. A reply is tied to the message it answers, within the platform's time and count limits.
- Incoming attachments show as placeholders in the text.
- Channels, media upload and proactive pushes aren't supported yet.
References: Event subscription, signature verification, messaging overview.