forked from GitHub/dbot
fucking idiot
This commit is contained in:
parent
b01fce2cc8
commit
80b76c9325
@ -176,13 +176,15 @@ var sstats = function(dbot) {
|
|||||||
this.api.getUserStats(oldUser.id, function(ouStats) {
|
this.api.getUserStats(oldUser.id, function(ouStats) {
|
||||||
this.api.getUserStats(newUser.id, function(nuStats) {
|
this.api.getUserStats(newUser.id, function(nuStats) {
|
||||||
_.each(ouStats, function(stat, key) {
|
_.each(ouStats, function(stat, key) {
|
||||||
if(_.isObject(stat) && key != 'creation') {
|
if(key != 'creation' && key != 'id') {
|
||||||
|
if(_.isObject(stat)) {
|
||||||
_.each(ouStats[key], function(stat, sKey) {
|
_.each(ouStats[key], function(stat, sKey) {
|
||||||
nuStats[key][sKey] += stat;
|
nuStats[key][sKey] += stat;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
nuStats[key] += stat;
|
nuStats[key] += stat;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.db.del('user_stats', oldUser.id, function() {});
|
this.db.del('user_stats', oldUser.id, function() {});
|
||||||
this.db.save('user_stats', newUser.id, nuStats, function() {});
|
this.db.save('user_stats', newUser.id, nuStats, function() {});
|
||||||
|
Loading…
Reference in New Issue
Block a user