From 34acae025b07430b046d09e323cf5917c50e9a96 Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 4 Sep 2014 13:04:15 +0000 Subject: [PATCH] fix most of the sstats stuff, still got to do merge trigger --- modules/sstats/commands.js | 2 +- modules/sstats/sstats.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/sstats/commands.js b/modules/sstats/commands.js index 20e71c9..fb61f1e 100644 --- a/modules/sstats/commands.js +++ b/modules/sstats/commands.js @@ -155,7 +155,7 @@ var commands = function(dbot) { }, '~last': function(event) { - dbot.api.users.resolveUser(event.server, event.params[1], function(user) { + dbot.api.users.resolveUser(event.server, event.params[1], function(err, user) { if(user) { this.api.getUserStats(user.id, function(uStats) { if(uStats && uStats.last) { diff --git a/modules/sstats/sstats.js b/modules/sstats/sstats.js index 504c24f..71a4ac8 100644 --- a/modules/sstats/sstats.js +++ b/modules/sstats/sstats.js @@ -20,7 +20,10 @@ var sstats = function(dbot) { // repetition 'highscore': function(key, property, callback) { var pList = {}, + pPointer = property; + if(!_.isArray(pPointer)) { pPointer = property.split('.'); + } this.db.scan(key, function(item) { var id = item.id; @@ -55,7 +58,7 @@ var sstats = function(dbot) { 'channelHighscore': function(key, server, channel, property, callback) { var cId = channel + '.' + server; - var newProperty = 'channels.' + cId + '.' + property; + var newProperty = ['channels', cId, property]; this.internalAPI.highscore(key, newProperty, callback); }.bind(this),