Search code examples
c#botframeworkfacebook-messenger-bot

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


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):

enter image description here

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?


Solution

  • 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.