3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-30 16:09:27 +01:00
This commit is contained in:
reality 2014-11-29 05:02:11 +00:00
parent 1a144c6459
commit 42b8b1f6ba

View File

@ -65,10 +65,14 @@ var words = function(dbot) {
if(!err && word) { if(!err && word) {
this.wn.definitions(encodeURIComponent(word.word), function(err, defs) { this.wn.definitions(encodeURIComponent(word.word), function(err, defs) {
if(!err && defs[0]) { if(!err && defs[0]) {
if(!defs[0].match(/plural/i)) {
event.reply(dbot.t('def', { event.reply(dbot.t('def', {
'word': word.word, 'word': word.word,
'definition': defs[0].text 'definition': defs[0].text
})); }));
} else {
this.commands['rw'](event);
}
} else { } else {
event.reply(dbot.t('no_def', { 'word': query })); event.reply(dbot.t('no_def', { 'word': query }));
} }