From cae412ab3fe3f9be05ee61eaa69923d660ce29d5 Mon Sep 17 00:00:00 2001 From: Eduardo Aznar Date: Wed, 25 Jan 2023 21:17:12 +0100 Subject: [PATCH] Bug fix --- src/utils/commandHandler.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/commandHandler.ts b/src/utils/commandHandler.ts index 1f381efc5..8d5200301 100644 --- a/src/utils/commandHandler.ts +++ b/src/utils/commandHandler.ts @@ -81,8 +81,9 @@ export default async (message: Eris.Message) => { const commandRequested = content.toLowerCase(); // Case insensitive match const matchedPrefix = commandRequested.match(prefixRegex)?.[0]; - if (matchedPrefix == null) return; - if (!commandRequested.startsWith(matchedPrefix)) return; + + if (!matchedPrefix) return; + const commandRequestedWithoutPrefix = commandRequested .replace(matchedPrefix, "") .trim();