Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2021
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. const fs = require("fs");
  2.  
  3. module.exports = async client => {
  4. const folders = fs.readdirSync("./commands/");
  5. for (const files of folders) {
  6. const folder = fs
  7. .readdirSync(`./commands/${files}/`)
  8. .filter(file => file.endsWith(".js"));
  9. for (const commands of folder) {
  10. const command = require(`../commands/${files}/${commands}`);
  11. const commandName = commands.split(".")[0];
  12. console.log(`Command Loaded ${commands}`);
  13. client.commands.set(commandName, command);
  14. command.help.aliases.forEach(alias => {
  15. client.aliases.set(alias, commandName);
  16. });
  17. }
  18. }
  19. };
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement