agentscope-extensions-channel-dingtalk connects your Agent to DingTalk (钉钉) using the Stream protocol — a persistent WebSocket that receives bot messages in real time without exposing a public webhook endpoint.
When to use
- Your Agent needs to respond to DingTalk bot messages (DM and group @-mentions).
- You prefer a WebSocket-based push model over polling or webhook callbacks.
Add the dependency
Prerequisites
- Create an Enterprise Internal App in the DingTalk Developer Console.
- Enable the Bot capability and subscribe to the bot-messages topic.
- Note down the App Key, App Secret, and Robot Code.
Quickstart
Configuration properties
Message flow
Inbound: TheDingTalkStreamClient opens a WebSocket to the DingTalk gateway, receives bot-message callbacks, ACKs each frame, then dispatches through DingTalkInboundMapper → idempotency check → bot-loop guard → Gateway.
Outbound: Replies are sent via DingTalkOutboundClient using the OpenAPI batchSend endpoints — oToMessages/batchSend for DMs and groupMessages/send for groups. Text and Markdown formats are auto-detected.