feat(channels): wire contact auto-collector across all channel handlers

Pass contactCollector through channel manager to all channel handlers
(Telegram, Discord, Feishu, Slack, Zalo) so contacts are automatically
collected when users interact with the agent.
This commit is contained in:
viettranx committed 2026-03-10 18:46:44 +07:00
1 parent 2495ff253c
commit 23f1957c56
8 files changed
+67 -11

No files matched your search

+5
View File
@@ -85,6 +85,11 @@ func (c *Channel) handleMessageEvent(ctx context.Context, event *MessageEvent) {
MessageID: messageID,
}, c.historyLimit)
// Collect contact even when bot is not mentioned (cache prevents DB spam).
if cc := c.ContactCollector(); cc != nil {
cc.EnsureContact(ctx, c.Type(), c.Name(), mc.SenderID, mc.SenderID, senderName, "", "group")
}
slog.Debug("feishu group message recorded (no mention)",
"chat_id", mc.ChatID, "sender", senderName,
)