@yaoyuanchao/dingtalk 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/monitor.ts +5 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaoyuanchao/dingtalk",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "description": "DingTalk channel plugin for Clawdbot with Stream Mode support",
6
6
  "license": "MIT",
package/src/monitor.ts CHANGED
@@ -221,6 +221,9 @@ async function extractRichTextContent(
221
221
  for (const item of content.richText) {
222
222
  if (item.msgType === "text" && item.content) {
223
223
  parts.push(item.content);
224
+ } else if (item.text) {
225
+ // DingTalk sometimes sends richText items as {text: "..."} without msgType wrapper
226
+ parts.push(item.text);
224
227
  } else if ((item.msgType === "picture" || item.pictureDownloadCode || item.downloadCode) && (item.downloadCode || item.pictureDownloadCode)) {
225
228
  const downloadCode = item.downloadCode || item.pictureDownloadCode;
226
229
  try {
@@ -425,8 +428,8 @@ async function processInboundMessage(
425
428
 
426
429
  if (userIds.length > 0 && account.clientId && account.clientSecret) {
427
430
  try {
428
- // Batch query user info with 500ms timeout
429
- const userInfoMap = await batchGetUserInfo(account.clientId, account.clientSecret, userIds, 500);
431
+ // Batch query user info (3s timeout — needs token fetch + API call)
432
+ const userInfoMap = await batchGetUserInfo(account.clientId, account.clientSecret, userIds, 3000);
430
433
 
431
434
  if (userInfoMap.size > 0) {
432
435
  // Build mention list: [@张三 @李四]