forked from GitHub/dbot
Complete project module (for now)
- Remove unused modules from ``config.json`` * Move config list stuff from ``onLoad`` to ``api`` The api call might be useful elsewhere
This commit is contained in:
parent
adcd5803b0
commit
9d727a211e
@ -33,7 +33,7 @@ var pages = function(dbot) {
|
||||
}
|
||||
|
||||
res.render('project', {
|
||||
"configList": "", // what variable do I put here
|
||||
"configList": dbot.modules.project.api.configList(), // what variable do I put here
|
||||
"name": dbot.config.name,
|
||||
"intro": dbot.t("dbotintro", {
|
||||
"botname": dbot.config.name
|
||||
|
@ -4,45 +4,44 @@
|
||||
* the dbot.
|
||||
*/
|
||||
|
||||
_ = require('underscore'),
|
||||
exec = require('child_process').exec;
|
||||
_ = require('underscore');
|
||||
|
||||
var project = function(dbot) {
|
||||
|
||||
this.onLoad = function() {
|
||||
var configList = function(){
|
||||
this.api = {
|
||||
'configList' : function(callback){
|
||||
var list = [];
|
||||
if(_.has(dbot.modules,'dent')){
|
||||
configList.push(dbot.t("dent-account", {
|
||||
list.push(dbot.t("dent-account", {
|
||||
"username": dbot.config.dent.username
|
||||
}));
|
||||
}
|
||||
if(dbot.config.dent.dentQuotes) {
|
||||
configList.push(dbot.t("dent-push"));
|
||||
list.push(dbot.t("dent-push"));
|
||||
}
|
||||
if(_.has(dbot.modules,'link')){
|
||||
if(dbot.config.link.autoTitle){
|
||||
configList.push(dbot.t("link-autotitle"));
|
||||
list.push(dbot.t("link-autotitle"));
|
||||
}
|
||||
}
|
||||
if(_.has(dbot.modules,'quotes')){
|
||||
configList.push(dbot.t("quote-rmlimit", {
|
||||
list.push(dbot.t("quote-rmlimit", {
|
||||
"limit": dbot.config.quotes.rmLimit
|
||||
}));
|
||||
}
|
||||
if(_.has(dbot.modules,'report')){
|
||||
if(dbot.config.report.notifyVoice){
|
||||
configList.push(dbot.t("report-notifyvoice"));
|
||||
list.push(dbot.t("report-notifyvoice"));
|
||||
}
|
||||
}
|
||||
if(_.has(dbot.modules,'web')){
|
||||
configList.push(dbot.t("web-port", {
|
||||
list.push(dbot.t("web-port", {
|
||||
"port": dbot.config.web.webPort
|
||||
}));
|
||||
}
|
||||
return list;
|
||||
}.bind(this);
|
||||
}.bind(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
exports.fetch = function(dbot){
|
||||
|
Loading…
Reference in New Issue
Block a user