Return correct head info is related result term is given by UD [Close #341]

This commit is contained in:
reality 2013-04-12 18:33:49 +00:00
parent 3a33c2be04
commit e667d95ca8

View File

@ -84,7 +84,7 @@ var link = function(dbot) {
try { try {
var result = JSON.parse(body); var result = JSON.parse(body);
if(_.has(result, 'result_type') && result.result_type != 'no_results') { if(_.has(result, 'result_type') && result.result_type != 'no_results') {
event.reply(query + ': ' + result.list[0].definition.split('\n')[0]); event.reply(result.list[0].word + ': ' + result.list[0].definition.split('\n')[0]);
} else { } else {
event.reply(event.user + ': No definition found.'); event.reply(event.user + ': No definition found.');
} }