From b1f450a3e1cf6d42b4146a3601e15e26dec72e15 Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 12 Apr 2013 21:16:56 +0000 Subject: [PATCH] quotes listener operational --- modules/quotes/quotes.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/quotes/quotes.js b/modules/quotes/quotes.js index 8c0ee8f..48e36cf 100644 --- a/modules/quotes/quotes.js +++ b/modules/quotes/quotes.js @@ -99,10 +99,11 @@ var quotes = function(dbot) { dbot.instance.emit(event); } } else if(event.action == 'JOIN') { - var userQuote = this.api.getQuote(event, event.user) - if(userQuote) { - event.reply(event.user + ': ' + this.api.getQuote(event, event.user)); - } + var userQuote = this.api.getQuote(event.user, function(quote) { + if(quote) { + event.reply(event.user + ': ' + quote); + } + }); } }.bind(this); this.on = ['PRIVMSG', 'JOIN'];