i would like to add aliases in my code but i dont know how to embed it. You have an idea ?
fs.readdir("./commands/", (err, files) => {
if (err) return console.error(err);
files.forEach(file => {
if (!file.endsWith(".js")) return;
let props = require(`./commands/${file}`);
let commandName = file.split(".")[0];
console.log(`Attempting to load command ${commandName}`);
client.commands.set(commandName, props);
});
});
You can setup your command files to have aliases in them like this:
Then if you wanted to find a command by it's alias you can use:
You can find more about using aliases in this guide