From 8b507a471bcd9315a0341f6a63db89f207ceecaf Mon Sep 17 00:00:00 2001 From: liuwei Date: Tue, 20 Jan 2026 14:23:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BE=A4=E6=88=90=E5=91=98?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E9=80=9A=E7=9F=A5=E4=BF=A1=E6=81=AF=E3=80=82?= =?UTF-8?q?=E4=B8=8E=E7=BB=84=E4=BB=B6=E8=BF=9B=E8=A1=8C=E8=81=94=E5=8A=A8?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- robot.py | 5 ++++- utils/robot_cmd/robot_command.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/robot.py b/robot.py index 6d0d5d4..0910968 100644 --- a/robot.py +++ b/robot.py @@ -273,11 +273,14 @@ class Robot: # 只有当 Ret 不等于 0 或者 不包含 KeyBuf 时才打印 if not (isinstance(data_temp, dict) and data_temp.get("Ret") == 0 and "KeyBuf" in data_temp): self.LOG.debug(f"MESSAGE:{data_temp}") + changed_groups = self.member_monitor.parse_mod_contacts_msg(data_temp) if changed_groups: self.LOG.info(f"监测到群成员变动消息,涉及群: {changed_groups}") for group_id in changed_groups: - xx = asyncio.create_task(self.member_monitor.check_and_handle_changes(group_id)) + if self.gbm.get_group_permission(group_id, + Feature.GROUP_MEMBER_CHANGE) == PermissionStatus.ENABLED: + xx = asyncio.create_task(self.member_monitor.check_and_handle_changes(group_id)) # 使用异步睡眠替代忙等待循环 await asyncio.sleep(2) diff --git a/utils/robot_cmd/robot_command.py b/utils/robot_cmd/robot_command.py index 77c6e43..dc9da9c 100644 --- a/utils/robot_cmd/robot_command.py +++ b/utils/robot_cmd/robot_command.py @@ -31,6 +31,7 @@ class Feature(Enum): PDF_CAPABILITY = 3, "📄 sehuatang PDF能力 [无]" EPIC = 4, "📊 EPIC自动播报 [每周五自动发送]" # 新增的功能 DAILY_SUMMARY = 5, "🕤 每日群发言总结 [每日9:30定时发送]" + GROUP_MEMBER_CHANGE = 6, "👥 群成员变更监控 [自动监控群成员变动并发送通知]" # DAILY_SUMMARY = 3, "🕤 每日群发言总结 [每日9:30定时发送]" # AI_CAPABILITY = 4, "🤖 AI对话 [ai, 聊天, AI] 用法:ai 如何写一个机器人?"