From de3eb90ab55d93c53b748fe2cbfcb7c895a02527 Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 30 Aug 2013 02:55:20 +0000 Subject: [PATCH] ok i fixed it --- modules/quotes/quotes.js | 1 + modules/users/api.js | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) 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) {