diff --git a/modules/link/link.js b/modules/link/link.js index 5382f56..cf26bc6 100644 --- a/modules/link/link.js +++ b/modules/link/link.js @@ -61,21 +61,21 @@ var link = function(dbot) { } else { event.reply(dbot.t("no-hits")); } - }); - } - }, + }); + } + }, '~ud': function(event) { - var query = event.input[1]; + var query = event.input[1]; var reqUrl = 'http://api.urbandictionary.com/v0/define?term=' + encodeURI(query); request(reqUrl, function(error, response, body) { try { - var result = JSON.parse(body); - if(_.has(result, 'result_type') && result.result_type != 'no_results') { - event.reply(query + ': ' + result.list[0].definition.split('\n')[0]); - } else { - event.reply(event.user + ': No definition found.'); - } + var result = JSON.parse(body); + if(_.has(result, 'result_type') && result.result_type != 'no_results') { + event.reply(query + ': ' + result.list[0].definition.split('\n')[0]); + } else { + event.reply(event.user + ': No definition found.'); + } } catch(err) { } }); }