fix:修复表达器炸裂
This commit is contained in:
@@ -83,8 +83,13 @@ class ExpressionLearner:
|
||||
|
||||
# 获取当前chat_id的类型
|
||||
chat_stream = get_chat_manager().get_stream(chat_id)
|
||||
if chat_stream is None:
|
||||
# 如果聊天流不在内存中,跳过互通组查找,直接使用当前chat_id
|
||||
logger.warning(f"聊天流 {chat_id} 不在内存中,跳过互通组查找")
|
||||
chat_ids_to_load = [chat_id]
|
||||
else:
|
||||
platform = chat_stream.platform
|
||||
if chat_stream and chat_stream.group_info:
|
||||
if chat_stream.group_info:
|
||||
current_chat_type = "group"
|
||||
typed_chat_id = f"{platform}:{chat_stream.group_info.group_id}:{current_chat_type}"
|
||||
else:
|
||||
@@ -266,7 +271,10 @@ class ExpressionLearner:
|
||||
learnt_expressions, chat_id = res
|
||||
|
||||
chat_stream = get_chat_manager().get_stream(chat_id)
|
||||
if chat_stream.group_info:
|
||||
if chat_stream is None:
|
||||
# 如果聊天流不在内存中,使用chat_id作为默认名称
|
||||
group_name = f"聊天流 {chat_id}"
|
||||
elif chat_stream.group_info:
|
||||
group_name = chat_stream.group_info.group_name
|
||||
else:
|
||||
group_name = f"{chat_stream.user_info.user_nickname}的私聊"
|
||||
|
||||
Reference in New Issue
Block a user