trying to weed out false positives
This commit is contained in:
parent
6d443fea7b
commit
cb221b1e5e
@ -509,6 +509,7 @@
|
||||
"nightmares",
|
||||
"nightcore",
|
||||
"nightclub",
|
||||
"nighttime",
|
||||
"pingers",
|
||||
"nigeria",
|
||||
"nigel",
|
||||
|
@ -183,10 +183,15 @@ module.exports = class AutoModeration extends Observer {
|
||||
try { // This is for debugging only
|
||||
inWL = this.whitelist.find(fullWord);
|
||||
} catch (err) {
|
||||
this.logger.debug(fullWord, match[1], words);
|
||||
this.logger.debug(`Whitelist.find error: ${fullWord} ${match[1]} ${words}`);
|
||||
}
|
||||
if (inWL || whitelist.some((word) => word === fullWord)) continue;
|
||||
|
||||
const diff = Math.abs(fullWord.length - match[0].length);
|
||||
if (diff > 3) {
|
||||
this.logger.debug(`Match length diff: ${diff} MATCH: ${match[0]} FULL: ${fullWord}`);
|
||||
continue;
|
||||
}
|
||||
log += `\nMessage matched with "${reg}" in the regex list.\nMatch: ${match[0]}, Full word: ${fullWord}\nFull content: ${content}`;
|
||||
filterResult = {
|
||||
match: fullWord,
|
||||
|
Loading…
Reference in New Issue
Block a user