From 405051211d60afa8a7fc4fc3fa5ffb456242973d Mon Sep 17 00:00:00 2001 From: Alejandro Sior Date: Fri, 19 Feb 2021 11:43:18 +0100 Subject: initial commit --- src/CommandLoader.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/CommandLoader.js (limited to 'src/CommandLoader.js') diff --git a/src/CommandLoader.js b/src/CommandLoader.js new file mode 100644 index 0000000..d38250b --- /dev/null +++ b/src/CommandLoader.js @@ -0,0 +1,12 @@ +const fs = require('fs'); + +module.exports = function CommandLoader(bot) { + fs.readdirSync('./src/cmd/').forEach(file => { + if (file.endsWith('.js')) { + let plugin = require(`./cmd/${file}`); + if (plugin.loadModule) { + plugin.loadModule(bot); + } + } + }); +}; -- cgit v1.2.3