mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-12 17:11:20 +01:00
Fix banned words regex handler
This commit is contained in:
parent
7ac24a8981
commit
012700ee7e
@ -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)
|
||||
|
||||
@ -744,4 +744,4 @@ def af_direct_message_post():
|
||||
cleverbot_url = "http://www.cleverbot.com/getreply"
|
||||
payload = {'key': config["cleverbot-api-key"], 'cs': cs, 'input': input}
|
||||
r = requests.get(cleverbot_url, params=payload)
|
||||
return jsonify(r.json())
|
||||
return jsonify(r.json())
|
||||
|
Loading…
Reference in New Issue
Block a user