I'm trying to intercept messages to send to my analytics server.
I'm looking to send it some data such as: messages
,intent
,resulted dialog
.
I tried to use the routing
middleware of universalBot
in this fashion:
bot.on('routing',(session)=>{
console.log(session.intent);
console.log(session);
})
But it seems like the intent is undefined
, and the only way I manage to see it is through triggerAction
=> onFindAction
function.
I can use this method but it seems like a hack, is there a good way to intercept the intent data with middleware?
I'm using the Node.js SDK with botbuilder-apiai