DingTalk custom channel plugin for Moltbot/OpenClaw
npm install moltbot-dingtalk-streamAn OpenClaw channel plugin for DingTalk (钉钉) using Stream Mode for seamless integration.
- Stream Mode: Uses WebSocket for real-time message receiving (no public IP required)
- Zero Configuration: No webhook setup, ngrok, or firewall configuration needed
- Single/Group Chat: Supports both direct messages and group mentions
- Easy Setup: Just configure your DingTalk app credentials
- Media Support: Send images via markdown format
- Auto Chunking: Automatically splits long messages (2000 char limit)
bash
openclaw plugins install moltbot-dingtalk-stream
`$3
`bash
git clone https://github.com/your-repo/moltbot-dingtalk-stream.git
cd moltbot-dingtalk-stream
npm install
optional: typecheck only (no JS build)
npm run typecheck
cp -r . ~/.openclaw/extensions/moltbot-dingtalk-stream
openclaw gateway restart
`Configuration
Configure in your
~/.openclaw/openclaw.json:`json
{
"channels": {
"moltbot-dingtalk-stream": {
"enabled": true,
"clientId": "YOUR_APP_KEY",
"clientSecret": "YOUR_APP_SECRET"
}
}
}
`Or use environment variables:
`bash
export DINGTALK_CLIENT_ID="YOUR_APP_KEY"
export DINGTALK_CLIENT_SECRET="YOUR_APP_SECRET"
`$3
`json
{
"channels": {
"moltbot-dingtalk-stream": {
"enabled": true,
"accounts": {
"default": {
"enabled": true,
"clientId": "APP_KEY_1",
"clientSecret": "APP_SECRET_1"
},
"work": {
"enabled": true,
"clientId": "APP_KEY_2",
"clientSecret": "APP_SECRET_2"
}
}
}
}
}
`DingTalk App Setup
1. Go to DingTalk Developer Console
2. Create an Enterprise Internal Application
3. Add Robot capability
4. Enable Stream Mode (消息接收模式 → Stream模式)
5. Copy the AppKey (as
clientId) and AppSecret (as clientSecret)
6. Publish and deploy the applicationProactive Messaging (CLI)
Send messages to DingTalk conversations using the OpenClaw CLI:
`bash
Send to a specific conversation
openclaw send --channel moltbot-dingtalk-stream --to "Hello from CLI"The conversationId can be found in logs when a message is received
`Troubleshooting
| Issue | Solution |
|-------|----------|
| No messages received | Check if Stream Mode is enabled in DingTalk app settings |
| Connection failed | Verify
clientId and clientSecret are correct |
| Reply not sent | Ensure the bot has been messaged first (webhook is per-session) |
| Permission denied | Check app permissions in DingTalk Developer Console |$3
`bash
openclaw logs --follow
`Look for
[default] DingTalk Stream client connected to confirm connection.Architecture
`
┌─────────────────┐ WebSocket ┌──────────────────┐
│ DingTalk API │ ◄─────────────────► │ OpenClaw Plugin │
│ (Stream Mode) │ │ (This Plugin) │
└─────────────────┘ └──────────────────┘
│
▼
┌──────────────────┐
│ OpenClaw Agent │
│ (AI Processing) │
└──────────────────┘
``MIT
See CHANGELOG.md for release history.