From 566689c174c5149bdcf26df2222d4d02cfba61ef Mon Sep 17 00:00:00 2001 From: 1334431750 <1334431750@qq.com> Date: Fri, 22 Aug 2025 16:50:10 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=9B=BE=E7=89=87=E9=93=BE=E6=8E=A5=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= 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 cf64a44..4687993 100644 --- a/src/send_handler.py +++ b/src/send_handler.py @@ -181,6 +181,9 @@ class SendHandler: elif seg.type == "file": file_path = seg.data new_payload = self.build_payload(payload, self.handle_file_message(file_path), False) + elif seg.type == "imageurl": + image_url = seg.data + new_payload = self.build_payload(payload, self.handle_imageurl_message(image_url), False) return new_payload def build_payload(self, payload: list, addon: dict, is_reply: bool = False) -> list: @@ -270,6 +273,13 @@ class SendHandler: "type": "file", "data": {"file": f"file://{file_path}"}, } + + def handle_imageurl_message(self, image_url: str) -> dict: + """处理图片链接消息""" + return { + "type": "image", + "data": {"file": image_url}, + } def handle_ban_command(self, args: Dict[str, Any], group_info: GroupInfo) -> Tuple[str, Dict[str, Any]]: """处理封禁命令