diff options
| author | Alejandro Sior <aho@sio.be> | 2021-02-19 11:43:18 +0100 |
|---|---|---|
| committer | Alejandro Sior <aho@sio.be> | 2021-02-19 11:43:18 +0100 |
| commit | 405051211d60afa8a7fc4fc3fa5ffb456242973d (patch) | |
| tree | dbae34350c3a54f422da70f1b7fbd857a8f5a116 /src/CommandLoader.js | |
initial commit
Diffstat (limited to 'src/CommandLoader.js')
| -rw-r--r-- | src/CommandLoader.js | 12 |
1 files changed, 12 insertions, 0 deletions
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); + } + } + }); +}; |
