3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 22:39:26 +01:00

etymology

This commit is contained in:
reality 2013-12-27 16:24:16 +00:00
parent 18780b59b0
commit 563a9adaf9

View File

@ -13,6 +13,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() {
return (Math.round(Math.random()) - 0.5);