Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Removing Profanity

Ace Sobremont edited this page Jun 29, 2022 · 2 revisions

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 make your own pull request.

Clone this wiki locally