fix:修复路径遗留问题

This commit is contained in:
SengokuCola
2025-06-12 21:20:06 +08:00
parent 70d8f3642b
commit b9a04b32f6
17 changed files with 95 additions and 283 deletions

View File

@@ -112,7 +112,7 @@ class BaseAction(ABC):
return attr.value
return str(attr)
async def send_reply(self, content: str) -> bool:
async def send_text(self, content: str) -> bool:
"""发送回复消息
Args:
@@ -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_reply(self, type: str, text: str) -> bool:
async def send_type(self, type: str, text: str) -> bool:
"""发送回复消息
Args:
@@ -173,7 +173,7 @@ class BaseAction(ABC):
async def send_command(self, command_name: str, args: dict = None, display_message: str = None) -> bool:
"""发送命令消息
使用和send_reply相同的方式通过MessageAPI发送命令
使用和send_text相同的方式通过MessageAPI发送命令
Args:
command_name: 命令名称

View File

@@ -60,7 +60,7 @@ class BaseCommand(ABC):
"""
pass
async def send_reply(self, content: str) -> None:
async def send_text(self, content: str) -> None:
"""发送回复消息
Args:
@@ -80,10 +80,45 @@ 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:
"""发送指定类型的回复消息到当前聊天环境
Args:
message_type: 消息类型,如"text""image""emoji"
content: 消息内容
display_message: 显示消息(可选)
Returns:
bool: 是否发送成功
"""
# 获取聊天流信息
chat_stream = self.message.chat_stream
if chat_stream.group_info:
# 群聊
return await self.api.send_message_to_target(
message_type=message_type,
content=content,
platform=chat_stream.platform,
target_id=str(chat_stream.group_info.group_id),
is_group=True,
display_message=display_message,
)
else:
# 私聊
return await self.api.send_message_to_target(
message_type=message_type,
content=content,
platform=chat_stream.platform,
target_id=str(chat_stream.user_info.user_id),
is_group=False,
display_message=display_message,
)
async def send_command(self, command_name: str, args: dict = None, display_message: str = None) -> bool:
"""发送命令消息
使用和send_reply相同的方式通过MessageAPI发送命令
使用和send_text相同的方式通过MessageAPI发送命令
Args:
command_name: 命令名称