From 98e7f74f69e801c11ec0b2e6a1521703cb1e4630 Mon Sep 17 00:00:00 2001 From: Navy Date: Sat, 12 Jun 2021 18:55:24 +0300 Subject: [PATCH] bug with whitelist check --- structure/client/components/observers/Automoderation.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/structure/client/components/observers/Automoderation.js b/structure/client/components/observers/Automoderation.js index 0680a6c..78d7e5d 100644 --- a/structure/client/components/observers/Automoderation.js +++ b/structure/client/components/observers/Automoderation.js @@ -182,11 +182,11 @@ module.exports = class AutoModeration extends Observer { for (const reg of regex) { - const match = content.match(new RegExp(`(?:^|\\s)${reg}`, 'iu')); // (?:^|\\s) |un + const match = content.match(new RegExp(`(?:^|\\s)(${reg})`, 'iu')); // (?:^|\\s) |un if (match) { //log += `\next reg: ${tmp}`; - const fullWord = words.find((word) => word.includes(match[0])); + const fullWord = words.find((word) => word.includes(match[1])); let inWL = false; try { // This is for debugging only @@ -350,7 +350,7 @@ module.exports = class AutoModeration extends Observer { }, []) }; - logChannel.send({ embed }); + const sent = await logChannel.send({ embed }); }