When using the API as:
google(slackComment.toLowerCase().replace('.google ',''), function (err, next, links){
for (var i = 0; i < links.length; ++i) {
console.log(links[i].title + ' - ' + links[i].link) // link.href is an alias for link.link
console.log(links[i].description + "\n")
}
var botPayload = {
text : "google unavailable"
};
respond(res, userName, botPayload);
})
When using the API as: google(slackComment.toLowerCase().replace('.google ',''), function (err, next, links){ for (var i = 0; i < links.length; ++i) { console.log(links[i].title + ' - ' + links[i].link) // link.href is an alias for link.link console.log(links[i].description + "\n") } var botPayload = { text : "google unavailable" }; respond(res, userName, botPayload); })
links variable is always empty.