UNIVERSAL DEVELOPMENT
Join Discord [Click Here]
  • 🗨️UniversalChat
    • Installation
    • Commands
    • Permissions
    • Designing Your Chat
    • Customising Translation
    • Quick Chat (Shortcuts)
    • Server Guide
    • Profanity Filter
    • Message Of The Day (MOTD)
    • Polls
    • Autocorrect
    • Command Auto Complete
    • Developer Guide
      • Getting Started
      • Translation
      • Check For Profanity & Hate Speech
      • Create Summary Of Text
      • Server Guide
      • Autocorrect
      • Parsing Colors
    • Credits
  • 👜Modular Backpacks
    • Installation
    • Commands
    • Permissions
    • Changing backpack prices
Powered by GitBook
On this page
  • Checking For Profanity & Hate Speech (V3) (Recommended)
  • Example
  • Checking for Profanity & Hate Speech (V2) (Not Recommended) (Soon To Be Removed)
  • Example
  1. UniversalChat
  2. Developer Guide

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.

PreviousTranslationNextCreate Summary Of Text

Last updated 1 month ago

🗨️