A
A
Alexander2020-02-16 20:46:08
Node.js
Alexander, 2020-02-16 20:46:08

How to make Discord bot upload multiple folders?

I need to organize all js files for my bot into folders and upload them all.
Now I have one folder where all js files are located. I load them in this way:

jsfiles.forEach((f,i) =>{
        let props = require(`./cmds/${f}`);
        console.log(`${i+1}.${f} Загружен!`);
        robot.commands.set(props.help.name, props);
    })

How to upload for example 3 folders with files?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
h0w4rd, 2020-02-16
@h0w4rd

Not entirely on topic, but I think it will help a lot in the future.
Better not make bikes and don't f*** your brain - https://github.com/discordjs/Commando .
Also, if it is fundamentally important to make your own bike, you can use the sources of one bot - https://github.com/thex49/aspire-bot . The bot is quite complex and is not written by a beginner, but the solutions there are effective and stable. For general development.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question