优化群成员变更通知信息。与组件进行联动。

This commit is contained in:
liuwei
2026-01-20 14:23:52 +08:00
parent 80ec3c0799
commit 8b507a471b
2 changed files with 5 additions and 1 deletions

View File

@@ -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)