xiaozuoassistant 0.2.40 → 0.2.42
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.
|
@@ -67,26 +67,21 @@ export class FeishuChannel extends BaseChannel {
|
|
|
67
67
|
const originalDo = eventDispatcher.do;
|
|
68
68
|
// @ts-ignore
|
|
69
69
|
eventDispatcher.do = function (data) {
|
|
70
|
-
console.log(`[Feishu-${botName}] WS payload received:`, JSON.stringify(data).substring(0, 200));
|
|
71
70
|
return originalDo.call(this, data);
|
|
72
71
|
};
|
|
73
72
|
eventDispatcher.register({
|
|
74
73
|
'im.message.receive_v1': async (data) => {
|
|
75
|
-
console.log(`[Feishu-${botName}] Received message event:`, data);
|
|
76
74
|
const event = data.message;
|
|
77
75
|
const sender = data.sender;
|
|
78
76
|
if (!event || !sender) {
|
|
79
|
-
console.log(`[Feishu-${botName}] Invalid event structure:`, data);
|
|
80
77
|
return;
|
|
81
78
|
}
|
|
82
79
|
// Ignore bot messages
|
|
83
80
|
if (sender.sender_type !== 'user') {
|
|
84
|
-
console.log(`[Feishu-${botName}] Ignoring bot message`);
|
|
85
81
|
return;
|
|
86
82
|
}
|
|
87
83
|
try {
|
|
88
84
|
const content = JSON.parse(event.content).text;
|
|
89
|
-
console.log(`[Feishu-${botName}] Received message: ${content}`);
|
|
90
85
|
// Use chat_id for group chats, open_id/user_id for p2p?
|
|
91
86
|
// Actually message.chat_id is universal for where the message comes from.
|
|
92
87
|
const sessionId = `feishu:${botName}:${event.chat_id}`;
|
|
@@ -110,7 +105,6 @@ export class FeishuChannel extends BaseChannel {
|
|
|
110
105
|
}
|
|
111
106
|
return;
|
|
112
107
|
}
|
|
113
|
-
console.log(`[Feishu-${botName}] Emitting message with sessionId: ${sessionId}`);
|
|
114
108
|
this.emitMessage(sessionId, content);
|
|
115
109
|
}
|
|
116
110
|
catch (e) {
|
|
@@ -26,7 +26,7 @@ const fileTransport = new winston.transports.DailyRotateFile({
|
|
|
26
26
|
datePattern: 'YYYY-MM-DD',
|
|
27
27
|
zippedArchive: true, // Archive old logs (gzip)
|
|
28
28
|
maxSize: '20m', // Rotate if size exceeds 20MB (optional safety)
|
|
29
|
-
maxFiles: '
|
|
29
|
+
maxFiles: '3d', // Keep logs for 3 days only
|
|
30
30
|
createSymlink: true, // Create a symlink 'app.log' pointing to current log
|
|
31
31
|
symlinkName: 'app.log',
|
|
32
32
|
level: 'info'
|