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