diff --git a/modules/words/words.js b/modules/words/words.js index b1ed7f8..34e17ab 100644 --- a/modules/words/words.js +++ b/modules/words/words.js @@ -16,13 +16,15 @@ var words = function(dbot) { '~like': function(event) { var query = event.params[1]; this.wn.word(query, {}, function(err, word) { - if(!err && word) { + if(!err && word[0]) { word.related({ 'limit': 10 }, function(err, related) { event.reply('Words related to ' + query + ': ' + related[0].words.join(', ') + '.'); }); + } else { + event.reply('Unknown word.'); } });