From 5626705b3f3641606c4cac9333f42bc17110f468 Mon Sep 17 00:00:00 2001 From: Kubbo <390378816@qq.com> Date: Sat, 3 Aug 2024 19:22:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E7=BD=91=E7=BB=9C=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E5=92=8C=E6=9B=B4=E5=A4=9A=E6=A1=86=E6=9E=B6,?= =?UTF-8?q?=E7=9B=91=E5=90=AC=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dowmd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dowmd.py b/dowmd.py index 07c92ec..58b3b68 100644 --- a/dowmd.py +++ b/dowmd.py @@ -34,7 +34,8 @@ class dow_markdown(Plugin): if any(word in send_msg["content"] for word in ["画"]): receiver = send_msg.get("receiver") itchat.send("我正在绘画中,可能需要多等待一会,请稍后...",toUserName=receiver) - e_context.action = EventAction.CONTINUE + except Exception as e: + logger.warn(f"[dow_markdown] on_handle_context failed, content={send_msg["content"]}, error={e}") finally: e_context.action = EventAction.CONTINUE def on_decorate_reply(self, e_context: EventContext): @@ -53,6 +54,9 @@ class dow_markdown(Plugin): if host.endswith('/v1'): host = host[:-3] image_path = re.search(r'!\[.*\]\((.*?)\)',content).group(1) + # 排除网络图片,不做特殊处理 + if image_path.startswith("http"): + host = "" logger.info(f"提取到的数据==>host:{host},url:{image_path}") reply = Reply(ReplyType.IMAGE_URL, f"{host}{image_path}") e_context["reply"] = reply