shonore/PyChat

Create a Word class for processing the values in the input files

Opened this issue · 0 comments

Description:
We need to have each word in the profanity.txt file to have a language level field. For each word in the file, a language level value associated with it.

Language Level Values: Normal, Warning, Illegal

This class needs to have the following logic:
-compare argument value to each word on the list
-if the argument value equals any of the words that have a language level value equal to "Normal" -> continue to next word.
-if argument value is equal to a word on the list that has a language level value equal to "Warning" -> return the following warning message "Warning! Watch your language!"
-increment a counter
-If the counter is greater than or equal to 3, return the following message "Three strikes and you're out! You are being removed from the chat room"
-end the client's connection to the server
-if argument value is equal to a word on the list that has a language level value equal to "Illegal" -> return the following warning message "[input value] is considered an illegal word. You are banned from the chat room". Then update the usernames.txt file so that the Allowed field flag is set to false.