dingtalk-openclaw-connector

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DingTalk OpenClaw Connector Skill

钉钉OpenClaw连接器Skill

Skill by ara.so — Hermes Skills collection.
Official DingTalk channel plugin for OpenClaw, enabling AI agents to receive/send messages, manage documents, calendars, todos, and more within DingTalk enterprise workspace.
该Skill来自ara.so — Hermes Skills集合。
OpenClaw的官方钉钉渠道插件,让AI Agent能够在钉钉企业工作区内收发消息、管理文档、日历、待办事项等。

What It Does

功能介绍

This TypeScript connector bridges OpenClaw agents with DingTalk's ecosystem:
  • Messaging: Receive/send private/group messages, @mentions, rich media (text/Markdown/images)
  • Documents: Create, append, search, list DingTalk documents
  • DING Notifications: Send priority alerts to users/groups
  • Todos: Create personal todos, check status, set deadlines
  • AI Tables: Create tables, read/write rows, query data
  • Calendar: Manage calendars, events (CRUD + search), attendees, availability
  • Journal: Submit daily/weekly reports, query history
  • AI Cards: Streaming responses with typewriter effect, interactive buttons
  • Multi-Agent Routing: Connect multiple bots to different OpenClaw agents
  • Access Control: Flexible permission policies for private/group chats
这款TypeScript连接器打通了OpenClaw Agent与钉钉生态:
  • 消息功能:收发私聊/群聊消息、@提及、富媒体(文本/Markdown/图片)
  • 文档操作:创建、追加内容、搜索、列出钉钉文档
  • DING通知:向用户/群组发送优先级提醒
  • 待办事项:创建个人待办、查看状态、设置截止时间
  • AI表格:创建表格、读写行数据、查询信息
  • 日历管理:管理日历、事件(增删改查+搜索)、参会人员、空闲状态
  • 工作报告:提交日/周报、查询历史报告
  • AI卡片:带打字机效果的流式响应、交互式按钮
  • 多Agent路由:将多个机器人连接到不同的OpenClaw Agent
  • 访问控制:为私聊/群聊配置灵活的权限策略

Prerequisites

前置条件

  • OpenClaw ≥ 2026.4.9 (check:
    openclaw -v
    , upgrade:
    npm install -g openclaw
    )
  • Node.js (for installation)
  • DingTalk App (mobile, for QR authorization)
  • OpenClaw ≥ 2026.4.9(查看版本:
    openclaw -v
    ,升级:
    npm install -g openclaw
  • Node.js(用于安装)
  • 钉钉App(移动端,用于扫码授权)

Installation

安装步骤

Quick Install with Auto-Authorization

自动授权快速安装

bash
npx -y @dingtalk-real-ai/dingtalk-connector install
Scan the QR code displayed in terminal with DingTalk mobile app. After seeing "Success! Bot configured.", restart gateway:
bash
openclaw gateway restart
bash
npx -y @dingtalk-real-ai/dingtalk-connector install
使用钉钉移动端扫描终端显示的二维码。看到“Success! Bot configured.”提示后,重启网关:
bash
openclaw gateway restart

Manual Installation (if auto-auth fails)

手动安装(自动授权失败时使用)

bash
npm install -g @dingtalk-real-ai/dingtalk-connector
Then follow manual setup guide to configure credentials.
bash
npm install -g @dingtalk-real-ai/dingtalk-connector
然后按照手动设置指南配置凭证。

Configuration

配置说明

Plugin config is stored in OpenClaw's channel settings. Key environment variables:
bash
undefined
插件配置存储在OpenClaw的渠道设置中。关键环境变量:
bash
undefined

DingTalk bot credentials (obtained during authorization)

钉钉机器人凭证(授权时获取)

DINGTALK_CLIENT_ID=your_client_id DINGTALK_CLIENT_SECRET=your_client_secret DINGTALK_ROBOT_CODE=your_robot_code
DINGTALK_CLIENT_ID=your_client_id DINGTALK_CLIENT_SECRET=your_client_secret DINGTALK_ROBOT_CODE=your_robot_code

Optional: Multi-agent routing

可选:多Agent路由

DINGTALK_AGENT_MAPPING='{"bot_code_1":"agent_1","bot_code_2":"agent_2"}'
DINGTALK_AGENT_MAPPING='{"bot_code_1":"agent_1","bot_code_2":"agent_2"}'

Optional: Access control

可选:访问控制

DINGTALK_PRIVATE_CHAT_POLICY=whitelist # whitelist|blacklist|all DINGTALK_GROUP_CHAT_POLICY=all # whitelist|blacklist|all DINGTALK_WHITELIST=user_id_1,user_id_2
undefined
DINGTALK_PRIVATE_CHAT_POLICY=whitelist # whitelist|blacklist|all DINGTALK_GROUP_CHAT_POLICY=all # whitelist|blacklist|all DINGTALK_WHITELIST=user_id_1,user_id_2
undefined

Access Control Policies

访问控制策略

Configure who can interact with your bot:
typescript
// In OpenClaw channel config
{
  "privateChatPolicy": "whitelist",  // Only whitelisted users
  "groupChatPolicy": "all",          // All groups
  "whitelist": ["user_123", "user_456"],
  "blacklist": []
}
Options:
all
,
whitelist
,
blacklist
配置可与机器人交互的对象:
typescript
// 在OpenClaw渠道配置中
{
  "privateChatPolicy": "whitelist",  // 仅白名单用户可交互
  "groupChatPolicy": "all",          // 所有群组均可交互
  "whitelist": ["user_123", "user_456"],
  "blacklist": []
}
可选值:
all
whitelist
blacklist

Key Capabilities

核心能力

1. Message Handling

1. 消息处理

The connector automatically receives and routes DingTalk messages to your OpenClaw agent:
typescript
// Agent receives message context
interface MessageContext {
  conversationId: string;
  senderId: string;
  senderName: string;
  content: {
    text?: string;
    images?: Array<{ downloadCode: string; url: string }>;
    files?: Array<{ fileName: string; downloadCode: string }>;
  };
  isGroupChat: boolean;
  atUsers?: string[];
}
连接器会自动接收钉钉消息并路由到你的OpenClaw Agent:
typescript
// Agent接收的消息上下文
interface MessageContext {
  conversationId: string;
  senderId: string;
  senderName: string;
  content: {
    text?: string;
    images?: Array<{ downloadCode: string; url: string }>;
    files?: Array<{ fileName: string; downloadCode: string }>;
  };
  isGroupChat: boolean;
  atUsers?: string[];
}

2. Sending Messages

2. 发送消息

Text Message:
typescript
// Agent action
{
  "action": "sendMessage",
  "params": {
    "conversationId": "cid_xxx",
    "content": "Hello from OpenClaw!"
  }
}
Markdown with @mention:
typescript
{
  "action": "sendMessage",
  "params": {
    "conversationId": "cid_xxx",
    "content": "## Report\n@user_123 please review",
    "format": "markdown",
    "atUsers": ["user_123"]
  }
}
Image Message:
typescript
{
  "action": "sendMessage",
  "params": {
    "conversationId": "cid_xxx",
    "imageUrl": "https://example.com/image.png"
    // Or local path: "imagePath": "/path/to/image.png"
  }
}
文本消息:
typescript
// Agent动作
{
  "action": "sendMessage",
  "params": {
    "conversationId": "cid_xxx",
    "content": "Hello from OpenClaw!"
  }
}
带@提及的Markdown消息:
typescript
{
  "action": "sendMessage",
  "params": {
    "conversationId": "cid_xxx",
    "content": "## 报告\n@user_123 请查阅",
    "format": "markdown",
    "atUsers": ["user_123"]
  }
}
图片消息:
typescript
{
  "action": "sendMessage",
  "params": {
    "conversationId": "cid_xxx",
    "imageUrl": "https://example.com/image.png"
    // 或本地路径: "imagePath": "/path/to/image.png"
  }
}

3. AI Card Streaming

3. AI卡片流式响应

Show real-time thinking/generation progress:
typescript
// Enable in channel config
{
  "enableAICard": true,
  "streamingMode": "typewriter"  // typewriter effect
}
The connector automatically wraps agent responses in interactive cards with states:
  • 🤔 Thinking...
  • ✍️ Generating...
  • ✅ Complete
展示实时思考/生成进度:
typescript
// 在渠道配置中启用
{
  "enableAICard": true,
  "streamingMode": "typewriter"  // 打字机效果
}
连接器会自动将Agent响应包装为带状态的交互式卡片:
  • 🤔 思考中...
  • ✍️ 生成中...
  • ✅ 已完成

4. Document Operations

4. 文档操作

Create Document:
typescript
{
  "action": "createDocument",
  "params": {
    "title": "Meeting Notes",
    "content": "# Agenda\n- Item 1\n- Item 2",
    "spaceId": "space_xxx"  // optional
  }
}
Append to Document:
typescript
{
  "action": "appendDocument",
  "params": {
    "documentId": "doc_xxx",
    "content": "\n## New Section\nAdditional notes..."
  }
}
Search Documents:
typescript
{
  "action": "searchDocuments",
  "params": {
    "keyword": "meeting",
    "maxResults": 10
  }
}
创建文档:
typescript
{
  "action": "createDocument",
  "params": {
    "title": "会议纪要",
    "content": "# 议程\n- 事项1\n- 事项2",
    "spaceId": "space_xxx"  // 可选
  }
}
追加文档内容:
typescript
{
  "action": "appendDocument",
  "params": {
    "documentId": "doc_xxx",
    "content": "\n## 新章节\n补充说明..."
  }
}
搜索文档:
typescript
{
  "action": "searchDocuments",
  "params": {
    "keyword": "会议",
    "maxResults": 10
  }
}

5. DING Notifications

5. DING通知

Send high-priority alerts:
typescript
{
  "action": "sendDing",
  "params": {
    "receiverUserIds": ["user_123", "user_456"],
    "content": "Urgent: Server down!",
    "remindType": "DING_SMS"  // DING_NOTICE or DING_SMS
  }
}
发送高优先级提醒:
typescript
{
  "action": "sendDing",
  "params": {
    "receiverUserIds": ["user_123", "user_456"],
    "content": "紧急:服务器宕机!",
    "remindType": "DING_SMS"  // DING_NOTICE 或 DING_SMS
  }
}

6. Todo Management

6. 待办事项管理

Create Todo:
typescript
{
  "action": "createTodo",
  "params": {
    "subject": "Review PR #123",
    "description": "Check code quality",
    "dueTime": "2026-05-20T17:00:00Z",
    "executorIds": ["user_123"]
  }
}
Query Todos:
typescript
{
  "action": "getTodos",
  "params": {
    "status": "PENDING",  // PENDING|DONE
    "startDate": "2026-05-01",
    "endDate": "2026-05-31"
  }
}
创建待办:
typescript
{
  "action": "createTodo",
  "params": {
    "subject": "审核PR #123",
    "description": "检查代码质量",
    "dueTime": "2026-05-20T17:00:00Z",
    "executorIds": ["user_123"]
  }
}
查询待办:
typescript
{
  "action": "getTodos",
  "params": {
    "status": "PENDING",  // PENDING|DONE
    "startDate": "2026-05-01",
    "endDate": "2026-05-31"
  }
}

7. Calendar & Events

7. 日历与事件

Create Calendar Event:
typescript
{
  "action": "createCalendarEvent",
  "params": {
    "calendarId": "cal_xxx",
    "summary": "Team Sync",
    "startTime": "2026-05-20T14:00:00+08:00",
    "endTime": "2026-05-20T15:00:00+08:00",
    "location": "Conference Room A",
    "attendees": [
      { "userId": "user_123" },
      { "userId": "user_456" }
    ]
  }
}
Query Events:
typescript
{
  "action": "searchCalendarEvents",
  "params": {
    "calendarId": "cal_xxx",
    "startTime": "2026-05-20T00:00:00+08:00",
    "endTime": "2026-05-21T00:00:00+08:00"
  }
}
Check Availability:
typescript
{
  "action": "checkAvailability",
  "params": {
    "userIds": ["user_123", "user_456"],
    "startTime": "2026-05-20T14:00:00+08:00",
    "endTime": "2026-05-20T15:00:00+08:00"
  }
}
创建日历事件:
typescript
{
  "action": "createCalendarEvent",
  "params": {
    "calendarId": "cal_xxx",
    "summary": "团队同步会议",
    "startTime": "2026-05-20T14:00:00+08:00",
    "endTime": "2026-05-20T15:00:00+08:00",
    "location": "A会议室",
    "attendees": [
      { "userId": "user_123" },
      { "userId": "user_456" }
    ]
  }
}
查询事件:
typescript
{
  "action": "searchCalendarEvents",
  "params": {
    "calendarId": "cal_xxx",
    "startTime": "2026-05-20T00:00:00+08:00",
    "endTime": "2026-05-21T00:00:00+08:00"
  }
}
检查空闲状态:
typescript
{
  "action": "checkAvailability",
  "params": {
    "userIds": ["user_123", "user_456"],
    "startTime": "2026-05-20T14:00:00+08:00",
    "endTime": "2026-05-20T15:00:00+08:00"
  }
}

8. AI Tables

8. AI表格

Create Table:
typescript
{
  "action": "createAITable",
  "params": {
    "name": "Customer Database",
    "fields": [
      { "name": "Name", "type": "TEXT" },
      { "name": "Email", "type": "TEXT" },
      { "name": "Status", "type": "SINGLE_SELECT", "options": ["Active", "Inactive"] }
    ]
  }
}
Insert Row:
typescript
{
  "action": "insertTableRow",
  "params": {
    "tableId": "tbl_xxx",
    "fields": {
      "Name": "John Doe",
      "Email": "john@example.com",
      "Status": "Active"
    }
  }
}
Query Rows:
typescript
{
  "action": "queryTableRows",
  "params": {
    "tableId": "tbl_xxx",
    "filter": {
      "Status": "Active"
    },
    "maxResults": 50
  }
}
创建表格:
typescript
{
  "action": "createAITable",
  "params": {
    "name": "客户数据库",
    "fields": [
      { "name": "姓名", "type": "TEXT" },
      { "name": "邮箱", "type": "TEXT" },
      { "name": "状态", "type": "SINGLE_SELECT", "options": ["活跃", "非活跃"] }
    ]
  }
}
插入行数据:
typescript
{
  "action": "insertTableRow",
  "params": {
    "tableId": "tbl_xxx",
    "fields": {
      "姓名": "John Doe",
      "邮箱": "john@example.com",
      "状态": "活跃"
    }
  }
}
查询行数据:
typescript
{
  "action": "queryTableRows",
  "params": {
    "tableId": "tbl_xxx",
    "filter": {
      "状态": "活跃"
    },
    "maxResults": 50
  }
}

9. Journal (Reports)

9. 工作报告

Submit Daily Report:
typescript
{
  "action": "submitJournal",
  "params": {
    "type": "daily",
    "date": "2026-05-20",
    "content": "## Completed\n- Feature A\n- Bug fix B\n\n## Tomorrow\n- Feature C"
  }
}
Query Reports:
typescript
{
  "action": "getJournals",
  "params": {
    "type": "weekly",
    "startDate": "2026-05-01",
    "endDate": "2026-05-15"
  }
}
提交日报:
typescript
{
  "action": "submitJournal",
  "params": {
    "type": "daily",
    "date": "2026-05-20",
    "content": "## 已完成\n- 功能A开发\n- Bug B修复\n\n## 明日计划\n- 功能C开发"
  }
}
查询报告:
typescript
{
  "action": "getJournals",
  "params": {
    "type": "weekly",
    "startDate": "2026-05-01",
    "endDate": "2026-05-15"
  }
}

Multi-Agent Routing

多Agent路由

Connect multiple DingTalk bots to different OpenClaw agents for specialized tasks:
将多个钉钉机器人连接到不同的OpenClaw Agent,实现专业化任务处理:

Configuration

配置方式

bash
undefined
bash
undefined

In .env or OpenClaw config

在.env或OpenClaw配置中

DINGTALK_AGENT_MAPPING='{ "robot_code_hr": "hr_agent", "robot_code_it": "it_support_agent", "robot_code_sales": "sales_agent" }'
undefined
DINGTALK_AGENT_MAPPING='{ "robot_code_hr": "hr_agent", "robot_code_it": "it_support_agent", "robot_code_sales": "sales_agent" }'
undefined

Agent Definitions

Agent定义

yaml
undefined
yaml
undefined

openclaw.config.yaml

openclaw.config.yaml

agents: hr_agent: name: HR Assistant model: gpt-4 systemPrompt: You are an HR assistant handling employee queries
it_support_agent: name: IT Support model: gpt-4 systemPrompt: You provide IT technical support
sales_agent: name: Sales Helper model: gpt-4 systemPrompt: You assist with sales inquiries and CRM

Each bot routes to its designated agent automatically. See [Multi-Agent Setup Guide](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/blob/main/docs/MULTI_AGENT_SETUP.md).
agents: hr_agent: name: HR助手 model: gpt-4 systemPrompt: 你是一名HR助手,负责处理员工咨询
it_support_agent: name: IT支持 model: gpt-4 systemPrompt: 你提供IT技术支持服务
sales_agent: name:销售助手 model: gpt-4 systemPrompt:你协助处理销售咨询和CRM相关事务

每个机器人会自动路由到对应的Agent。详情请查看[多Agent设置指南](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/blob/main/docs/MULTI_AGENT_SETUP.md)。

Common Patterns

常见使用模式

Pattern 1: Auto-Reply Bot

模式1:自动回复机器人

typescript
// Agent receives all group messages where bot is @mentioned
// Auto-respond with context-aware answers
async function handleMessage(context: MessageContext) {
  const { content, isGroupChat, atUsers } = context;
  
  if (isGroupChat && !atUsers?.includes(botUserId)) {
    return; // Ignore if not @mentioned
  }
  
  const response = await generateResponse(content.text);
  
  return {
    action: "sendMessage",
    params: {
      conversationId: context.conversationId,
      content: response
    }
  };
}
typescript
// Agent接收所有@提及机器人的群消息
// 自动回复上下文相关的内容
async function handleMessage(context: MessageContext) {
  const { content, isGroupChat, atUsers } = context;
  
  if (isGroupChat && !atUsers?.includes(botUserId)) {
    return; // 未@提及则忽略
  }
  
  const response = await generateResponse(content.text);
  
  return {
    action: "sendMessage",
    params: {
      conversationId: context.conversationId,
      content: response
    }
  };
}

Pattern 2: Document Search Assistant

模式2:文档搜索助手

typescript
// Search docs and create summary
async function searchAndSummarize(query: string) {
  // 1. Search documents
  const docs = await executeAction({
    action: "searchDocuments",
    params: { keyword: query, maxResults: 5 }
  });
  
  // 2. Generate summary
  const summary = await summarize(docs);
  
  // 3. Create new doc with results
  return executeAction({
    action: "createDocument",
    params: {
      title: `Search Results: ${query}`,
      content: summary
    }
  });
}
typescript
// 搜索文档并生成摘要
async function searchAndSummarize(query: string) {
  // 1. 搜索文档
  const docs = await executeAction({
    action: "searchDocuments",
    params: { keyword: query, maxResults: 5 }
  });
  
  // 2. 生成摘要
  const summary = await summarize(docs);
  
  // 3. 创建包含结果的新文档
  return executeAction({
    action: "createDocument",
    params: {
      title: `搜索结果:${query}`,
      content: summary
    }
  });
}

Pattern 3: Meeting Scheduler

模式3:会议调度机器人

typescript
// Find available slot and create event
async function scheduleMeeting(attendeeIds: string[], duration: number) {
  const now = new Date();
  const nextWeek = new Date(now.getTime() + 7 * 24 * 60 * 60 * 1000);
  
  // 1. Check availability
  const availability = await executeAction({
    action: "checkAvailability",
    params: {
      userIds: attendeeIds,
      startTime: now.toISOString(),
      endTime: nextWeek.toISOString()
    }
  });
  
  // 2. Find first free slot
  const freeSlot = findFreeSlot(availability, duration);
  
  // 3. Create event
  return executeAction({
    action: "createCalendarEvent",
    params: {
      summary: "Team Meeting",
      startTime: freeSlot.start,
      endTime: freeSlot.end,
      attendees: attendeeIds.map(id => ({ userId: id }))
    }
  });
}
typescript
// 查找空闲时段并创建会议
async function scheduleMeeting(attendeeIds: string[], duration: number) {
  const now = new Date();
  const nextWeek = new Date(now.getTime() + 7 * 24 * 60 * 60 * 1000);
  
  // 1. 检查空闲状态
  const availability = await executeAction({
    action: "checkAvailability",
    params: {
      userIds: attendeeIds,
      startTime: now.toISOString(),
      endTime: nextWeek.toISOString()
    }
  });
  
  // 2. 找到第一个空闲时段
  const freeSlot = findFreeSlot(availability, duration);
  
  // 3. 创建会议事件
  return executeAction({
    action: "createCalendarEvent",
    params: {
      summary: "团队会议",
      startTime: freeSlot.start,
      endTime: freeSlot.end,
      attendees: attendeeIds.map(id => ({ userId: id }))
    }
  });
}

Pattern 4: Task Tracker Bot

模式4:任务跟踪机器人

typescript
// Create todo from message command
async function createTaskFromMessage(message: string, conversationId: string) {
  // Parse: "todo: Review PR #123 by Friday"
  const match = message.match(/todo:\s*(.+?)\s+by\s+(.+)/i);
  if (!match) return;
  
  const [, task, deadline] = match;
  
  // Create todo
  const todo = await executeAction({
    action: "createTodo",
    params: {
      subject: task,
      dueTime: parseDeadline(deadline)
    }
  });
  
  // Confirm in chat
  return executeAction({
    action: "sendMessage",
    params: {
      conversationId,
      content: `✅ Task created: ${task}\n📅 Due: ${deadline}`
    }
  });
}
typescript
// 从消息命令创建待办事项
async function createTaskFromMessage(message: string, conversationId: string) {
  // 解析格式:"todo: 周五前审核PR #123"
  const match = message.match(/todo:\s*(.+?)\s+by\s+(.+)/i);
  if (!match) return;
  
  const [, task, deadline] = match;
  
  // 创建待办
  const todo = await executeAction({
    action: "createTodo",
    params: {
      subject: task,
      dueTime: parseDeadline(deadline)
    }
  });
  
  // 在聊天中确认
  return executeAction({
    action: "sendMessage",
    params: {
      conversationId,
      content: `✅ 任务已创建:${task}\n📅 截止时间:${deadline}`
    }
  });
}

Troubleshooting

故障排查

Bot Not Responding

机器人无响应

  1. Check gateway status:
    bash
    openclaw gateway status
  2. Restart gateway:
    bash
    openclaw gateway restart
  3. Verify credentials:
    bash
    # Check if config exists
    openclaw config list
  4. Check logs:
    bash
    openclaw gateway logs
  1. 检查网关状态:
    bash
    openclaw gateway status
  2. 重启网关:
    bash
    openclaw gateway restart
  3. 验证凭证:
    bash
    # 检查配置是否存在
    openclaw config list
  4. 查看日志:
    bash
    openclaw gateway logs

Authorization Failed

授权失败

  • Ensure you're using DingTalk mobile app (not desktop) to scan QR
  • Check if QR code expired (timeout ~5 min), restart installation
  • Verify network access to DingTalk API endpoints
  • 确保使用钉钉移动端App扫码(而非桌面端)
  • 检查二维码是否过期(超时约5分钟),重新启动安装流程
  • 验证网络可访问钉钉API端点

Message Not Received

未收到消息

  • Confirm bot is in the conversation (group chat: must add bot; private: user initiated)
  • Check access control policies (whitelist/blacklist)
  • Verify bot has required permissions in DingTalk admin console
  • 确认机器人已加入会话(群聊:必须添加机器人;私聊:用户主动发起对话)
  • 检查访问控制策略(白名单/黑名单)
  • 验证机器人在钉钉管理后台拥有所需权限

Streaming AI Card Not Working

流式AI卡片不生效

typescript
// Ensure enabled in config
{
  "enableAICard": true,
  "streamingMode": "typewriter"
}
  • Feature requires OpenClaw ≥ 2026.4.9
  • Check browser console for WebSocket errors
typescript
// 确保在配置中启用
{
  "enableAICard": true,
  "streamingMode": "typewriter"
}
  • 该功能要求OpenClaw ≥ 2026.4.9
  • 检查浏览器控制台的WebSocket错误

Multi-Agent Routing Issues

多Agent路由异常

  • Verify
    DINGTALK_AGENT_MAPPING
    JSON syntax
  • Ensure agent names match those in
    openclaw.config.yaml
  • Check robot codes are correct (not client IDs)
  • 验证
    DINGTALK_AGENT_MAPPING
    的JSON语法
  • 确保Agent名称与
    openclaw.config.yaml
    中的定义一致
  • 检查机器人代码是否正确(不是客户端ID)

Image Upload Fails

图片上传失败

  • Ensure image file exists and is readable
  • Check file size (DingTalk limit: 20MB for images)
  • Verify image format (JPEG, PNG, GIF supported)
  • For URLs, ensure publicly accessible
  • 确保图片文件存在且可读取
  • 检查文件大小(钉钉图片限制:20MB)
  • 验证图片格式(支持JPEG、PNG、GIF)
  • 若使用URL,确保地址可公开访问

Calendar Events Not Creating

日历事件创建失败

  • Verify user has calendar permissions in DingTalk
  • Check time format (ISO 8601 with timezone)
  • Ensure
    calendarId
    is valid (create calendar first if needed)
  • 验证用户在钉钉中拥有日历权限
  • 检查时间格式(带时区的ISO 8601格式)
  • 确保
    calendarId
    有效(必要时先创建日历)

Common Error Codes

常见错误码

  • 40014
    : Invalid access token → Re-authorize bot
  • 60020
    : Permission denied → Check DingTalk app permissions
  • 90002
    : Message frequency limit → Rate limiting, slow down
  • 71006
    : Robot not in conversation → Add bot to group/chat
  • 40014
    :无效访问令牌 → 重新授权机器人
  • 60020
    :权限不足 → 检查钉钉应用权限
  • 90002
    :消息频率超限 → 降低发送频率
  • 71006
    :机器人未加入会话 → 将机器人添加到群聊/对话中

Testing

测试方法

Quick test after installation:
bash
undefined
安装完成后快速测试:
bash
undefined

Send test message to bot in DingTalk

在钉钉中向机器人发送测试消息

Expected: Bot responds with AI-generated reply in card format

预期:机器人以卡片格式回复AI生成的内容


**Verify specific features:**

```typescript
// Test document creation
// In DingTalk: @bot create a document titled "Test"

// Test todo
// In DingTalk: @bot remind me to review code tomorrow

// Test search
// In DingTalk: @bot search for meeting notes from last week

**验证特定功能:**

```typescript
// 测试文档创建
// 在钉钉中:@机器人 创建标题为"测试"的文档

// 测试待办事项
// 在钉钉中:@机器人 提醒我明天审核代码

// 测试搜索功能
// 在钉钉中:@机器人 搜索上周的会议纪要

Security Notes

安全说明

  • Model Risks: AI may hallucinate or execute unintended actions
  • Authorization Scope: Bot operates with user permissions granted during setup
  • Data Privacy: Follow company security policies if using corporate account
  • Default Protections: Do NOT disable default security configs without understanding risks
  • Recommended Use: Personal assistant, not production enterprise deployment
  • 模型风险:AI可能产生幻觉或执行意外操作
  • 授权范围:机器人使用设置时授予的用户权限运行
  • 数据隐私:若使用企业账号,请遵循公司安全政策
  • 默认保护:不要随意禁用默认安全配置,需先了解风险
  • 推荐场景:个人助手,不建议用于生产级企业部署

Additional Resources

额外资源