From 9e281d838c8478abc743651fcf913cb2f5db66df Mon Sep 17 00:00:00 2001 From: Donaldzhao <1583100297@qq.com> Date: Tue, 8 Jul 2025 21:26:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=91=E9=80=81=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/send_handler.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/send_handler.py b/src/send_handler.py index 70cfa79..cf64a44 100644 --- a/src/send_handler.py +++ b/src/send_handler.py @@ -178,6 +178,9 @@ class SendHandler: elif seg.type == "videourl": video_url = seg.data new_payload = self.build_payload(payload, self.handle_videourl_message(video_url), False) + elif seg.type == "file": + file_path = seg.data + new_payload = self.build_payload(payload, self.handle_file_message(file_path), False) return new_payload def build_payload(self, payload: list, addon: dict, is_reply: bool = False) -> list: @@ -261,6 +264,13 @@ class SendHandler: "data": {"file": video_url}, } + def handle_file_message(self, file_path: str) -> dict: + """处理文件消息""" + return { + "type": "file", + "data": {"file": f"file://{file_path}"}, + } + def handle_ban_command(self, args: Dict[str, Any], group_info: GroupInfo) -> Tuple[str, Dict[str, Any]]: """处理封禁命令