forked from GitHub/dbot
some ufixes
This commit is contained in:
parent
bdbd5ee8e4
commit
27c150f877
@ -214,7 +214,10 @@ var commands = function(dbot) {
|
|||||||
|
|
||||||
async.eachSeries(pCounts, function(pCount, next) {
|
async.eachSeries(pCounts, function(pCount, next) {
|
||||||
dbot.api.users.getUser(pCount[0], function(err, user) {
|
dbot.api.users.getUser(pCount[0], function(err, user) {
|
||||||
pCount[0] = user.primaryNick; next();
|
if(user) {
|
||||||
|
pCount[0] = user.primaryNick;
|
||||||
|
}
|
||||||
|
next();
|
||||||
});
|
});
|
||||||
}, function() {
|
}, function() {
|
||||||
event.reply(this.internalAPI.formatHighscore('Top ' + word + ' users: ', pCounts));
|
event.reply(this.internalAPI.formatHighscore('Top ' + word + ' users: ', pCounts));
|
||||||
|
@ -48,7 +48,10 @@ var sstats = function(dbot) {
|
|||||||
|
|
||||||
async.eachSeries(pCounts, function(pCount, next) {
|
async.eachSeries(pCounts, function(pCount, next) {
|
||||||
dbot.api.users.getUser(pCount[0], function(err, user) {
|
dbot.api.users.getUser(pCount[0], function(err, user) {
|
||||||
pCount[0] = user.primaryNick; next();
|
if(user) {
|
||||||
|
pCount[0] = user.primaryNick;
|
||||||
|
}
|
||||||
|
next();
|
||||||
});
|
});
|
||||||
}, function() {
|
}, function() {
|
||||||
callback(pCounts);
|
callback(pCounts);
|
||||||
|
@ -76,6 +76,7 @@ var warning = function(dbot) {
|
|||||||
server = event.server;
|
server = event.server;
|
||||||
|
|
||||||
dbot.api.users.resolveUser(server, warnee, function(err, warnee) {
|
dbot.api.users.resolveUser(server, warnee, function(err, warnee) {
|
||||||
|
if(warnee) {
|
||||||
var warnings = 0;
|
var warnings = 0;
|
||||||
this.db.search('warnings', {
|
this.db.search('warnings', {
|
||||||
'server': server,
|
'server': server,
|
||||||
@ -95,6 +96,9 @@ var warning = function(dbot) {
|
|||||||
warnee.primaryNick }));
|
warnee.primaryNick }));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
event.reply(event.params[1] + ' not found.');
|
||||||
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user