docs/users/features/channels/dingtalk.md
This guide covers setting up a Qwen Code channel on DingTalk (钉钉).
DingTalk Stream mode uses an outbound WebSocket connection — no public URL or server is needed. The bot connects to DingTalk's servers, which push messages through the WebSocket. This is the simplest deployment model.
Add the channel to ~/.qwen/settings.json:
{
"channels": {
"my-dingtalk": {
"type": "dingtalk",
"clientId": "$DINGTALK_CLIENT_ID",
"clientSecret": "$DINGTALK_CLIENT_SECRET",
"senderPolicy": "open",
"sessionScope": "user",
"cwd": "/path/to/your/project",
"instructions": "You are a concise coding assistant responding via DingTalk.",
"groupPolicy": "open",
"groups": {
"*": { "requireMention": true }
}
}
}
}
Set the credentials as environment variables:
export DINGTALK_CLIENT_ID=<your-app-key>
export DINGTALK_CLIENT_SECRET=<your-app-secret>
Or define them in the env section of settings.json:
{
"env": {
"DINGTALK_CLIENT_ID": "your-app-key",
"DINGTALK_CLIENT_SECRET": "your-app-secret"
}
}
# Start only the DingTalk channel
qwen channel start my-dingtalk
# Or start all configured channels together
qwen channel start
Open DingTalk and send a message to the bot. You should see a 👀 emoji reaction appear while the agent processes, followed by the response.
DingTalk bots work in both DM and group conversations. To enable group support:
groupPolicy to "allowlist" or "open" in your channel configBy default, the bot requires an @mention in group chats (requireMention: true). Set "requireMention": false for a specific group to make it respond to all messages. See Group Chats for full details.
DingTalk uses conversationId to identify groups. You can find it in the channel service logs when someone sends a message in the group — look for the conversationId field in the log output.
You can send photos and documents to the bot, not just text.
Photos: Send an image (screenshot, diagram, etc.) and the agent will analyze it using its vision capabilities. This requires a multimodal model — add "model": "qwen3.5-plus" (or another vision-capable model) to your channel config. DingTalk supports sending images directly or as part of rich text messages (mixed text + images).
Files: Send a PDF, code file, or any document. The bot downloads it from DingTalk's servers and saves it locally so the agent can read it with its file tools. Audio and video files are also supported. This works with any model.
downloadCode from the message is exchanged for a temporary download URL via DingTalk's API.isInAtList for @mention detection instead of parsing message entities.senderPolicy: "open" may be acceptable. For tighter control, use "allowlist" or "pairing". See DM Pairing for details.qwen channel startgroupPolicy is set to "allowlist" or "open" (default is "disabled")This means DingTalk didn't include a reply endpoint in the message callback. This can happen if the bot's permissions are misconfigured. Check the bot's settings in the Developer Portal.
This usually means the agent encountered an error. Check the terminal output for details.