Updated disabled module and trigger code.

This commit is contained in:
chris062689 2017-04-07 19:36:45 -04:00
parent 2509bd2179
commit af4fb4d2fc
1 changed files with 12 additions and 4 deletions

View File

@ -106,8 +106,12 @@ cachedModules = [];
require("fs").readdirSync('./commands/').forEach(function(file) { require("fs").readdirSync('./commands/').forEach(function(file) {
// Load the module if it's a script. // Load the module if it's a script.
if (path.extname(file) == '.js') { if (path.extname(file) == '.js') {
logger.info(`Loaded module: ${file}`); if (file.includes('.disabled')) {
cachedModules[file] = require(`./commands/${file}`); logger.info(`Did not load disabled module: ${file}`);
} else {
logger.info(`Loaded module: ${file}`);
cachedModules[file] = require(`./commands/${file}`);
}
} }
}); });
@ -116,8 +120,12 @@ cachedTriggers = [];
require("fs").readdirSync('./triggers/').forEach(function(file) { require("fs").readdirSync('./triggers/').forEach(function(file) {
// Load the trigger if it's a script. // Load the trigger if it's a script.
if (path.extname(file) == '.js') { if (path.extname(file) == '.js') {
logger.info(`Loaded trigger: ${file}`); if (file.includes('.disabled')) {
cachedTriggers.push(require(`./triggers/${file}`)); logger.info(`Did not load disabled trigger: ${file}`);
} else {
logger.info(`Loaded trigger: ${file}`);
cachedTriggers.push(require(`./triggers/${file}`));
}
} }
}); });