diff --git a/index.js b/index.js index 682fc10..c8b7f1c 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ const client = new Discord.Client() // Création de la variable client. const token = require("./jsons/token.json"); // Ici on cache le token dans le fichier token.json du répertoire courrant. (Cela me permet d'envoyer mon fichier Index.js vers GitHub sans me soucier.) const badlist = require("./jsons/badlist.json") // Ici on importe le fichier badlist.json pour une question d'hygiène de code. client.commands = new Discord.Collection(); // Création de la variable commande. +client.aliases = new Discord.Collection(); const fs = require('fs'); // Import de la bibliothèque "FS". // Chargement des différentes commandes du fichier /Commandes @@ -17,6 +18,9 @@ fs.readdir('./Commandes/', (error, f) => { console.log(`${f} commande chargée !`); client.commands.set(commande.help.name, commande); }); + commande.conf.aliases.forEach(alias => { // It could be that the command has aliases, so we go through them too + client.aliases.set(alias, commande.help.name); // If we find one, we add it to the client.aliases Collection +}); }); // Chargement des différents événements du fichier /Events