add alias systeme create , remove and list

This commit is contained in:
VALOU3336
2024-02-26 10:23:23 +01:00
parent e2290b0b7f
commit 91b20034d1
7 changed files with 259 additions and 5 deletions
+22 -3
View File
@@ -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);