Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fs = require('fs')
- module.exports = async bot => {
- fs.readdirSync("./Commands").filter(f => f.endsWith(".js")).forEach(async file => {
- let command = require(`../commands/${file}`)
- if(!command.name || typeof command.name !== "string") throw new TypeError(`La commende ${file.slice(0, file.length -3 )} n'est pas une commande valide`)
- bot.commands.set(command.name, command)
- console.log(`Commande ${file} chargée avec succès !`)
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement