@ascegu/teamily 1.0.16 → 1.0.17
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/channel.ts +12 -0
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -247,6 +247,7 @@ export const teamilyPlugin: ChannelPlugin<ResolvedTeamilyAccount> = {
|
|
|
247
247
|
const groupHistories = new Map<string, HistoryEntry[]>();
|
|
248
248
|
|
|
249
249
|
const stopFn = startTeamilyMonitoring(account, async (message) => {
|
|
250
|
+
try {
|
|
250
251
|
const rt = getTeamilyRuntime();
|
|
251
252
|
const currentCfg = rt.config.loadConfig();
|
|
252
253
|
|
|
@@ -339,6 +340,10 @@ export const teamilyPlugin: ChannelPlugin<ResolvedTeamilyAccount> = {
|
|
|
339
340
|
MediaType: mediaType,
|
|
340
341
|
};
|
|
341
342
|
|
|
343
|
+
log?.info?.(
|
|
344
|
+
`[${accountId}] Dispatching reply: sessionKey=${sessionKey}, chatType=${isGroup ? "group" : "direct"}, replyTarget=${replyTarget}`,
|
|
345
|
+
);
|
|
346
|
+
|
|
342
347
|
await rt.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
|
|
343
348
|
ctx: msgCtx,
|
|
344
349
|
cfg: currentCfg,
|
|
@@ -359,6 +364,8 @@ export const teamilyPlugin: ChannelPlugin<ResolvedTeamilyAccount> = {
|
|
|
359
364
|
},
|
|
360
365
|
});
|
|
361
366
|
|
|
367
|
+
log?.info?.(`[${accountId}] Dispatch completed for ${sessionKey}`);
|
|
368
|
+
|
|
362
369
|
// Clear history buffer after dispatch so context doesn't repeat.
|
|
363
370
|
if (isGroup && historyKey) {
|
|
364
371
|
clearHistoryEntriesIfEnabled({
|
|
@@ -367,6 +374,11 @@ export const teamilyPlugin: ChannelPlugin<ResolvedTeamilyAccount> = {
|
|
|
367
374
|
limit: historyLimit,
|
|
368
375
|
});
|
|
369
376
|
}
|
|
377
|
+
} catch (err) {
|
|
378
|
+
log?.error?.(
|
|
379
|
+
`[${accountId}] Error handling message from ${message.sendID}: ${err instanceof Error ? err.stack || err.message : String(err)}`,
|
|
380
|
+
);
|
|
381
|
+
}
|
|
370
382
|
});
|
|
371
383
|
|
|
372
384
|
// Respect abort signal from the gateway framework
|