Ruff Format
This commit is contained in:
@@ -142,13 +142,21 @@ class ChatManager:
|
||||
|
||||
if chat_stream.is_group_session:
|
||||
info["group_id"] = chat_stream.group_id
|
||||
if chat_stream.context and chat_stream.context.message and chat_stream.context.message.message_info.group_info:
|
||||
if (
|
||||
chat_stream.context
|
||||
and chat_stream.context.message
|
||||
and chat_stream.context.message.message_info.group_info
|
||||
):
|
||||
info["group_name"] = chat_stream.context.message.message_info.group_info.group_name or "未知群聊"
|
||||
else:
|
||||
info["group_name"] = "未知群聊"
|
||||
else:
|
||||
info["user_id"] = chat_stream.user_id
|
||||
if chat_stream.context and chat_stream.context.message and chat_stream.context.message.message_info.user_info:
|
||||
if (
|
||||
chat_stream.context
|
||||
and chat_stream.context.message
|
||||
and chat_stream.context.message.message_info.user_info
|
||||
):
|
||||
info["user_name"] = chat_stream.context.message.message_info.user_info.user_nickname
|
||||
else:
|
||||
info["user_name"] = "未知用户"
|
||||
|
||||
@@ -44,7 +44,9 @@ def get_replyer(
|
||||
if not chat_id and not chat_stream:
|
||||
raise ValueError("chat_stream 和 chat_id 不可均为空")
|
||||
try:
|
||||
logger.debug(f"[GeneratorService] 正在获取回复器,chat_id: {chat_id}, chat_stream: {'有' if chat_stream else '无'}")
|
||||
logger.debug(
|
||||
f"[GeneratorService] 正在获取回复器,chat_id: {chat_id}, chat_stream: {'有' if chat_stream else '无'}"
|
||||
)
|
||||
return replyer_manager.get_replyer(
|
||||
chat_stream=chat_stream,
|
||||
chat_id=chat_id,
|
||||
|
||||
@@ -70,10 +70,10 @@ async def _send_to_target(
|
||||
if reply_message:
|
||||
anchor_message = db_message_to_mai_message(reply_message)
|
||||
if anchor_message:
|
||||
logger.debug(f"[SendService] 找到匹配的回复消息,发送者: {anchor_message.message_info.user_info.user_id}")
|
||||
reply_to_platform_id = (
|
||||
f"{anchor_message.platform}:{anchor_message.message_info.user_info.user_id}"
|
||||
logger.debug(
|
||||
f"[SendService] 找到匹配的回复消息,发送者: {anchor_message.message_info.user_info.user_id}"
|
||||
)
|
||||
reply_to_platform_id = f"{anchor_message.platform}:{anchor_message.message_info.user_info.user_id}"
|
||||
|
||||
sender_info = None
|
||||
if target_stream.context and target_stream.context.message:
|
||||
|
||||
Reference in New Issue
Block a user