|
|
@@ -796,6 +796,17 @@ async def send_approval_request(
|
|
|
sender_type = msg.get("sender_type", "")
|
|
|
if sender_type != "user":
|
|
|
continue
|
|
|
+
|
|
|
+ # 群聊消息需检查 @(个人聊天跳过)
|
|
|
+ is_group_chat = chat_id.startswith("oc_") and chat_id != FEISHU_OPERATOR_CHAT_ID
|
|
|
+ if is_group_chat:
|
|
|
+ mentions = msg.get("mentions", [])
|
|
|
+ # 检查是否 @ 了机器人
|
|
|
+ mentioned_bot = _feishu._check_bot_mentioned(mentions) if mentions else False
|
|
|
+ if not mentioned_bot:
|
|
|
+ logger.debug("群聊消息未 @ 机器人,跳过: %s", msg.get("message_id"))
|
|
|
+ continue
|
|
|
+
|
|
|
text = msg.get("content", "")
|
|
|
if not text.strip():
|
|
|
continue
|