From 906291234b7f269a8b5db88d3bd0812e7b054b56 Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 17 Oct 2013 11:46:50 +0000 Subject: [PATCH] ~uncouth --- modules/sstats/commands.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/sstats/commands.js b/modules/sstats/commands.js index 7d28d92..e52720d 100644 --- a/modules/sstats/commands.js +++ b/modules/sstats/commands.js @@ -76,7 +76,6 @@ var commands = function(dbot) { } }, - // TODO: too much repeated code between loudest and cloudest yo '~loudest': function(event) { this.internalAPI.highscore('user_stats', 'lines', function(lCounts) { async.eachSeries(lCounts, function(lCount, next) { @@ -89,6 +88,18 @@ var commands = function(dbot) { }.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) { var pathString = 'channels.' + event.rChannel.id + '.lines'; this.internalAPI.highscore('user_stats', pathString, function(lCounts) {