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),