Skip to content

Commit cf7e5a6

Browse files
committed
filtration was improperly checking message contents as it was basically done wrong, this implements the behavior that was desired when it originally was quickly added as a reaction
1 parent 01a1551 commit cf7e5a6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sogs/filtration.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ def should_drop_message_with_body(body):
99
if body is None:
1010
return False
1111
if os.path.exists(config.BAD_WORDS_FILE):
12+
body = message_body(body)
13+
if body is None:
14+
# this is invalid data so filter it out
15+
return True
1216
with open(config.BAD_WORDS_FILE, 'rb') as f:
1317
for line in f:
1418
word = line.rstrip()

0 commit comments

Comments
 (0)