New to Node.js and not sure how to make use of these methods in a simple SLACK bot.... I want to call an external service to fetch data based on context variables from the conversation. THe variables are there now, I can see them coming across.
Questions:
A small example would be much appreciated, plz.
slackController.hears(['.*'], ['direct_message', 'direct_mention', 'mention'], function(bot, message) {
slackController.log('Slack message received');
//middleware.before(bot, message, function(beferr) {
// console.log('Inside the before method. messageB=' + JSON.stringify(message, 2, null));
//});
middleware.interpret(bot, message, function(err) {
if (!err)
bot.reply(message, message.watsonData.output.text.join('\n'));
console.log('**********>message.watsonData.context=' + JSON.stringify(message.watsonData.context, 2, null));
//console.log('message.watsonData.output=' + message.watsonData.output.text.join('\n'));
});
// middleware.after(bot, message, function(afterr) {
// console.log('Inside the after method. messageA=' + JSON.stringify(message, 2, null));