From 27bce53e2eea720ed88a66569f195cf99bd3c7e2 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Sun, 24 Jun 2012 23:30:11 +0100 Subject: [PATCH] oh whoops apparently I cant read --- modules/kick.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/kick.js b/modules/kick.js index 32e9050..ff1e42d 100644 --- a/modules/kick.js +++ b/modules/kick.js @@ -26,7 +26,13 @@ var kick = function(dbot) { // who have kicked other people the most. '~kickstats': function(event) { var orderedKickLeague = function(list, topWhat) { - var kickArr = Object.keys(list); + var kickArr = []; + for(var kickUser in list) { + if(list.hasOwnProperty(kickUser)) { + kickArr.push([kickUser, list[kickUser]]); + } + } + kickArr = kickArr.sort(function(a, b) { return a[1] - b[1]; }); kickArr = kickArr.slice(kickArr.length - 10).reverse(); var kickString = "Top " + topWhat + ": ";