fix:修复消息发布出去

This commit is contained in:
SengokuCola
2025-05-01 16:55:51 +08:00
parent 23d69ba90d
commit b6ce5746de
2 changed files with 4 additions and 3 deletions

View File

@@ -1371,9 +1371,9 @@ class HeartFChatting:
if not mark_head:
mark_head = True
first_bot_msg = bot_message # 保存第一个成功发送的消息对象
await self.heart_fc_sender.type_and_send_message(bot_message, type=False)
await self.heart_fc_sender.type_and_send_message(bot_message, typing=False)
else:
await self.heart_fc_sender.type_and_send_message(bot_message, type=True)
await self.heart_fc_sender.type_and_send_message(bot_message, typing=True)
reply_message_ids.append(part_message_id) # 记录我们生成的ID

View File

@@ -4,6 +4,7 @@ from typing import Dict, Optional # 重新导入类型
from ..chat.message import MessageSending, MessageThinking # 只保留 MessageSending 和 MessageThinking
from ..storage.storage import MessageStorage
from ..chat.utils import truncate_message
from src.plugins.message.api import global_api
from src.common.logger_manager import get_logger
from src.plugins.chat.utils import calculate_typing_time
@@ -17,7 +18,7 @@ async def send_message(message: MessageSending) -> None:
try:
# 直接调用API发送消息
await send_message(message)
await global_api.send_message(message)
logger.success(f"发送消息 '{message_preview}' 成功")
except Exception as e: