debug stuff

This commit is contained in:
Erik 2021-06-12 16:35:34 +03:00
parent d343c520de
commit 287bcd6cf4
No known key found for this signature in database
GPG Key ID: 7E862371D3409F16
2 changed files with 8 additions and 2 deletions

View File

@ -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 = {

View File

@ -64,7 +64,7 @@ class BinaryTree {
*/
find(val) {
val.toLowerCase();
val = val.toLowerCase();
if(this.isEmpty()) return;