v0.4增加对视频的支持
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
+ 增加分段发送消息,分割符为markdown语法中的换行标签`<br>`
|
+ 增加分段发送消息,分割符为markdown语法中的换行标签`<br>`
|
||||||
+ 针对触发绘画的有loading消息触发
|
+ 针对触发绘画的有loading消息触发
|
||||||
+ 支持图文消息拆分发送,Dify兼容性更好了
|
+ 支持图文消息拆分发送,Dify兼容性更好了
|
||||||
|
+ 增加对视频的支持
|
||||||
|
|
||||||
**安装方法:**
|
**安装方法:**
|
||||||
|
|
||||||
|
|||||||
9
dowmd.py
9
dowmd.py
@@ -12,7 +12,7 @@ from plugins import *
|
|||||||
name="dow_markdown",
|
name="dow_markdown",
|
||||||
desire_priority=66,
|
desire_priority=66,
|
||||||
desc="优化markdown返回结果中的图片和网址链接。",
|
desc="优化markdown返回结果中的图片和网址链接。",
|
||||||
version="0.3",
|
version="0.4",
|
||||||
author="Kubbo",
|
author="Kubbo",
|
||||||
hidden=False
|
hidden=False
|
||||||
)
|
)
|
||||||
@@ -31,7 +31,7 @@ class dow_markdown(Plugin):
|
|||||||
send_msg = e_context["context"]
|
send_msg = e_context["context"]
|
||||||
try:
|
try:
|
||||||
text = send_msg["content"]
|
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")
|
receiver = send_msg.get("receiver")
|
||||||
itchat.send("我正在绘画中,可能需要多等待一会,请稍后...", toUserName=receiver)
|
itchat.send("我正在绘画中,可能需要多等待一会,请稍后...", toUserName=receiver)
|
||||||
logger.info("[WX] sendMsg={}, receiver={}".format(text, receiver))
|
logger.info("[WX] sendMsg={}, receiver={}".format(text, receiver))
|
||||||
@@ -80,6 +80,11 @@ class dow_markdown(Plugin):
|
|||||||
reply.content = part[:-1].strip()
|
reply.content = part[:-1].strip()
|
||||||
if not part.startswith('http'):
|
if not part.startswith('http'):
|
||||||
reply.content = host + reply.content
|
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:
|
if index == len(parts) - 1 and is_last:
|
||||||
e_context["reply"] = reply
|
e_context["reply"] = reply
|
||||||
e_context.action = EventAction.BREAK_PASS
|
e_context.action = EventAction.BREAK_PASS
|
||||||
|
|||||||
Reference in New Issue
Block a user