forked from GitHub/dbot
like
This commit is contained in:
parent
0c8d0c8143
commit
1b67b04630
@ -16,12 +16,16 @@ var words = function(dbot) {
|
||||
'~like': function(event) {
|
||||
var query = event.params[1];
|
||||
this.wn.word(query, {}, function(err, word) {
|
||||
if(!err && word[0]) {
|
||||
if(!err && word) {
|
||||
word.related({
|
||||
'limit': 10
|
||||
}, function(err, related) {
|
||||
event.reply('Words related to ' + query + ': ' +
|
||||
related[0].words.join(', ') + '.');
|
||||
if(related[0]) {
|
||||
event.reply('Words related to ' + query + ': ' +
|
||||
related[0].words.join(', ') + '.');
|
||||
} else {
|
||||
event.reply('No similar words found.');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
event.reply('Unknown word.');
|
||||
|
Loading…
Reference in New Issue
Block a user