botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[C#][Facebook] Persistent Menu with Global Actions

Open Badolfo opened this issue 10 years ago • 4 comments

Hello,

Can anyone tell me where can I find some example on how to use new v3.1 Named Dialog Actions feature to implement global actions like help, resulting in a Facebook Persistent Menu?

Thanks,

Badolfo avatar Aug 08 '16 07:08 Badolfo

I don't think BotBuilder has support for that within the library.

I just POSTed the JSON according to Facebook's documentation. For the payload, I used something like "PAYLOAD_DELETE_DATA".

On the SDK, I used a Middleware to listen for incoming payload messages and treated the result/fired up the correct Dialogue.


 bot.use({
        botbuilder: function (session, next) {
            if (PAYLOAD_DELETE_DATA === session.message.text) {
                   session.beginDialog("/delete");
            }
            ...

matheus208 avatar Aug 08 '16 12:08 matheus208

I don't think BotBuilder has support for that within the library.

Oh, but it does! V3.1 release notes say: Form Flow for automatically generating a Bot from a C# class for filling in the class and that supports help, navigation, clarification and confirmation. I think the examples are just not yet available.

davyme avatar Aug 08 '16 14:08 davyme

You should be able to use ChannelData to send the native blob to Facebook - for example, see https://github.com/Microsoft/BotBuilder/issues/1077. @chrimc62 is there any Facebook persistent menu support in FormFlow?

willportnoy avatar Aug 26 '16 20:08 willportnoy

There is no Facebook persistent menu support in FormFlow directly, but you can override the IFormBuilder.Prompter with your own implementation of PromptAsyncDelegate which can do any mapping you like including to Facebook persistent dialogs.

chrimc62 avatar Sep 09 '16 22:09 chrimc62