优化群成员变更通知信息。与组件进行联动。
This commit is contained in:
5
robot.py
5
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)
|
||||
|
||||
Reference in New Issue
Block a user