moltbot-dingtalk-stream
v1.0.9
Published
DingTalk custom channel plugin for Moltbot/Clawdbot
Maintainers
Readme
DingTalk Channel for Clawdbot
A Clawdbot channel plugin for DingTalk (钉钉) using Stream Mode for seamless integration.
Features
- 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)
Installation
Option 1: From npm (recommended)
clawdbot plugins install moltbot-dingtalk-streamOption 2: Manual installation
git clone https://github.com/your-repo/moltbot-dingtalk-stream.git
cd moltbot-dingtalk-stream
npm install && npm run build
cp -r . ~/.clawdbot/extensions/moltbot-dingtalk-stream
clawdbot gateway restartConfiguration
Configure in your ~/.clawdbot/clawdbot.json:
{
"channels": {
"moltbot-dingtalk-stream": {
"enabled": true,
"clientId": "YOUR_APP_KEY",
"clientSecret": "YOUR_APP_SECRET"
}
}
}Or use environment variables:
export DINGTALK_CLIENT_ID="YOUR_APP_KEY"
export DINGTALK_CLIENT_SECRET="YOUR_APP_SECRET"Multi-Account Setup
{
"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
- Go to DingTalk Developer Console
- Create an Enterprise Internal Application
- Add Robot capability
- Enable Stream Mode (消息接收模式 → Stream模式)
- Copy the AppKey (as
clientId) and AppSecret (asclientSecret) - Publish and deploy the application
Proactive Messaging (CLI)
Send messages to DingTalk conversations using the Clawdbot CLI:
# Send to a specific conversation
clawdbot send --channel moltbot-dingtalk-stream --to <conversationId> "Hello from CLI"
# The conversationId can be found in logs when a message is receivedTroubleshooting
| 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 |
Debug Logs
clawdbot logs --followLook for [default] DingTalk Stream client connected to confirm connection.
Architecture
┌─────────────────┐ WebSocket ┌──────────────────┐
│ DingTalk API │ ◄─────────────────► │ Clawdbot Plugin │
│ (Stream Mode) │ │ (This Plugin) │
└─────────────────┘ └──────────────────┘
│
▼
┌──────────────────┐
│ Clawdbot Agent │
│ (AI Processing) │
└──────────────────┘License
MIT
Changelog
See CHANGELOG.md for release history.
