Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down