Does the Bot Framework support Facebook Messenger's Button Template?

别来无恙 提交于 2020-07-22 06:12:11

问题


Facebook messenger's APIs support a message type called the "Button Template". This card type allows sending a message with text, then a list of buttons with different actions, as in the image below (from Facebook's documentation):

This template similar to the Generic template, which is what is produced by the Bot Framework's Hero cards, but is distinct in that it does not require a "Header" on the card, which is required by the Generic template.

I'm trying to figure out how to render this template using the Bot Framework -- we've gotten it to work in Facebook messenger by populating the MessageActivity.ChannelData with a custom model we created based on the JSON in Facebook's documentation, but this causes the message to fail to appear in the Bot Framework Emulator. Is there any way to render this template using official Bot Framework methods/classes?


回答1:


Short answer: No. The Emulator is not designed to test channel-specific functionality in this way.

You are on the right track using the channelData to store your custom message definition. But, as you already discovered, since you are wanting to test a FB-specific feature, the only way is to test on FB Messenger directly.



来源:https://stackoverflow.com/questions/45695613/does-the-bot-framework-support-facebook-messengers-button-template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!