mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 19:23:42 +08:00
Closes #162 require_mention=true previously degraded to a no-op when botPrefix was unset: shouldProcess() returned true for all messages and checkAccess() fell through unconditionally, so any group message would be answered — including ones where the @mention targeted another user. FeishuChannelAdapter now consults the Feishu SDK's mentions field directly: - WebSocket: read EventMessage.getMentions(); webhook: read mentions[] from the JSON payload. In both paths each mention's id.open_id is compared against the bot's own open_id. - Bot open_id is fetched lazily via /open-apis/bot/v3/info and cached on the adapter instance. If the call fails the message is allowed through, matching the previous behaviour. - The require_mention gate is applied at the top of handleFeishuMessage so 1:1 chats are unaffected. Tests: 15 unit cases covering null/empty inputs, bot mentioned, only-other mentioned, bot among multiple mentions, and malformed payloads. |
||
|---|---|---|
| .. | ||
| java/vip/mate | ||
| resources | ||