diff --git a/modules/quotes/quotes.js b/modules/quotes/quotes.js index b694bea..8232888 100644 --- a/modules/quotes/quotes.js +++ b/modules/quotes/quotes.js @@ -25,6 +25,7 @@ var quotes = function(dbot) { interQuote = ''; } quote = quote.replace('~~' + ref + '~~', interQuote); + console.log('lol'); this.internalAPI.interpolatedQuote(server, channel, key, quote, callback); }.bind(this)); } diff --git a/modules/users/api.js b/modules/users/api.js index e0c55d2..a08c3cc 100644 --- a/modules/users/api.js +++ b/modules/users/api.js @@ -82,25 +82,23 @@ var api = function(dbot) { }); }, - 'getRandomChannelUser': function(server, channel, callback) { + 'getRandomChannelUser': function(server, cName, callback) { var channel; this.db.search('channel_users', { 'server': server, - 'channel': channel + 'name': cName }, function(result) { channel = result; }, function(err) { - if(!err) { + if(!err && channel) { if(!_.isUndefined(channel.users)) { var randomUser = channel.users[_.random(0, channel.users.length - 1)]; - this.api.resolveUser(server, randomUser, function(user) { - callback(user); - }); + this.api.getUser(randomUser, callback); } else { callback(false); } } - }); + }.bind(this)); }, 'getAllUsers': function(callback) {