mirror of
https://github.com/yuzu-emu/Command-fix.git
synced 2024-11-25 06:25:39 +01:00
Updated disabled module and trigger code.
This commit is contained in:
parent
2509bd2179
commit
af4fb4d2fc
16
server.js
16
server.js
@ -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}`));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user