From a45c57803757afada82a07f183accc6412d6042e Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 31 Oct 2014 04:19:05 +0000 Subject: [PATCH] like --- modules/words/words.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/words/words.js b/modules/words/words.js index d870549..b1ed7f8 100644 --- a/modules/words/words.js +++ b/modules/words/words.js @@ -13,6 +13,21 @@ var words = function(dbot) { }); }, + '~like': function(event) { + var query = event.params[1]; + this.wn.word(query, {}, function(err, word) { + if(!err && word) { + word.related({ + 'limit': 10 + }, function(err, related) { + event.reply('Words related to ' + query + ': ' + + related[0].words.join(', ') + '.'); + }); + } + }); + + }, + '~etymology': function(event) { var query = event.params[1]; this.wn.etymologies(encodeURIComponent(query), {