调整入库时机

This commit is contained in:
Liu
2025-04-09 21:19:52 +08:00
parent 70d2195e4a
commit e156cabe9e

View File

@@ -205,14 +205,6 @@ class Robot(Job):
self.refresh_contacts()
except Exception as e:
self.LOG.error(f"加入新群,自动添加并开启机器人功能 error: {e}")
# 发布消息接收事件
self.event_system.publish(EventType.MESSAGE_RECEIVED, {"message": msg})
# 尝试使用插件处理消息
if self.process_plugin_message(msg):
return
# 如果没有插件处理,使用原有逻辑处理消息
# 群聊消息
if msg.from_group():
@@ -246,6 +238,14 @@ class Robot(Job):
self.toAt(msg)
return # 处理完群聊信息,后面就不需要处理了
# 发布消息接收事件
self.event_system.publish(EventType.MESSAGE_RECEIVED, {"message": msg})
# 尝试使用插件处理消息
if self.process_plugin_message(msg):
return
# 非群聊信息,按消息类型进行处理
if msg.type == 37: # 好友请求
self.LOG.info(f"收到好友请求:{msg}")