3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-18 08:32:42 +01:00
This commit is contained in:
reality 2013-12-27 16:35:04 +00:00
parent 5c34719ad1
commit b008f28406

View File

@ -16,9 +16,8 @@ var words = function(dbot) {
'~etymology': function(event) { '~etymology': function(event) {
var query = event.params[1]; var query = event.params[1];
this.wn.etymologies(encodeURIComponent(query), function(err, defs) { this.wn.etymologies(encodeURIComponent(query), function(err, defs) {
console.log(defs);
if(!err && defs[0]) { if(!err && defs[0]) {
event.reply(query + ' etymology: ' + defs[0].text); event.reply(query + ' etymology: ' + defs[0].replace(/<\/?[^>]+(>|$)/g, "");
} else { } else {
event.reply('No etymology found for ' + query); event.reply('No etymology found for ' + query);
} }