Facebook Structured Messages
Are Facebook's structured messages supported on this lib?
I'm using Node.js and I saw that on Session.ts there is a verification whether to send a text or an object. I was expecting this object to be of any type (as long as Facebook supported it).
I am sending a structured message JSON, but it is not sent to Facebook :(
This is a console.log output of the object I'm sending:
{
attachment: {
type: 'template',
payload: {
template_type: 'generic',
elements: [Object]
}
}
}
Is there a way to pass these messages through?
I followed this and able to send attachment to Facebook via Message.Attachments or Message.ChannelData.
http://stackoverflow.com/questions/37011994/microsoft-bot-framework-messages-with-buttons-in-facebook-messenger
I couldn't find an equivalent for Node.js
The closest I found was Session.createMessage(), but it assumes that I want to send a text. I guess I might have to fork it and verify if the argument is a string or an object?
{
text: {
attachment: {
type: 'template',
payload: [Object]
}
},
language: 'pt'
}
Ok, I managed to use "Session.sendMessage()", passing an attachment JSON, as described on the Send API documentation and it worked!