Added Slur Check to Utilities

This commit is contained in:
Alex Orid 2021-01-21 17:41:03 -05:00
parent dee1bf4be0
commit 2c05d978de

View File

@ -20,6 +20,21 @@ def contains_url(self, input: str):
def get_args(text: str) -> list:
return text.split(" ")
def contains_slur(self, input: str):
containsSlur: bool = False
parsedMessage = input.split(" ")
for word in parsedMessage:
for slur in config.slurList:
if word.lower() == slur:
containsSlur = True
break
if containsSlur:
break
if containsSlur:
print("<{ slur detected! }> ")
return containsSlur
def hard_shutdown():
current_system_pid = os.getpid()