From 287bcd6cf4ec086e0e354850a9fa4385ff0dc9ae Mon Sep 17 00:00:00 2001 From: Navy Date: Sat, 12 Jun 2021 16:35:34 +0300 Subject: [PATCH] debug stuff --- structure/client/components/observers/Automoderation.js | 8 +++++++- structure/interfaces/BinaryTree.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/structure/client/components/observers/Automoderation.js b/structure/client/components/observers/Automoderation.js index 92c7baf..5d72679 100644 --- a/structure/client/components/observers/Automoderation.js +++ b/structure/client/components/observers/Automoderation.js @@ -188,7 +188,13 @@ module.exports = class AutoModeration extends Observer { //log += `\next reg: ${tmp}`; const fullWord = words.find((word) => word.includes(match[0])); - if (this.whitelist.find(fullWord) || whitelist.some((word) => word === fullWord)) continue; + let inWL = false; + try { // This is for debugging only + inWL = this.whitelist.find(fullWord); + } catch (err) { + this.client.logger.debug(fullWord, match[0], words); + } + if (inWL || whitelist.some((word) => word === fullWord)) continue; log += `\nMessage matched with "${reg}" in the regex list.\nMatch: ${match[0]}, Full word: ${fullWord}\nFull content: ${content}`; filterResult = { diff --git a/structure/interfaces/BinaryTree.js b/structure/interfaces/BinaryTree.js index 464e3f4..47ed616 100644 --- a/structure/interfaces/BinaryTree.js +++ b/structure/interfaces/BinaryTree.js @@ -64,7 +64,7 @@ class BinaryTree { */ find(val) { - val.toLowerCase(); + val = val.toLowerCase(); if(this.isEmpty()) return;