The local TextFilter gives an instant offline verdict from the embedded hashed wordlist; censor() is the authoritative server check and also returns the masked display text. A missed local flag still fails server-side.
client.moderation.censor(text: str) -> CensorResponse
Calls POST /api/censor.php — the authoritative server check (max 1000 characters). CensorResponse exposes clean, filtered (masked, display-safe text) and retry_after on a 429 reply.
Example Usage:
result = client.moderation.censor(chat_text)
if not result.clean:
show_message(result.filtered) # masked, safe to display
from multiplayer.moderation import text_filter
text_filter.is_clean(text)
text_filter.filter_text(text)
text_filter.is_name_allowed(name)
text_filter.filter_name(name, "Player")
Instant offline screening using the embedded salted-hash data — no request needed. The server stays authoritative: a missed local flag still fails server-side.
Censor is the authoritative moderation call: it returns the server-side profanity verdict — and the masked text — for names, lobby titles and chat-class strings. The matcher normalizes case, compatibility forms, confusable characters, digit lookalikes and repeated runs, so obfuscated spellings still match before the verdict comes back.
The server already screens automatically at registration, rename and room creation — censor exists for surfaces the server never sees, like free-form chat or pre-submit feedback. SDKs also ship a local TextFilter built from the same wordlist for instant offline checks; a miss locally still fails server-side, so never treat a local pass as final.