From a1826e5c95496d938349a4a5a1d1660dedc94fd4 Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 24 Oct 2013 12:33:50 +0000 Subject: [PATCH] that should do it --- modules/lastfm/lastfm.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/lastfm/lastfm.js b/modules/lastfm/lastfm.js index 0da4c28..613367d 100644 --- a/modules/lastfm/lastfm.js +++ b/modules/lastfm/lastfm.js @@ -26,15 +26,15 @@ var lastfm = function(dbot) { 'json': true }, function(err, res, body) { if(_.has(body, 'error') && body.error == 6) { - callback('no_user', null); + callback('no_user', user, null); } else if(_.has(body, 'recenttracks') && !_.isUndefined(body.recenttracks.track[0])) { - callback(null, body.recenttracks.track[0]); + callback(null, user, body.recenttracks.track[0]); } else { - callback('no_listen', null); + callback('no_listen', user, null); } }); } else { - callback('no_profile', null); + callback('no_profile', user, null); } }.bind(this)); @@ -43,7 +43,7 @@ var lastfm = function(dbot) { this.commands = { '~listening': function(event) { - var outputListening = function(err, track) { + var outputListening = function(err, user, track) { if(!err) { var term = track.name + ' ' + track.artist['#text'], output = ''; @@ -90,7 +90,6 @@ var lastfm = function(dbot) { } }.bind(this)); } else { - user = event.rUser; this.api.getListening(event.rUser, outputListening); } }