From 6b6b709b7669a2e4291fa6d2f95c4df6ac5c77a6 Mon Sep 17 00:00:00 2001 From: Sean Wang Date: Sun, 31 Mar 2019 23:02:13 -0400 Subject: [PATCH] Excluded apostrophes in regular expression so contractions are okay, and also added more bad words --- bad_words.txt | 2 +- christian_crusader.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bad_words.txt b/bad_words.txt index 192d3a5..ab0c946 100644 --- a/bad_words.txt +++ b/bad_words.txt @@ -1 +1 @@ -{"fuck": "frick", "f\u00fcck": "frick", "fucker": "falcon", "fucking": "falconing", "dick": "duck", "bitching": "blipping", "lmao": "lmbo", "motherfucker": "motherfricker", "shit": "poop", "bitch": "blip", "hell": "heck", "ass": "butt", "asshole": "butthole", "bastard": "custard", "damn": "dang", "dammit": "dangit", "damnit": "dangit", "cunt": "punt", "biatch": "bleach", "smd": "smp", "bitches": "beaches", "tit": "bit", "tits": "bits", "lmfao": "lmfba", "whore": "princess", "slut": "butt", "shitter": "digger", "penis": "thing", "penises": "things"} +{"fuck": "frick", "f\u00fcck": "frick", "fucker": "falcon", "fucking": "falconing", "dick": "duck", "bitching": "blipping", "lmao": "lmbo", "motherfucker": "motherfricker", "shit": "poop", "bitch": "blip", "hell": "heck", "ass": "butt", "asshole": "butthole", "bastard": "custard", "damn": "dang", "dammit": "dangit", "damnit": "dangit", "cunt": "punt", "biatch": "bleach", "smd": "smp", "bitches": "beaches", "tit": "bit", "tits": "bits", "lmfao": "lmfba", "whore": "princess", "slut": "butt", "shitter": "digger", "penis": "thing", "penises": "things", "fucked": "screwed", "dammit" : "dangit", "goddammit": "dangnabbit", "shitty": "poopy", "bitchy": "blippy", "fucky": "screwy", "assy": "butty"} diff --git a/christian_crusader.py b/christian_crusader.py index 25bf34d..a8f311c 100644 --- a/christian_crusader.py +++ b/christian_crusader.py @@ -130,7 +130,7 @@ async def on_message(message): ] message_string = message.content # regex pattern for stripping out non-alphanumeric and non-spaces - pattern = re.compile(r"([^\s\w]|_)+") + pattern = re.compile(r"([^\s\w^']|_)+") # Initialize bad word count bad_word_count = 0 # Take out everything except alpha-numeric and spaces