mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 00:03:09 +02:00
Update message.js
This commit is contained in:
parent
8a3c8ea4b2
commit
f292a3083c
@ -41,10 +41,10 @@ Type \`${config.prefix}new\` on the server to create a new ticket.`);
|
|||||||
* (no bots / self)
|
* (no bots / self)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const regex = new RegExp(`^(<@!?${client.user.id}>|\\${config.prefix})\\s*`);
|
const regex = new RegExp(`^(<@!?${client.user.id}>|\\${config.prefix.toLowerCase()})\\s*`);
|
||||||
if (!regex.test(message.content)) return; // not a command
|
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 args = message.content.slice(prefix.length).trim().split(/ +/);
|
||||||
const commandName = args.shift().toLowerCase();
|
const commandName = args.shift().toLowerCase();
|
||||||
const command = client.commands.get(commandName)
|
const command = client.commands.get(commandName)
|
||||||
|
Loading…
Reference in New Issue
Block a user