Skip to content

Conversation

@ChrissprayCode
Copy link

Moved the blocked strings into their own file, Checking them against each word in the message.

Added bool options for
A) Using the profanity filter at all
B) Blocking messages with any kind of upper/lowercase combo

Uploaded text file for profanity and added a filter
if(useProfanityFilter){
foreach (var blockedString in blockedStrings){

if(preventAllCaps){ message = message.ToLower();}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If preventAllCaps is set to true then all messages will be set to lowercase regardless if they send messages like

"Hello World" will become "hello world" <-- (undesired behavior)
"HELLO WORLD" will become "hello world"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be solved now!

Changed the chat filter so instead of it turning the entire message to lowercase, it checks string against bad word case-insensitively.
Moved the second replace in an else statement so it won't always check the entire message again after it replaces when preventCapsCombo is true.
@valkyrienyanko
Copy link
Contributor

Thanks will merge when I start working on chat message packets again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants