D
D
Deso Crew2020-11-24 18:18:56
Node.js
Deso Crew, 2020-11-24 18:18:56

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);
    })
    });

The question is, why don't the commands work? He sees them, but does not fulfill them.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question