@yaoyuanchao/dingtalk 1.4.2 → 1.4.3

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 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaoyuanchao/dingtalk",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
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
@@ -171,10 +171,14 @@ async function extractMessageContent(
171
171
  }>;
172
172
 
173
173
  if (Array.isArray(records) && records.length > 0) {
174
+ // Debug: log first record structure to understand available fields
175
+ log?.info?.("[dingtalk] chatRecord first record structure: " + JSON.stringify(records[0]));
176
+
174
177
  const formattedRecords = records.map((record, idx) => {
178
+ const sender = record.senderNick || record.senderId || '未知';
175
179
  const msgContent = record.content || '[不支持的消息类型]';
176
180
  const time = record.createAt ? new Date(record.createAt).toLocaleString('zh-CN') : '';
177
- return `[${idx + 1}]${time ? ` (${time})` : ''}: ${msgContent}`;
181
+ return `[${idx + 1}] ${sender}${time ? ` (${time})` : ''}: ${msgContent}`;
178
182
  });
179
183
  const text = `[聊天记录合集 - ${records.length}条消息]\n${formattedRecords.join('\n')}`;
180
184
  log?.info?.("[dingtalk] Parsed chatRecord with " + records.length + " messages");