initial commit

This commit is contained in:
Aiden
2022-10-07 14:31:30 +02:00
parent b8b1aee4e6
commit f06f277329
18 changed files with 2606 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
const included = require("../../requires")
// Here you can add functions that will be run at each startup of the bot
module.exports = {
name:"reloadCommands",
async function(msg, args){
commands.clear()
var path = `${__dirname}/../../functions`
var folders = fs.readdirSync(path).filter(function (file) {
return fs.statSync(path+'/'+file).isDirectory();
});
folders.forEach(element => {
var commandFiles = fs.readdirSync(`${path}/${element}`).filter(file => file.endsWith('.js') && !file.startsWith("index"));
for (const file of commandFiles) {
delete require.cache[require.resolve(`${path}/${element}/${file}`)];
try {
const command = require(`${path}/${element}/${file}`);
commands.set(command.name, command);
} catch (error) {
console.log(error);
}
}
});
console.log(`Reloading ${commands.size} modules done`)
}
}