Skip to content

Commit

Permalink
🐛 修复当没有屏蔽词时,总是匹配为True
Browse files Browse the repository at this point in the history
  • Loading branch information
MelodyKnit committed Nov 17, 2023
1 parent cdeafd8 commit 8045d09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions nonebot_plugin_blockwords/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ def blockword_exists(text: str) -> bool:
Returns:
bool: 是否存在
"""
if plugin_config.blockwords_use_jieba:
return bool(find_blockword(text))
return bool(regex.search(text))
if blockwords:
if plugin_config.blockwords_use_jieba:
return bool(find_blockword(text))
return bool(regex.search(text))
return False


def blockword_replace(text: str) -> str:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nonebot-plugin-blockwords"
version = "0.2.0"
version = "0.2.1"
description = "nonebot聊天屏蔽词插件"
authors = ["MelodyKnit <2711402357@qq.com>"]
license = "MIT"
Expand Down

0 comments on commit 8045d09

Please sign in to comment.