From f6d7a203d8b1c3a3a069f6cd7e40160c5705eb78 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Sun, 26 Mar 2023 13:08:58 +0800 Subject: [PATCH] fix: sensitive word check bug #202 --- channel/wechat/wechat_mp_channel.py | 2 +- sensitive_words.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/channel/wechat/wechat_mp_channel.py b/channel/wechat/wechat_mp_channel.py index 4092211..6a05223 100644 --- a/channel/wechat/wechat_mp_channel.py +++ b/channel/wechat/wechat_mp_channel.py @@ -19,7 +19,7 @@ def hello_world(msg): sensitive_words = [line.strip() for line in f.readlines()] found = False for word in sensitive_words: - if word in msg.content: + if word != '' and word in msg.content: found = True break if found: diff --git a/sensitive_words.txt b/sensitive_words.txt index 8b13789..e69de29 100644 --- a/sensitive_words.txt +++ b/sensitive_words.txt @@ -1 +0,0 @@ -