diff --git a/modules/kick.js b/modules/kick.js index ff1e42d..32e9050 100644 --- a/modules/kick.js +++ b/modules/kick.js @@ -26,13 +26,7 @@ var kick = function(dbot) { // who have kicked other people the most. '~kickstats': function(event) { var orderedKickLeague = function(list, topWhat) { - var kickArr = []; - for(var kickUser in list) { - if(list.hasOwnProperty(kickUser)) { - kickArr.push([kickUser, list[kickUser]]); - } - } - + var kickArr = Object.keys(list); kickArr = kickArr.sort(function(a, b) { return a[1] - b[1]; }); kickArr = kickArr.slice(kickArr.length - 10).reverse(); var kickString = "Top " + topWhat + ": ";