dbot/modules/kick/pages.js

43 lines
1.1 KiB
JavaScript
Raw Normal View History

2013-08-18 22:23:13 +02:00
var _ = require('underscore')._;
var pages = function(dbot) {
return {
'/bans': function(req, res) {
2013-08-18 22:23:13 +02:00
res.render('servers', {
'servers': _.keys(dbot.config.servers)
});
},
2016-04-12 00:01:59 +02:00
'/underbans': function(req, res) {
this.db.search('nbans', { 'server': server }, function(ban) {
if(ban.reason.match('#underban')) {
bans.push(ban);
}
}, function() {
res.render('bans', {
'server': server,
'bans': bans
});
});
},
'/bans/:server': function(req, res) {
2013-08-18 22:23:13 +02:00
var server = req.params.server,
bans = [];
this.db.search('nbans', { 'server': server }, function(ban) {
bans.push(ban);
}, function() {
res.render('bans', {
'server': server,
'bans': bans
});
});
}
}
};
exports.fetch = function(dbot) {
return pages(dbot);
};