- A DingTalk account with admin access to your organization
- Access to DingTalk Open Platform
- Go to DingTalk Open Platform
- Log in with your DingTalk admin account
- Click "Create App" (创建应用)
- Choose "Enterprise Internal App" (企业内部开发)
- Fill in the app name (e.g., "MatClaw") and description
- In the app settings, go to "Add Capability" (添加能力)
- Select "Robot" (机器人)
- In Robot configuration:
- Set message receiving mode to "Stream Mode" (Stream 模式)
- This uses WebSocket — no public URL or webhook endpoint needed
- Go to "Credentials & Basic Info" (凭证与基本信息)
- Copy the Client ID (AppKey / 应用标识)
- Copy the Client Secret (AppSecret / 应用密钥)
Go to "Permissions" (权限管理) and grant:
| Permission | Description |
|---|---|
qyapi_robot_sendmsg |
Send robot messages |
qyapi_chat_manage |
Manage group chats |
- Go to "Release" (版本管理与发布)
- Click "Create Release" (创建版本)
- Set visibility scope (which departments/users can use the bot)
- Submit for release
- Open a DingTalk group chat
- Click the group settings icon (top right)
- Go to "Robot" (智能群助手 / 机器人)
- Click "Add Robot" (添加机器人)
- Find your app's robot and add it
npm run auth:dingtalkEnter the Client ID and Client Secret when prompted.
- Start MatClaw:
npm run dev - In the DingTalk group, send:
@MatClaw hello - The bot should respond automatically
| Value | Format | Where to Find |
|---|---|---|
| Client ID (AppKey) | ding... or alphanumeric |
App credentials page |
| Client Secret (AppSecret) | Long alphanumeric string | App credentials page |
Start MatClaw and send a message to the bot — the chat is auto-registered as a group. No manual database setup needed.
- Group chat: Add the bot to a group, then prefix messages with
@MatClaw - 1-on-1 chat: Any message triggers a response, no
@needed
Stream connection failed?
- Verify Stream Mode is enabled (not HTTP mode)
- Check that the app has been published
- Ensure the Client ID and Client Secret are correct
Bot added but not responding?
- The bot only responds when @mentioned in group chats
- In 1-on-1 chats, any message triggers a response
- Check MatClaw logs:
tail -f logs/matclaw.log | grep -i dingtalk
Permission denied errors?
- Ensure
qyapi_robot_sendmsgpermission is granted - After adding permissions, you may need to re-publish the app
- The visibility scope must include the users/groups trying to use the bot