Skip to content

Removing Profanity

xqwtxon edited this page Aug 23, 2023 · 1 revision

Remove Profanity Languages

Well, you can now remove profanity message and replace it like **** characters. Simplify of it.

PluginAPI::removeProfanity(string $message, array $words);

How it works?

public function onChat(PlayerChatEvent $ev) :void {
    $message = $ev->getMessage();
    $words = ["your-word", "another-word"];
    if(PluginAPI::detectProfanity($message, $words)){
        $ev->setMessage(PluginAPI::removeProfanity($message, $words)); // example: your-word as ********* characters.
     }
}

So, it will removes the profanity words and replace them * characters as blocking them.

Do you want to improve this page?

You can create your own issue

Clone this wiki locally