facebookbotsfacebook-messenger

Is is possible to create a custom messenger bot on Facebook?


I would like to know that we are having a lead generation campaign running on Facebook but few of the times our staff isn't available to answer the query on Facebook messenger, so based on that short-coming I am thinking to devise a mechanism that "If within 1 hour of user's message no one replies to him then an automated BOT message should get sent to him."

Please don't deprecate this question as it is based entirely on knowledge. And if perhaps someone has hints or links on how to achieve this thing then I will really appreciate it.

Thanks.


Solution

  • Some options:

    1. You can query your /conversations edge every X minutes to detect when there is a message from a user which has not been replied to, then you would send the automated message using Send API. https://developers.facebook.com/docs/graph-api/reference/v10.0/conversation https://developers.facebook.com/docs/messenger-platform/reference/send-api/

    2. You can use webhook data for incoming messages to create a task that will run at received_time + 60 minutes, find the thread in your conversations edge based on PSID and then check if there has been a reply

    3. Alternatively you can check out Handover Protocol which allows a Page to simultaneously use a Messenger Bot and Live chat agent to handle messaging https://developers.facebook.com/docs/messenger-platform/handover-protocol/