mirror of
https://github.com/yuzu-emu/Command-fix.git
synced 2024-11-22 16:25:42 +01:00
Only load scripts and modules that end in .js
This commit is contained in:
parent
e36ac7257a
commit
02ec9079ff
10
server.js
10
server.js
@ -21,12 +21,18 @@ client.on('ready', () => {
|
|||||||
|
|
||||||
// Cache all command modules.
|
// Cache all command modules.
|
||||||
require("fs").readdirSync('./commands/').forEach(function(file) {
|
require("fs").readdirSync('./commands/').forEach(function(file) {
|
||||||
cachedModules[file] = require(`./commands/${file}`);
|
// Load the module if it's a script.
|
||||||
|
if (path.extname(file) == '.js') {
|
||||||
|
cachedModules[file] = require(`./commands/${file}`);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Cache all triggers.
|
// Cache all triggers.
|
||||||
require("fs").readdirSync('./triggers/').forEach(function(file) {
|
require("fs").readdirSync('./triggers/').forEach(function(file) {
|
||||||
cachedTriggers.push(require(`./triggers/${file}`));
|
// Load the trigger if it's a script.
|
||||||
|
if (path.extname(file) == '.js') {
|
||||||
|
cachedTriggers.push(require(`./triggers/${file}`));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Initalize app channels.
|
// Initalize app channels.
|
||||||
|
Loading…
Reference in New Issue
Block a user