From b8aa9fd7ee5c78fc121d8e513d362feb9ee5f6f9 Mon Sep 17 00:00:00 2001 From: minecraft1024a Date: Thu, 2 Oct 2025 17:09:48 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"refactor(plugin=5Fsystem):=20?= =?UTF-8?q?=E9=87=8D=E6=9E=84=20send=5Fcommand=20=E4=BB=A5=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E9=80=82=E9=85=8D=E5=99=A8=E4=B8=93=E7=94=A8=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E6=8E=A5=E5=8F=A3"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ba5e0b0eafafd963d23bd35d1deeee3b1fa5fba0. --- src/plugin_system/base/base_action.py | 20 +++++++++---------- .../built_in/social_toolkit_plugin/plugin.py | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/plugin_system/base/base_action.py b/src/plugin_system/base/base_action.py index a4d50631c..d99a9cb91 100644 --- a/src/plugin_system/base/base_action.py +++ b/src/plugin_system/base/base_action.py @@ -382,21 +382,19 @@ class BaseAction(ABC): # 构造命令数据 command_data = {"name": command_name, "args": args or {}} - response = await send_api.adapter_command_to_stream( - action=command_name, - params=args or {}, + success = await send_api.command_to_stream( + command=command_data, stream_id=self.chat_id, - platform=self.platform + storage_message=storage_message, + display_message=display_message, ) - # 根据响应判断成功与否 - if response and response.get("status") == "ok": - logger.info(f"{self.log_prefix} 成功执行适配器命令: {command_name}, 响应: {response.get('data')}") - return True + if success: + logger.info(f"{self.log_prefix} 成功发送命令: {command_name}") else: - error_message = response.get('message', '未知错误') - logger.error(f"{self.log_prefix} 执行适配器命令失败: {command_name}, 错误: {error_message}") - return False + logger.error(f"{self.log_prefix} 发送命令失败: {command_name}") + + return success except Exception as e: logger.error(f"{self.log_prefix} 发送命令时出错: {e}") diff --git a/src/plugins/built_in/social_toolkit_plugin/plugin.py b/src/plugins/built_in/social_toolkit_plugin/plugin.py index d9ea64f64..347c1c504 100644 --- a/src/plugins/built_in/social_toolkit_plugin/plugin.py +++ b/src/plugins/built_in/social_toolkit_plugin/plugin.py @@ -319,7 +319,7 @@ class SetEmojiLikeAction(BaseAction): try: success = await self.send_command( - command_name="set_msg_emoji_like", + command_name="set_emoji_like", args={"message_id": message_id, "emoji_id": emoji_id, "set": set_like}, storage_message=False, )