Skip to content

Facebook Messenger

By connecting a DialoX bot to Facebook Messenger, it is possible to have conversations between Facebook users and your bot. To do this, you need to connect the bot to a Facebook page that you own. As soon as that is set up, the bot will handle the Messenger messages that are sent to it.

Installation

  • In your DialoX bot, go to the bot's settings and the "Connect" tab.
  • Click "Facebook Messenger" and click the button to enable it.
  • Now you need to log in with Facebook and grant DialoX permission to manage your Facebook pages.
  • Click the Facebook page you want to connect to your bot.
  • You can now go to Messenger and start chatting with your Facebook page.

Collaboration between Facebook Pages Inbox and DialoX

It is possible to set up the Facebook Pages Inbox as the primary means of handling user conversations.

To do this, you need to activate the "handover" protocol for your Facebook page. On your Facebook page, go to Page Settings > Messenger Platform > Subscribed Apps. Choose DialoX as the Primary receiver and Pages Inbox as the Secondary receiver, like shown in the screenshot.

facebook handover

First connect your DialoX bot to your Facebook page, otherwise you are not able to set it as primary receiver.

DialoX will now still handle all Facebook messages that are sent to it. For conversations that the bot handles will show up in the "Done" tab of the Pages Inbox.. As soon as you move them to the "Main" tab, you are taking over the conversation with the user, and the bot does not reply anymore. Only when you mark the conversation "Done" again, the bot will start to reply again.

Bubblescript Facebook operator events

When an operator takes over (moves the conversation to the "Main" tab of the Pages inbox, the $facebook_operator_join event is cast.

Note that at this point you should not say anything anymore because the inbox is now responsible for handling messages.

dialog event: "$facebook_operator_join" do
  tag "operator"
end

When the operator leaves the pages inbox and the bot takes control of the conversation again:

dialog event: "$facebook_operator_leave" do
  say "Is there anything else I can do?"
end