mirror of
https://github.com/arthur-pbty/gestion.git
synced 2026-06-03 15:07:26 +02:00
add alias command name
This commit is contained in:
@@ -44,7 +44,16 @@ module.exports = {
|
||||
gestion: [],
|
||||
utils: [],
|
||||
};
|
||||
|
||||
let liste = [];
|
||||
for (const command of client.commands.values()) {
|
||||
const existingCommand = liste.find(cmd => cmd.name === command.name);
|
||||
if (!existingCommand) {
|
||||
liste.push(command);
|
||||
}
|
||||
}
|
||||
console.log(liste);
|
||||
for (const command of liste) {
|
||||
if (command.category) {
|
||||
categories[command.category].push({ name: command.name, description: command.description, emote: command.emote, utilisation: command.utilisation});
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
name: 'random',
|
||||
aliases: ['rand'],
|
||||
description: 'Affiche un nombre aléatoire entre 2 nombres donnés',
|
||||
emote: '🎲',
|
||||
utilisation: 'random [min] [max]',
|
||||
|
||||
@@ -16,6 +16,11 @@ module.exports = (client) => {
|
||||
delete require.cache[require.resolve(filePath)];
|
||||
const command = require(filePath);
|
||||
client.commands.set(command.name, command);
|
||||
if (command.aliases) {
|
||||
command.aliases.forEach(alias => {
|
||||
client.commands.set(alias, command);
|
||||
});
|
||||
}
|
||||
count++;
|
||||
} catch (error) {
|
||||
console.error(`Failed to load file: ${filePath}`); // Log any errors
|
||||
|
||||
Reference in New Issue
Block a user