From 0c8d0c8143a3ba763516be80b1ca372e10767d87 Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 31 Oct 2014 04:21:33 +0000 Subject: [PATCH] like --- modules/words/words.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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.'); } });