From 21ad6a073e384f27c7e08054e0e1baa408ab24b2 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Fri, 29 Apr 2022 00:35:54 +0300 Subject: [PATCH] cleanup --- .../components/observers/Automoderation.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/structure/components/observers/Automoderation.js b/src/structure/components/observers/Automoderation.js index a279cf6..2bafc99 100644 --- a/src/structure/components/observers/Automoderation.js +++ b/src/structure/components/observers/Automoderation.js @@ -183,7 +183,7 @@ module.exports = class AutoModeration extends Observer { try { // This is for debugging only inWL = this.whitelist.find(fullWord); } catch (err) { - this.logger.debug(`Whitelist.find error: ${fullWord} ${match[1]} ${words}`); + this.logger.error(`Whitelist.find error: ${fullWord} ${match[1]} ${words}`); } if (inWL || whitelist.some((word) => word === fullWord)) continue; @@ -288,18 +288,16 @@ module.exports = class AutoModeration extends Observer { }); - if (!action) { - this.logger.debug(log); - return; + if (action) { + log += `\nSanctioned`; + await this._moderate(action, wrapper, channel, member, wrapper.format('W_FILTER_ACTION'), filterResult); } - this.logger.debug(log + '\nSanctioned'); - await this._moderate(action, wrapper, channel, member, wrapper.format('W_FILTER_ACTION'), filterResult); - } else { - this.logger.debug(log); } + this.logger.debug(`${guild.name} WF DEBUG: ${log}`); + } async flagMessages(message, edited) {