Connect DotCraft to QQ
Connect a QQ account to DotCraft through NapCat or another OneBot v11 gateway.
CAUTION
Third-party QQ protocol frameworks can create account risk. Use a dedicated QQ account and review the risk before deployment.
Quick setup
- Open the target workspace in DotCraft Desktop.
- Open Channels, then select QQ.
- Set the OneBot listen address. The default is
127.0.0.1:6700. - Enter an access token if NapCat should authenticate to the DotCraft endpoint.
- Add at least one admin user, allowed user, or allowed group.
- Save the channel and turn it on.
- In NapCat WebUI, add a reverse WebSocket connection to
ws://127.0.0.1:6700/. - Set the NapCat message format to
array.
Desktop should show the QQ channel as connected after NapCat reaches the DotCraft listener.
Platform setup details
In NapCat, configure the QQ account that will speak for DotCraft:
- Log in with the dedicated QQ account.
- Open the OneBot / WebSocket client settings.
- Set the reverse WebSocket URL to the DotCraft listen address.
- Set the Token to the same value you entered in Desktop.
- Set message format to
array.
If NapCat runs in Docker or on another machine, replace 127.0.0.1 with an address that can reach the machine running DotCraft Desktop.
Test the connection
- Send a private message to the QQ account from an allowed user.
- In a group, @mention the bot account.
- Confirm DotCraft replies in the same QQ conversation.
- Ask DotCraft to do something that needs approval, then reply with
同意,允许,yes, orapprove.
What works after setup
- Private chats keep a separate DotCraft conversation per QQ user.
- A QQ group shares one conversation, with the actual sender recorded on each message.
- Group messages require an @mention by default.
- Empty admin and allowlist settings mean the bot ignores QQ messages.
- Approval replies accept
同意,允许,yes,approve,拒绝,no,reject, anddeny. - Voice, video, and file delivery are available through channel delivery tools.
- Voice and video tools use
filePathfor local files,fileUrlfor HTTP(S) URLs, andfileBase64for raw base64 payloads. Thefileargument accepts only URL andbase64://sources; usefilePathfor local paths so DotCraft can request file-read approval. - For local voice, video, and file uploads, DotCraft reads the file before sending it to NapCat. Docker deployments do not need to mount the workspace into the NapCat container.
Standalone adapter
Run the QQ adapter yourself only when Desktop is not managing the channel process.
cd sdk/typescript
npm run build --workspace @dotcraft/channel-qq
npx dotcraft-channel-qq --workspace /path/to/workspaceUse --config /custom/qq.json when the adapter config is not stored at .craft/qq.json.
Register the channel as a standalone WebSocket adapter in the shared channel configuration reference.
Reference
See Channel configuration reference for the QQ JSON example, ExternalChannels registration, and field table.