mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
removing chat filters
This commit is contained in:
@@ -15,7 +15,7 @@ const rateBuckets = new Map(); // socketId -> [timestamps]
|
|||||||
const MAX_HISTORY = 100;
|
const MAX_HISTORY = 100;
|
||||||
const history = [];
|
const history = [];
|
||||||
|
|
||||||
const PROFANITY_LIST = ['bitch', 'cunt', 'nigger', 'nigga', 'asshole', 'dick'];
|
const PROFANITY_LIST = ['bitch', 'cunt', 'nigger', 'nigga', 'asshole', 'dick', 'faggot', 'fag', 'whore'];
|
||||||
const DUPLICATE_WINDOW_MS = 15000;
|
const DUPLICATE_WINDOW_MS = 15000;
|
||||||
const lastMessageBySocket = new Map(); // socketId -> { text, ts }
|
const lastMessageBySocket = new Map(); // socketId -> { text, ts }
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ function handleIncoming({ text, tts } = {}, socket, cb = () => {}) {
|
|||||||
cb({ error: 'Slow down' });
|
cb({ error: 'Slow down' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (clean.length > 256) {
|
if (clean.length > 150) {
|
||||||
cb({ error: 'Message too long' });
|
cb({ error: 'Message too long' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -139,10 +139,10 @@ function handleIncoming({ text, tts } = {}, socket, cb = () => {}) {
|
|||||||
// cb({ error: 'Duplicate message' });
|
// cb({ error: 'Duplicate message' });
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
if (isKeymash(clean)) {
|
// if (isKeymash(clean)) {
|
||||||
cb({ error: 'Message looks like spam' });
|
// cb({ error: 'Message looks like spam' });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
const roverId = resolveRoverId(socket?.id);
|
const roverId = resolveRoverId(socket?.id);
|
||||||
const ttsOptions = normalizeTtsOptions(tts);
|
const ttsOptions = normalizeTtsOptions(tts);
|
||||||
const message = buildMessage(socket, clean, { fromDiscord: false, roverId, tts: ttsOptions });
|
const message = buildMessage(socket, clean, { fromDiscord: false, roverId, tts: ttsOptions });
|
||||||
|
|||||||
Reference in New Issue
Block a user