From 268dbcca5e2f95773a0b0c7fab8eaaf3b1a9a21a Mon Sep 17 00:00:00 2001 From: minecraft1024a Date: Sat, 6 Sep 2025 16:55:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor(api):=20=E4=BC=98=E5=8C=96=E6=92=A4?= =?UTF-8?q?=E5=9B=9E=E6=B6=88=E6=81=AF=E7=9A=84=E5=87=BD=E6=95=B0=E8=B0=83?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 `adapter_command_to_stream` 的直接调用重构为使用更通用的 `command_to_stream` 函数。 此更改统一了命令分发逻辑,提高了代码的可维护性。 --- src/plugin_system/apis/send_api.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/plugin_system/apis/send_api.py b/src/plugin_system/apis/send_api.py index 3aea3cde4..565bc9f25 100644 --- a/src/plugin_system/apis/send_api.py +++ b/src/plugin_system/apis/send_api.py @@ -511,9 +511,11 @@ async def recall_message(message_id: str, stream_id: str) -> bool: Returns: bool: 是否成功 """ - response = await adapter_command_to_stream( - action="delete_msg", - params={"message_id": message_id}, - stream_id=stream_id, - ) - return response.get("status") == "ok" + command_data = {"name": "delete_msg", "args": message_id} + + success = await command_to_stream( + command=command_data, + stream_id=stream_id, + storage_message=True, + ) + return success \ No newline at end of file