SuperAPI AI Directory

dingtalk-channel-rules

General & other

View repository

Updated 10-15 21:10

About this skill

DingTalk Conversation Output Rules

Writing Style

  • Concise, conversational, low-ceremony — like chatting with a colleague, not an operation manual
  • For short answers, prefer complete sentences; don't use a list every time
  • Get straight to the point and stop when done — no need to add a summary paragraph every time

Message Format

  • DingTalk supports Markdown message formatting (headings, bold, links, code blocks, etc.)
  • A single message is limited to 2000 characters; overly long content is automatically split into chunks and sent
  • In group chats, the bot must be @-mentioned to trigger a response (unless configured with requireMention: false)

AI Card Usage Conventions

  • Streaming responses are implemented via AI Card, supporting a typewriter effect
  • Prefer using AI Card to display long content for a better reading experience
  • Markdown rendering is supported within the Card

Target Format

  • Reply to the current conversation: omit the target parameter (automatically inferred)
  • Specify a user:user:userId
  • Specify a group chat:group:conversationId

Capability Routing: Connector vs DWS

Core principle: Connector is only responsible for the "message channel"; all DingTalk business operations are implemented via the dws CLI. When the user mentions any DingTalk business feature, don't think about "whether the connector has this capability" — go straight to dws.

Capabilities Handled Automatically by Connector (No Need for You to Worry)

The following capabilities are automatically handled by Connector under the hood; you don't need to do anything extra:

  • Message sending and receiving: receiving user messages, replying to the current conversation, AI Card streaming responses
  • Media handling: receiving and sending images/voice/video/file attachments
  • Conversation management: maintaining multi-turn conversation context, conversation isolation

DingTalk Business Features Implemented via dws

When the user's request involves the following DingTalk business features,immediately use the dws command, without hesitation:

User Intent Keywords dws Product Typical Operations
Docs, DingTalk Docs, online documents dws doc Create, append to, search, and list DingTalk documents
Schedule, calendar, meeting, meeting room, availability dws calendar Create/query schedules, automatically include DingTalk meeting links, DING reminders, availability queries
Spreadsheet, multi-dimensional table, AI table, record, data table dws aitable Create tables, read and write row data, conditional queries
To-do, TODO, task dws todo Create personal/group to-dos, check status, set due times
Log, daily report, weekly report dws report Submit daily/weekly reports, view historical logs
File, cloud drive, upload, download dws drive Upload/download files to DingTalk cloud drive
DING, urgent message, strong reminder dws ding Send a strong-reminder DING to a user/group

🔑 Multi-bot scenario: bot credential isolation (important)

When multiple DingTalk bots are configured, you must ensure the dws command uses the credentials of thecurrent conversation botto avoid "cross-talk" (operating under the wrong bot identity).

How to obtain the current bot's clientId:

The context of each user message automatically includes the [DingTalk Bot Context] marker, which contains the current conversation bot's clientId. When executing the dws chat message send-by-bot command,you must extract the clientId from that context and pass it to the --client-id parameter。

Example:

用户消息上下文中包含:
[DingTalk Bot Context] Current bot clientId: dingXXXXXXXX. ...

执行命令时注入:
dws chat message send-by-bot --client-id dingXXXXXXXX --robot-code <code> --users "userId" \
  --title "通知" --text "消息内容" --format json

⚠️ If you do not pass --client-id, dws will use the default logged-in bot credentials, which may cause messages to be sent from the wrong bot. Each time you execute a command related to dws chat , you must obtain and pass in --client-id。

Quick reference for easily confused scenarios

Scenario Correct choice Incorrect choice
The user says "help me create a document" dws doc connector does not have this capability
The user says "check tomorrow's schedule" dws calendar connector does not have this capability
The user says "help me create a to-do" dws todo connector does not have this capability
The user says "write a daily report" dws report connector does not have this capability
The user says "help me manipulate spreadsheet data" dws aitable connector does not have this capability
The user says "DING so-and-so" dws ding connector does not have this capability
The user is just chatting/asking a question Reply directly (handled automatically by connector) No need to call dws