mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-04 15:56:42 +02:00
add alias systeme create , remove and list
This commit is contained in:
+22
-3
@@ -88,11 +88,30 @@ module.exports = (client) => {
|
||||
if (!message.content.startsWith(prefix) || message.author.bot) return;
|
||||
|
||||
const args = message.content.slice(prefix.length).trim().split(/ +/);
|
||||
const commandName = args.shift().toLowerCase();
|
||||
if (!client.commands.has(commandName)) return;
|
||||
const commandNameOrAlias = args.shift().toLowerCase();
|
||||
let commandName = commandNameOrAlias;
|
||||
//if (!client.commands.has(commandName)) return;
|
||||
for (const cmd in data.alias) {
|
||||
if (data.alias[cmd][commandNameOrAlias]) {
|
||||
commandName = cmd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const command = client.commands.get(commandName)
|
||||
|| client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
|
||||
|
||||
if (!command) {
|
||||
for (const cmd in data.alias) {
|
||||
if (data.alias[cmd][commandNameOrAlias]) {
|
||||
commandName = cmd;
|
||||
command = client.commands.get(commandName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!command) {
|
||||
return;
|
||||
}
|
||||
if (command) {
|
||||
const permissionLevel = await getPermissionLevel(message.member, client, guildId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user