Check For Profanity & Hate Speech
checkProfanityV2 is the basic filter and will soon be removed in later versions!
import org.universaldevelopment.universalChat.API.UniversalChatAPI.checkProfanityV3
import org.universaldevelopment.universalChat.API.UniversalChatAPI.checkProfanityV2
Checking For Profanity & Hate Speech (V3) (Recommended)
UniversalChatAPI.checkProfanityV3(originalMessage, profanityFilterPercentage)
originalMessage: String
profanityFilterPercentage: String
Returns String "STOP" or "SEND"
"STOP" - This message contains profanity or hate speech
"SEND" - No profanity or hate speech detected
Example
checkProfanityV3("You suck", "60")
In this example, the string "You suck" is evaluated using ML with a strictness level of 60%. Setting the strictness too low may lead to false positives, while setting it too high may reduce accuracy. It is recommended to leave it at 60%
Checking for Profanity & Hate Speech (V2) (Not Recommended) (Soon To Be Removed)
UniversalChatAPI.checkProfanityV2(Message)
Message: String
Returns String "STOP" or "SEND"
"STOP" - This message contains profanity
"SEND" - No profanity detected
Example
checkProfanityV2("shit")
In this example, the string "shit" is checked against a word list, if a word appears, it will send "STOP" else "SEND". checkProfanityV2 does not remove hate speech and can be inaccurate.
Last updated