From 17b6e7b54176ba61989d42df3adb2caefcc296d4 Mon Sep 17 00:00:00 2001 From: Navy Date: Wed, 9 Jun 2021 03:28:43 +0300 Subject: [PATCH] aaaa --- structure/client/components/observers/Automoderation.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/structure/client/components/observers/Automoderation.js b/structure/client/components/observers/Automoderation.js index a523c36..e4c9710 100644 --- a/structure/client/components/observers/Automoderation.js +++ b/structure/client/components/observers/Automoderation.js @@ -101,8 +101,13 @@ module.exports = class AutoModeration extends Observer { if (!msg.content) return; let log = `Message filter debug:`; log += `\nPre norm: ${msg.cleanContent}`; - console.log(msg.cleanContent); - const content = FilterUtil.normalise(FilterUtil.removeDiscordFormatting(msg.cleanContent)); + let content = null; + try { // NOTE: Remove try-catch after debug + content = FilterUtil.normalise(FilterUtil.removeDiscordFormatting(msg.cleanContent)); + } catch (err) { + this.client.logger.debug(log); + return; + } log += `\nNormalised: ${content}`; // match: what was matched |