From a68bde3d026134dc71bf1da156ef67cfcec53700 Mon Sep 17 00:00:00 2001 From: Ecolipsy Date: Thu, 2 Dec 2021 17:13:24 +0100 Subject: [PATCH] Fix things (hopefully) --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index ef6dd7b..0da2138 100644 --- a/index.js +++ b/index.js @@ -20,13 +20,12 @@ function parseCommands(){ if(categorydir == "fun") return; fs.readdirSync("Juustobotti/commands/" + categorydir).forEach(file => { if(isDir("Juustobotti/commands/" + categorydir + "/" + file)) return; - indexes.file = categorydir; - cmdFiles.push(file); + cmdFiles.push({file: file, dir: categorydir}); }); }); var cmds = []; cmdFiles.forEach(yes => { - var cmdObj = require("./Juustobotti/commands/" + indexes[yes] + "/yes"); + var cmdObj = require("./Juustobotti/commands/" + yes.dir + "/" + yes.file); cmds.push(cmdObj); }); return cmds;