fix most of the sstats stuff, still got to do merge trigger

This commit is contained in:
reality 2014-09-04 13:04:15 +00:00
parent 1037070bff
commit 34acae025b
2 changed files with 5 additions and 2 deletions

View File

@ -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) {

View File

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