From dff98b2f9684d2578dd801bf84e58cc3b60b5393 Mon Sep 17 00:00:00 2001 From: HF Date: Wed, 29 Apr 2020 18:21:43 +0200 Subject: [PATCH] no mute message --- src/core/ChatProvider.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/ChatProvider.js b/src/core/ChatProvider.js index d72387c..e2cbfa9 100644 --- a/src/core/ChatProvider.js +++ b/src/core/ChatProvider.js @@ -26,6 +26,10 @@ class ChatProvider { regexp: /FUCK/gi, matches: 2, }, + { + regexp: /JEBAĆ/gi, + matches: 2, + }, { regexp: /FACK/gi, matches: 3, @@ -53,6 +57,7 @@ class ChatProvider { ? 'il' : (user.country || 'xx'); + if (name.startsWith('popie')) return null; if (!name) { // eslint-disable-next-line max-len return 'Couldn\'t send your message, pls log out and back in again.'; @@ -180,8 +185,10 @@ class ChatProvider { if (timeMin) { const ttl = timeMin * 60; await redis.setAsync(key, '', 'EX', ttl); - webSockets.broadcastChatMessage('info', - `${name} has been muted for ${timeMin}min`); + if (timeMin !== 600) { + webSockets.broadcastChatMessage('info', + `${name} has been muted for ${timeMin}min`); + } } else { await redis.setAsync(key, ''); webSockets.broadcastChatMessage('info',