问题
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