JavaScript SDK — Moderation

Moderation — mp.moderation

censor
await mp.moderation.censor(text)

Authoritative server-side profanity screen — returns the filtered verdict for names, chat-class strings and lobby titles. Server checks also run automatically on registration, rename and room creation.

Local filter, server verdict

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.

  • Apply the check to every user-visible string — player names, room titles, chat — not just account names.
  • The verdict returns masked display text as well as the decision, for surfaces that filter rather than reject.
  • Name and room rules are separate from profanity — both apply server-side at the same endpoints.
  • Every call returns a Promise — await inside async functions. In browsers requests run over fetch with CORS; on Node.js 22.12+ the identical API uses the built-in fetch.