From ffead28bd4f40b5b85d26c35576d435918297fdf Mon Sep 17 00:00:00 2001 From: t Date: Sun, 15 Oct 2023 20:51:00 +0300 Subject: [PATCH] Fix false positives. --- antimat.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/antimat.py b/antimat.py index bc9a004..f17b91c 100644 --- a/antimat.py +++ b/antimat.py @@ -41,7 +41,9 @@ bot = telebot.TeleBot(db['token']) from re import search, match def is_bad(word, bad): - res = search(bad, word) + # Agressive mode, causes false positives + #res = search(bad, word) + res = match(bad, word) if res is not None: return True else: @@ -78,8 +80,13 @@ def catch_edited_messages(message): catch(message) +''' while True: try: bot.polling() + except KeyboardInterrupt: + exit() except: pass +''' +bot.polling()