3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-30 16:09:27 +01:00
This commit is contained in:
reality 2013-10-17 11:46:50 +00:00
parent 74af9642e1
commit 906291234b

View File

@ -76,7 +76,6 @@ var commands = function(dbot) {
} }
}, },
// TODO: too much repeated code between loudest and cloudest yo
'~loudest': function(event) { '~loudest': function(event) {
this.internalAPI.highscore('user_stats', 'lines', function(lCounts) { this.internalAPI.highscore('user_stats', 'lines', function(lCounts) {
async.eachSeries(lCounts, function(lCount, next) { async.eachSeries(lCounts, function(lCount, next) {
@ -89,6 +88,18 @@ var commands = function(dbot) {
}.bind(this)); }.bind(this));
}, },
'~uncouth': function(event) {
this.internalAPI.highscore('user_stats', 'curses', function(lCounts) {
async.eachSeries(lCounts, function(lCount, next) {
dbot.api.users.getUser(lCount[0], function(user) {
lCount[0] = user.primaryNick; next();
});
}, function() {
event.reply(this.internalAPI.formatHighscore('Most uncouth users: ', lCounts));
}.bind(this));
}.bind(this));
},
'~cloudest': function(event) { '~cloudest': function(event) {
var pathString = 'channels.' + event.rChannel.id + '.lines'; var pathString = 'channels.' + event.rChannel.id + '.lines';
this.internalAPI.highscore('user_stats', pathString, function(lCounts) { this.internalAPI.highscore('user_stats', pathString, function(lCounts) {