From 563a9adaf94fd7f2a2a23864c2c43f5f12741738 Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 27 Dec 2013 16:24:16 +0000 Subject: [PATCH] etymology --- modules/words/words.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/words/words.js b/modules/words/words.js index f6eb34f..477e259 100644 --- a/modules/words/words.js +++ b/modules/words/words.js @@ -12,6 +12,17 @@ var words = function(dbot) { } }); }, + + '~etymology': function(event) { + var query = event.params[1]; + this.wn.etymologies(encodeURIComponent(query), function(err, defs) { + if(!err && defs[0]) { + event.reply(query + ' etymology: ' + defs[0].text); + } else { + event.reply('No etymology found for ' + query); + } + }); + }, '~jimble': function(event) { event.reply(event.params[1].split('').sort(function() {