I've created a FB chatbot with botkit and I'm trying to connect a dialogflow middleware.
For some reason, when I connect the middleware like so I don't get any response:
bot.js:
var dialogflowMiddleware = require('botkit-middleware-dialogflow')({
token: process.env.dialogflow
});
controller.middleware.receive.use(dialogflowMiddleware.receive);
controller.hears('test', 'message_received', dialogflowMiddleware.hears, function(
bot,
message
) {
console.log('MESSAGE:', message);
bot.reply(message, 'Hello!');
});
Things I've done:
- Use Dialogflow API v1
- Use correct client access token
- Corretly named my intent 'test'
- Removed the middleware and tested it was working (to ensure problem is down to something else)