diff --git a/src/constants/FilterPresets.json b/src/constants/FilterPresets.json index 8983002..6fb31ec 100644 --- a/src/constants/FilterPresets.json +++ b/src/constants/FilterPresets.json @@ -509,6 +509,7 @@ "nightmares", "nightcore", "nightclub", + "nighttime", "pingers", "nigeria", "nigel", diff --git a/src/structure/components/observers/Automoderation.js b/src/structure/components/observers/Automoderation.js index b6f8ce0..a279cf6 100644 --- a/src/structure/components/observers/Automoderation.js +++ b/src/structure/components/observers/Automoderation.js @@ -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,