mirror of
https://github.com/reality/dbot.git
synced 2024-11-24 04:49:25 +01:00
fix most of the sstats stuff, still got to do merge trigger
This commit is contained in:
parent
1037070bff
commit
34acae025b
@ -155,7 +155,7 @@ var commands = function(dbot) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
'~last': function(event) {
|
'~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) {
|
if(user) {
|
||||||
this.api.getUserStats(user.id, function(uStats) {
|
this.api.getUserStats(user.id, function(uStats) {
|
||||||
if(uStats && uStats.last) {
|
if(uStats && uStats.last) {
|
||||||
|
@ -20,7 +20,10 @@ var sstats = function(dbot) {
|
|||||||
// repetition
|
// repetition
|
||||||
'highscore': function(key, property, callback) {
|
'highscore': function(key, property, callback) {
|
||||||
var pList = {},
|
var pList = {},
|
||||||
|
pPointer = property;
|
||||||
|
if(!_.isArray(pPointer)) {
|
||||||
pPointer = property.split('.');
|
pPointer = property.split('.');
|
||||||
|
}
|
||||||
|
|
||||||
this.db.scan(key, function(item) {
|
this.db.scan(key, function(item) {
|
||||||
var id = item.id;
|
var id = item.id;
|
||||||
@ -55,7 +58,7 @@ var sstats = function(dbot) {
|
|||||||
|
|
||||||
'channelHighscore': function(key, server, channel, property, callback) {
|
'channelHighscore': function(key, server, channel, property, callback) {
|
||||||
var cId = channel + '.' + server;
|
var cId = channel + '.' + server;
|
||||||
var newProperty = 'channels.' + cId + '.' + property;
|
var newProperty = ['channels', cId, property];
|
||||||
this.internalAPI.highscore(key, newProperty, callback);
|
this.internalAPI.highscore(key, newProperty, callback);
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user