fix(feishu): mention detection fallback when botOpenID is empty

If probeBotInfo fails (missing bot:read permission), botOpenID is empty
and mention detection always returns false — causing all group messages
to be silently recorded to history instead of processed.

Now treats any mention as bot mention when botOpenID is unknown.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
viettranxandClaude Opus 4.6 committed 2026-03-03 12:21:17 +07:00
1 parent 7106a74212
commit de284733f0
1 file changed
+4 -2
+4 -2
View File
@@ -36,8 +36,10 @@ func (c *Channel) parseMessageEvent(event *MessageEvent) *messageContext {
}
mentions = append(mentions, mi)
// Check if bot is mentioned
if c.botOpenID != "" && mi.OpenID == c.botOpenID {
// Check if bot is mentioned.
// If botOpenID is known, match exactly; otherwise treat any mention as bot mention
// (fallback when probeBotInfo fails — better to process than silently drop).
if c.botOpenID == "" || mi.OpenID == c.botOpenID {
mentionedBot = true
}
}