Fix banned words regex handler

This commit is contained in:
Jeremy "EndenDragon" Zhang 2020-04-29 16:44:37 -07:00 committed by GitHub
parent 7ac24a8981
commit 012700ee7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,7 @@ def format_post_content(guild_id, channel_id, message, dbUser):
for word in banned_words:
word_boundaried = r"\b%s\b" % word
regex = re.compile(word_boundaried, re.IGNORECASE)
if regex.match(message):
if regex.search(message):
illegal_post = True
illegal_reasons.append("The following word is prohibited: " + word)