From 43c42722ecf0b7e07e86b363dceed771bf99c251 Mon Sep 17 00:00:00 2001 From: SXP-Simon Date: Wed, 11 Feb 2026 00:40:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=99=BD=E5=90=8D=E5=8D=95=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20UMO=20=E6=97=A0=E6=B3=95=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index e781db1..c5fb4bf 100644 --- a/main.py +++ b/main.py @@ -294,7 +294,16 @@ class QQGroupDailyAnalysis(Star): # 更新bot实例 self.bot_manager.update_from_event(event) - if not self.config_manager.is_group_allowed(group_id): + # 优先使用 UMO 进行权限检查 (兼容白名单 UMO 格式) + check_target = getattr(event, "unified_msg_origin", None) + if not check_target: + check_target = f"{platform_id}:GroupMessage:{group_id}" + + if not self.config_manager.is_group_allowed(check_target): + # Fallback checks (simple ID) are handled inside is_group_allowed logic if list item has no colon + # But if list item HAS colon, we need precise match. + # If prompt fails, try simple ID as fallback for permissive cases? + # No, config_manager.is_group_allowed already handles simple ID matching if whitelist item is simple ID. yield event.plain_result("❌ 此群未启用日常分析功能") return @@ -720,7 +729,13 @@ class QQGroupDailyAnalysis(Star): yield event.plain_result(f"✅ 增量分析立即报告模式: {status_text}") else: # status - is_allowed = self.config_manager.is_group_allowed(group_id) + check_target = getattr(event, "unified_msg_origin", None) + if not check_target: + check_target = ( + f"{self._get_platform_id_from_event(event)}:GroupMessage:{group_id}" + ) + + is_allowed = self.config_manager.is_group_allowed(check_target) status = "已启用" if is_allowed else "未启用" mode = self.config_manager.get_group_list_mode()