Updated disabled module and trigger code.
This commit is contained in:
parent
2509bd2179
commit
af4fb4d2fc
|
@ -106,9 +106,13 @@ 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') {
|
||||||
|
if (file.includes('.disabled')) {
|
||||||
|
logger.info(`Did not load disabled module: ${file}`);
|
||||||
|
} else {
|
||||||
logger.info(`Loaded module: ${file}`);
|
logger.info(`Loaded module: ${file}`);
|
||||||
cachedModules[file] = require(`./commands/${file}`);
|
cachedModules[file] = require(`./commands/${file}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Cache all triggers.
|
// Cache all triggers.
|
||||||
|
@ -116,9 +120,13 @@ 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') {
|
||||||
|
if (file.includes('.disabled')) {
|
||||||
|
logger.info(`Did not load disabled trigger: ${file}`);
|
||||||
|
} else {
|
||||||
logger.info(`Loaded trigger: ${file}`);
|
logger.info(`Loaded trigger: ${file}`);
|
||||||
cachedTriggers.push(require(`./triggers/${file}`));
|
cachedTriggers.push(require(`./triggers/${file}`));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
data.readWarnings();
|
data.readWarnings();
|
||||||
|
|
Loading…
Reference in New Issue