3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-23 20:39:25 +01:00

ok i fixed it

This commit is contained in:
reality 2013-08-30 02:55:20 +00:00
parent 3ce44418e7
commit de3eb90ab5
2 changed files with 6 additions and 7 deletions

View File

@ -25,6 +25,7 @@ var quotes = function(dbot) {
interQuote = ''; interQuote = '';
} }
quote = quote.replace('~~' + ref + '~~', interQuote); quote = quote.replace('~~' + ref + '~~', interQuote);
console.log('lol');
this.internalAPI.interpolatedQuote(server, channel, key, quote, callback); this.internalAPI.interpolatedQuote(server, channel, key, quote, callback);
}.bind(this)); }.bind(this));
} }

View File

@ -82,25 +82,23 @@ var api = function(dbot) {
}); });
}, },
'getRandomChannelUser': function(server, channel, callback) { 'getRandomChannelUser': function(server, cName, callback) {
var channel; var channel;
this.db.search('channel_users', { this.db.search('channel_users', {
'server': server, 'server': server,
'channel': channel 'name': cName
}, function(result) { }, function(result) {
channel = result; channel = result;
}, function(err) { }, function(err) {
if(!err) { if(!err && channel) {
if(!_.isUndefined(channel.users)) { if(!_.isUndefined(channel.users)) {
var randomUser = channel.users[_.random(0, channel.users.length - 1)]; var randomUser = channel.users[_.random(0, channel.users.length - 1)];
this.api.resolveUser(server, randomUser, function(user) { this.api.getUser(randomUser, callback);
callback(user);
});
} else { } else {
callback(false); callback(false);
} }
} }
}); }.bind(this));
}, },
'getAllUsers': function(callback) { 'getAllUsers': function(callback) {