forked from GitHub/dbot
Change initialisation of kickArr to Object.keys rather than manually filling it...
This commit is contained in:
parent
253b9a75c4
commit
2b48d1a555
@ -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 + ": ";
|
||||
|
Loading…
Reference in New Issue
Block a user