@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.
- package/package.json +1 -1
- package/src/monitor.ts +5 -2
package/package.json
CHANGED
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
|
|
429
|
-
const userInfoMap = await batchGetUserInfo(account.clientId, account.clientSecret, userIds,
|
|
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: [@张三 @李四]
|