Skip to content

Commit

Permalink
修复url开关无效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
fatwang2 committed May 1, 2024
1 parent 4f5acff commit f58efb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CodeGPT.apiKey": "Cohere"
}
6 changes: 3 additions & 3 deletions sum4all.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
name="sum4all",
desire_priority=2,
desc="A plugin for summarizing all things",
version="0.7.6",
version="0.7.7",
author="fatwang2",
)

Expand Down Expand Up @@ -226,7 +226,7 @@ def on_handle_context(self, e_context: EventContext):
# 删除文件
os.remove(image_path)
logger.info(f"文件 {image_path} 已删除")
elif context.type == ContextType.SHARING: #匹配卡片分享
elif context.type == ContextType.SHARING and self.url_sum_enabled: #匹配卡片分享
content = html.unescape(content)
if unsupported_urls: #匹配不支持总结的卡片
if isgroup: ##群聊中忽略
Expand Down Expand Up @@ -257,7 +257,7 @@ def on_handle_context(self, e_context: EventContext):
self.call_service(content, e_context, "sum")
return

elif url_match: #匹配URL链接
elif url_match and self.url_sum_enabled: #匹配URL链接
if unsupported_urls: #匹配不支持总结的网址
logger.info("[sum4all] Unsupported URL : %s", content)
reply = Reply(type=ReplyType.TEXT, content="不支持总结小程序和视频号")
Expand Down

0 comments on commit f58efb0

Please sign in to comment.