From 268fb0603b30a54285ecd886fe89ac1235ecc7ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 12 Jun 2025 12:47:45 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20=E8=87=AA=E5=8A=A8=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin_system/base/base_action.py | 59 +++++++++++++-------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/src/plugin_system/base/base_action.py b/src/plugin_system/base/base_action.py index b3ab3df2e..f5c2019b7 100644 --- a/src/plugin_system/base/base_action.py +++ b/src/plugin_system/base/base_action.py @@ -136,40 +136,39 @@ class BaseAction(ABC): return await self.api.send_text_to_user( 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: - """发送回复消息 + """发送回复消息 - Args: - text: 回复内容 + Args: + text: 回复内容 - Returns: - bool: 是否发送成功 - """ - chat_stream = self.api.get_service("chat_stream") - if not chat_stream: - logger.error(f"{self.log_prefix} 没有可用的聊天流发送回复") - return False + Returns: + bool: 是否发送成功 + """ + chat_stream = self.api.get_service("chat_stream") + if not chat_stream: + logger.error(f"{self.log_prefix} 没有可用的聊天流发送回复") + return False - if chat_stream.group_info: - # 群聊 - return await self.api.send_message_to_target( - message_type=type, - content=text, - platform=chat_stream.platform, - target_id=str(chat_stream.group_info.group_id), - is_group=True - ) - else: - # 私聊 - return await self.api.send_message_to_target( - message_type=type, - content=text, - platform=chat_stream.platform, - target_id=str(chat_stream.user_info.user_id), - is_group=False - - ) + if chat_stream.group_info: + # 群聊 + return await self.api.send_message_to_target( + message_type=type, + content=text, + platform=chat_stream.platform, + target_id=str(chat_stream.group_info.group_id), + is_group=True, + ) + else: + # 私聊 + return await self.api.send_message_to_target( + message_type=type, + content=text, + platform=chat_stream.platform, + target_id=str(chat_stream.user_info.user_id), + is_group=False, + ) async def send_command(self, command_name: str, args: dict = None, display_message: str = None) -> bool: """发送命令消息