mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-19 16:15:45 +00:00
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:
1 parent
2495ff253c
commit
23f1957c56
8 files changed
+67
-11
No files matched your search
@@ -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,
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user