优化群成员变更通知信息。与组件进行联动。
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)
|
||||
|
||||
@@ -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 如何写一个机器人?"
|
||||
|
||||
Reference in New Issue
Block a user