Answer the question
In order to leave comments, you need to log in
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);
})
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question