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)
|
||||
*/
|
||||
|
||||
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.`);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user