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 |