From 5cbb0362c08e1028e4aa8e866e745fad5b3917cd Mon Sep 17 00:00:00 2001 From: reality Date: Wed, 4 Feb 2015 17:04:50 +0000 Subject: [PATCH] karma --- modules/karma/karma.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/karma/karma.js b/modules/karma/karma.js index 3e9d1be..794d611 100644 --- a/modules/karma/karma.js +++ b/modules/karma/karma.js @@ -23,12 +23,14 @@ var karma = function(dbot) { this.commands = { 'karma': function(event) { var item = event.params[1] || event.user; - this.internalAPI.getKarma(event.server, target, function(err, karma) { - karma = karma.karma; - event.reply(dbot.t('karma', { - 'item': item, - 'karma': karma - })); + this.internalAPI.getKarma(event.server, item, function(err, karma) { + if(karma) { + karma = karma.karma; + event.reply(dbot.t('karma', { + 'item': item, + 'karma': karma + })); + } }); },