From b650d5a60a9d5360c9f205cf6a4b918e4ece0800 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Sun, 11 Jun 2023 22:54:07 +1000 Subject: [PATCH] Improve message filter, increase max listeners due to console warnings --- src/client.ts | 2 +- src/events/messageCreate.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.ts b/src/client.ts index b0fcfe4..f3770ef 100644 --- a/src/client.ts +++ b/src/client.ts @@ -84,7 +84,7 @@ export default class TClient extends Client { this.MPServerCache = {players: [], status: null, name: null} as MPServerCache; this.suggestion = new suggestion(this); this.repeatedMessages = {}; - this.setMaxListeners(20); + this.setMaxListeners(45); this.statsGraph = -60; } async init(){ diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index 348227f..9cc49af 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -3,7 +3,7 @@ import TClient from 'src/client'; export default { async run(client:TClient, message:Discord.Message){ if (message.author.bot || message.channel.type === Discord.ChannelType.DM) return; - const msgarr = message.content.toLowerCase().replaceAll(/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?\n]/g, ' ').split(' '); + const msgarr = message.content.toLowerCase().replaceAll(/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?\n?1234567890]/g, '').split(' '); let automodded: boolean; const Whitelist = [] // Array of channel ids for automod to be disabled in (Disables bannedWords and advertisement, mind you.)