fix:修复发送api打字时间,现已成为可选参数。修复可能存在的回复图片问题,为数据库缺失字段提供警告

This commit is contained in:
SengokuCola
2025-06-14 19:21:02 +08:00
parent e4e14550c7
commit 790642afd6
9 changed files with 37 additions and 9 deletions

View File

@@ -31,6 +31,7 @@ class MessageAPI:
target_id: str,
is_group: bool = True,
display_message: str = "",
typing: bool = False,
) -> bool:
"""直接向指定目标发送消息
@@ -113,7 +114,7 @@ class MessageAPI:
)
# 发送消息
sent_msg = await heart_fc_sender.send_message(bot_message, has_thinking=True, typing=False, set_reply=False)
sent_msg = await heart_fc_sender.send_message(bot_message, has_thinking=False, typing=typing, set_reply=False)
if sent_msg:
logger.info(f"{getattr(self, 'log_prefix', '')} 成功发送消息到 {platform}:{target_id}")

View File

@@ -137,7 +137,7 @@ class BaseAction(ABC):
text=content, user_id=str(chat_stream.user_info.user_id), platform=chat_stream.platform
)
async def send_type(self, type: str, text: str) -> bool:
async def send_type(self, type: str, text: str, typing: bool = False) -> bool:
"""发送回复消息
Args:
@@ -159,6 +159,7 @@ class BaseAction(ABC):
platform=chat_stream.platform,
target_id=str(chat_stream.group_info.group_id),
is_group=True,
typing=typing,
)
else:
# 私聊
@@ -168,6 +169,7 @@ class BaseAction(ABC):
platform=chat_stream.platform,
target_id=str(chat_stream.user_info.user_id),
is_group=False,
typing=typing,
)
async def send_command(self, command_name: str, args: dict = None, display_message: str = None) -> bool:

View File

@@ -80,7 +80,7 @@ class BaseCommand(ABC):
text=content, user_id=str(chat_stream.user_info.user_id), platform=chat_stream.platform
)
async def send_type(self, message_type: str, content: str, display_message: str = None) -> bool:
async def send_type(self, message_type: str, content: str, display_message: str = None, typing: bool = False) -> bool:
"""发送指定类型的回复消息到当前聊天环境
Args:
@@ -103,6 +103,7 @@ class BaseCommand(ABC):
target_id=str(chat_stream.group_info.group_id),
is_group=True,
display_message=display_message,
typing=typing,
)
else:
# 私聊