From 1741c8fcdf018c42840fb0a21047dca00261869c Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 6 Aug 2024 10:07:07 +0800 Subject: [PATCH] =?UTF-8?q?v0.4=E5=A2=9E=E5=8A=A0=E5=AF=B9=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- dowmd.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 12fad70..3b8f56f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ + 增加分段发送消息,分割符为markdown语法中的换行标签`
` + 针对触发绘画的有loading消息触发 + 支持图文消息拆分发送,Dify兼容性更好了 - ++ 增加对视频的支持 **安装方法:** diff --git a/dowmd.py b/dowmd.py index 6a63cc3..0974829 100644 --- a/dowmd.py +++ b/dowmd.py @@ -12,7 +12,7 @@ from plugins import * name="dow_markdown", desire_priority=66, desc="优化markdown返回结果中的图片和网址链接。", - version="0.3", + version="0.4", author="Kubbo", hidden=False ) @@ -31,7 +31,7 @@ class dow_markdown(Plugin): send_msg = e_context["context"] try: text = send_msg["content"] - if any(word in send_msg["content"] for word in ["画", "/sd"]): + if any(word in send_msg["content"] for word in ["画", ".sd"]): receiver = send_msg.get("receiver") itchat.send("我正在绘画中,可能需要多等待一会,请稍后...", toUserName=receiver) logger.info("[WX] sendMsg={}, receiver={}".format(text, receiver)) @@ -80,6 +80,11 @@ class dow_markdown(Plugin): reply.content = part[:-1].strip() if not part.startswith('http'): reply.content = host + reply.content + elif re.search(r"\.(mp4)", part): + reply.type = ReplyType.VIDEO_URL + reply.content = part[:-1].strip() + if not part.startswith('http'): + reply.content = host + reply.content if index == len(parts) - 1 and is_last: e_context["reply"] = reply e_context.action = EventAction.BREAK_PASS