howdyai / botkit

Botkit is an open source developer tool for building chat bots, apps and custom integrations for major messaging platforms.
MIT License
11.48k stars 2.28k forks source link

Facebook's persistent menu doesn't work fine when button postback is selected #1010

Closed chakir-alaoui closed 7 years ago

chakir-alaoui commented 7 years ago

when a button postback is selected from the persistent menu, the chatbot shows the typing animation for 20~ seconds before failing with no message. Typing the exact message works fine.

I'm using the same persistent menu found in documentation :
controller.api.messenger_profile.menu([{ "locale":"default", "composer_input_disabled":false, "call_to_actions":[ { "title":"My Skills", "type":"nested", "call_to_actions":[ { "title":"Hello", "type":"postback", "payload":"Hello" }, { "title":"Hi", "type":"postback", "payload":"Hi" } ] }, { "type":"web_url", "title":"Botkit Docs", "url":"https://github.com/howdyai/botkit/blob/master/readme-facebook.md", "webview_height_ratio":"full" } ] }, { "locale":"zh_CN", "composer_input_disabled":false } ]);

ouadie-lahdioui commented 7 years ago

According to Facebook, bots' menus are cached locally, but updates are fetched periodically. If you update the menu while testing, you can force this fetch to happen by deleting the bot's thread and then beginning a new one.

You have a random or systematic error ?

benbrown commented 7 years ago

@chakir-alaoui in order to receive postbacks, you must listen for the facebook_postback event.

You can add this to your controller.hears() handlers to trigger handlers. Postbacks will automatically be used as part of any ongoing conversation.

Let us know if you continue to have issues.

chakir-alaoui commented 7 years ago

Thank you Ben,

I already did that , now it works fine.

Best regards,

Le 18 sept. 2017 21:47, "Ben Brown" notifications@github.com a écrit :

@chakir-alaoui https://github.com/chakir-alaoui in order to receive postbacks, you must listen for the facebook_postback event.

You can add this to your controller.hears() handlers to trigger handlers. Postbacks will automatically be used as part of any ongoing conversation.

Let us know if you continue to have issues.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/howdyai/botkit/issues/1010#issuecomment-330351150, or mute the thread https://github.com/notifications/unsubscribe-auth/AeDEUViIbV_AJ9G_2W4Xru51logYf7Loks5sjtbagaJpZM4PR_zx .