Revert "refactor(plugin_system): 重构 send_command 以对接适配器专用命令接口"

This reverts commit ba5e0b0eaf.
This commit is contained in:
minecraft1024a
2025-10-02 17:09:48 +08:00
committed by Windpicker-owo
parent 0e0dedcdf7
commit b8aa9fd7ee
2 changed files with 10 additions and 12 deletions

View File

@@ -382,21 +382,19 @@ class BaseAction(ABC):
# 构造命令数据 # 构造命令数据
command_data = {"name": command_name, "args": args or {}} command_data = {"name": command_name, "args": args or {}}
response = await send_api.adapter_command_to_stream( success = await send_api.command_to_stream(
action=command_name, command=command_data,
params=args or {},
stream_id=self.chat_id, stream_id=self.chat_id,
platform=self.platform storage_message=storage_message,
display_message=display_message,
) )
# 根据响应判断成功与否 if success:
if response and response.get("status") == "ok": logger.info(f"{self.log_prefix} 成功发送命令: {command_name}")
logger.info(f"{self.log_prefix} 成功执行适配器命令: {command_name}, 响应: {response.get('data')}")
return True
else: else:
error_message = response.get('message', '未知错误') logger.error(f"{self.log_prefix} 发送命令失败: {command_name}")
logger.error(f"{self.log_prefix} 执行适配器命令失败: {command_name}, 错误: {error_message}")
return False return success
except Exception as e: except Exception as e:
logger.error(f"{self.log_prefix} 发送命令时出错: {e}") logger.error(f"{self.log_prefix} 发送命令时出错: {e}")

View File

@@ -319,7 +319,7 @@ class SetEmojiLikeAction(BaseAction):
try: try:
success = await self.send_command( 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}, args={"message_id": message_id, "emoji_id": emoji_id, "set": set_like},
storage_message=False, storage_message=False,
) )