#type error : la commande pingn'a pas de nom

1 messages · Page 1 of 1 (latest)

sonic flower

const fs = require ("fs")

module.exports = async bot => {

fs.readdirSync ("./Commandes").filter(f => f.endsWith(".js")).forEach(async files => {

let command = require(../Commandes/${files})
if(command.name || typeof command.name !== "string") throw new TypeError(La commande ${files.slice(0, files.length - 3 )} n'a pas de nom ! )
bot.commands.set(command.name, command)
console.log(Commande${file} chargée avec succés !)
})
}