Page 1 of 1

Access Badwordsfilter directly

Posted: 18 Sep 2019, 10:16
by rewb0rn

is the badwords filter accessible directly to check strings if they contain badwords? We are using the Smartfox API with a configured badwords filter for our public chats, but we have a custom message for private chats. We would now like to use the badwords filter so that we don't have to maintain 2 different systems. The goal is to identify if a message contained bad words. If so warn the user and ultimately kick or ban them. Same like the public chats work.

Thanks in advance

Re: Access Badwordsfilter directly

Posted: 18 Sep 2019, 15:42
by Lapo
the message filter is placed in a specific point of the message chain, so that it can catch matching words before they get sent to other players.
I am not sure what you mean by "accessible directly to check strings".
The class that runs the filtering is not pluggable by some other external code, if that's what you're asking.

What you could do instead is filter the messages earlier, before they even reach the bad word filter. To do so you can add a SystemController Filter, as explained here: ... er-filters

Hope it helps