This commit is contained in:
Erik 2021-06-09 03:28:43 +03:00
parent 8bbf3b6579
commit 17b6e7b541
No known key found for this signature in database
GPG Key ID: 7E862371D3409F16

View File

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