feat:部分处理notify,自动同步数据库null约束变更
notify存储至message库
This commit is contained in:
@@ -146,7 +146,10 @@ class ChatBot:
|
||||
|
||||
async def hanle_notice_message(self, message: MessageRecv):
|
||||
if message.message_info.message_id == "notice":
|
||||
logger.info("收到notice消息,暂时不支持处理")
|
||||
message.is_notify = True
|
||||
logger.info("notice消息")
|
||||
print(message)
|
||||
|
||||
return True
|
||||
|
||||
async def do_s4u(self, message_data: Dict[str, Any]):
|
||||
@@ -207,7 +210,8 @@ class ChatBot:
|
||||
message = MessageRecv(message_data)
|
||||
|
||||
if await self.hanle_notice_message(message):
|
||||
return
|
||||
# return
|
||||
pass
|
||||
|
||||
group_info = message.message_info.group_info
|
||||
user_info = message.message_info.user_info
|
||||
|
||||
@@ -217,7 +217,8 @@ class ChatManager:
|
||||
# 更新用户信息和群组信息
|
||||
stream.update_active_time()
|
||||
stream = copy.deepcopy(stream) # 返回副本以避免外部修改影响缓存
|
||||
stream.user_info = user_info
|
||||
if user_info.platform and user_info.user_id:
|
||||
stream.user_info = user_info
|
||||
if group_info:
|
||||
stream.group_info = group_info
|
||||
from .message import MessageRecv # 延迟导入,避免循环引用
|
||||
|
||||
@@ -109,6 +109,7 @@ class MessageRecv(Message):
|
||||
self.has_picid = False
|
||||
self.is_voice = False
|
||||
self.is_mentioned = None
|
||||
self.is_notify = False
|
||||
|
||||
self.is_command = False
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ class MessageStorage:
|
||||
priority_info = {}
|
||||
is_emoji = False
|
||||
is_picid = False
|
||||
is_notify = False
|
||||
is_command = False
|
||||
else:
|
||||
filtered_display_message = ""
|
||||
@@ -53,6 +54,7 @@ class MessageStorage:
|
||||
priority_info = message.priority_info
|
||||
is_emoji = message.is_emoji
|
||||
is_picid = message.is_picid
|
||||
is_notify = message.is_notify
|
||||
is_command = message.is_command
|
||||
|
||||
chat_info_dict = chat_stream.to_dict()
|
||||
@@ -98,6 +100,7 @@ class MessageStorage:
|
||||
priority_info=priority_info,
|
||||
is_emoji=is_emoji,
|
||||
is_picid=is_picid,
|
||||
is_notify=is_notify,
|
||||
is_command=is_command,
|
||||
)
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user