mirror of
https://github.com/reality/dbot.git
synced 2025-01-24 02:54:16 +01:00
Command properties may be specified in module config file [#125]
This commit is contained in:
parent
6b903407ed
commit
20ef3b6432
12
run.js
12
run.js
@ -161,6 +161,7 @@ DBot.prototype.reloadModules = function() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Load the module config data
|
// Load the module config data
|
||||||
|
var config = {};
|
||||||
try {
|
try {
|
||||||
var config = JSON.parse(fs.readFileSync(moduleDir + 'config.json', 'utf-8'))
|
var config = JSON.parse(fs.readFileSync(moduleDir + 'config.json', 'utf-8'))
|
||||||
this.config[name] = config;
|
this.config[name] = config;
|
||||||
@ -206,6 +207,17 @@ DBot.prototype.reloadModules = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load module commands with properties specified in config
|
||||||
|
if(module.commands && config.commands) {
|
||||||
|
for(key in config.commands) {
|
||||||
|
if(newCommands.hasOwnProperty(key)) {
|
||||||
|
for(var prop in config.commands[key]) {
|
||||||
|
newCommands[key][prop] = config.commands[key][prop];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Load module web bits
|
// Load module web bits
|
||||||
if(module.pages) {
|
if(module.pages) {
|
||||||
var newpages = module.pages;
|
var newpages = module.pages;
|
||||||
|
Loading…
Reference in New Issue
Block a user