Skip to content

Filter bad words from multiplayer chat messages server-side#480

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/filter-bad-words-server-side
Draft

Filter bad words from multiplayer chat messages server-side#480
Copilot wants to merge 2 commits intomainfrom
copilot/filter-bad-words-server-side

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 29, 2026

Chat messages were not screened for inappropriate content, unlike usernames which already used isAppropriateString. This adds the same guard to both chat paths.

Changes

  • ServerMultiplayerRoomMixin.js — added isAppropriateString(message) check to chat() and chatLiveUpdate(); messages containing bad words are silently dropped before broadcast
chat ({ userId, username }, { message }) {
  if (this.settings.public && !this.settings.loginRequired) { return false; }
  if (typeof message !== 'string') { return false; }
  if (!isAppropriateString(message)) { return false; }  // added
  this.emitMessage({ type: 'chat', message, username, userId });
}

Reuses the existing isAppropriateString import already present in the file — no new dependencies.

Original prompt

Filter out bad words from multiplayer usernames and chat messages, this should call existing functions, be succinct, and be implemented server-side


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI changed the title [WIP] Filter out bad words from multiplayer usernames and chat messages Filter bad words from multiplayer chat messages server-side Mar 29, 2026
Copilot AI requested a review from geoffrey-wu March 29, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants