diff --git a/assets/chat/js/chat.js b/assets/chat/js/chat.js index 29d4a58e..fa5e3681 100644 --- a/assets/chat/js/chat.js +++ b/assets/chat/js/chat.js @@ -1203,6 +1203,17 @@ class Chat { `You are temporarily muted! You can chat again ${this.mutedtimer.getReadableDuration()}. Subscribe to remove the mute immediately.`, ); break; + case 'bannedphrase': { + const phraseCountText = + data.filtered.length === 1 + ? 'this banned phrase' + : 'these banned phrases'; + const filteredPretty = data.filtered.map((p) => `"${p}"`).join(', '); + message = MessageBuilder.error( + `Your message was filtered because it contained ${phraseCountText}: ${filteredPretty}.`, + ); + break; + } default: message = MessageBuilder.error(errorstrings.get(desc) || desc); } diff --git a/assets/chat/js/const.js b/assets/chat/js/const.js index 1a88e1af..61d52f75 100644 --- a/assets/chat/js/const.js +++ b/assets/chat/js/const.js @@ -79,8 +79,6 @@ const errorstrings = new Map( alreadyvoted: 'You have already voted!', nochatting: "You aren't allowed to chat. Either you haven't picked a username, or a mod disabled your privileges.", - bannedphrase: - 'Your message was filtered because it contained a banned phrase.', duplicatephrase: 'Banned phrase already exists.', nophrase: "Banned phrase doesn't exist.", }),