From f292a3083cfe3ed83918897436ab200910060635 Mon Sep 17 00:00:00 2001 From: Isaac Date: Mon, 7 Sep 2020 11:10:55 +0100 Subject: [PATCH] Update message.js --- src/events/message.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/events/message.js b/src/events/message.js index 3b70228..d115901 100644 --- a/src/events/message.js +++ b/src/events/message.js @@ -41,10 +41,10 @@ Type \`${config.prefix}new\` on the server to create a new ticket.`); * (no bots / self) */ - const regex = new RegExp(`^(<@!?${client.user.id}>|\\${config.prefix})\\s*`); - if (!regex.test(message.content)) return; // not a command + const regex = new RegExp(`^(<@!?${client.user.id}>|\\${config.prefix.toLowerCase()})\\s*`); + if (!regex.test(message.content.toLowerCase())) return; // not a command - const [, prefix] = message.content.match(regex); + const [, prefix] = message.content.toLowerCase().match(regex); const args = message.content.slice(prefix.length).trim().split(/ +/); const commandName = args.shift().toLowerCase(); const command = client.commands.get(commandName) @@ -108,4 +108,4 @@ Type \`${config.prefix}new\` on the server to create a new ticket.`); message.channel.send(`:x: An error occurred whilst executing the \`${command.name}\` command.`); } } -}; \ No newline at end of file +};