Answer the question
In order to leave comments, you need to log in
Why is the system not working?
Here is my fs.readDir code:
fs.readdir('./functions/',(err,files)=>{
if(err) console.log(err);
let jsfiles = files.filter(f => f.split(".").pop() === "js");
if(jsfiles.length <=0)console.log("Нет команд для загрузки!!");
console.log(`Загружено ${jsfiles.length} команд`);
jsfiles.forEach((f,i) =>{
let props = require(`./functions/${f}`);
console.log(`${i+1}.${f} Загружено!`);
client.commands.set(props.help.name,props);
})
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question