I have a bot that I've built and deployed to Azure. All is working great. At the moment we are only targeting Facebook Messenger.
The scenario I need to handle is during a converstion between a user and the bot, the owner of the page may step into a conversation.
At this point I want the bot to stop responding and allow the page owner to have the conversation with the user.
I can't seem to find much documentation talking about this simple scenario, most scenarios talk about handing off a conversation to a team of customer support people. Which is a much more sophisticated scenario.
How can I achieve this?
I did try setting the bot as the Primary receiver
on the page and set the Inbox as the Secondary receiver
. The problem with this approach is that it marks all the messages and conversations as Done
and moved them into the page owners Done
inbox. This isn't the scenario we want.
Has anyone handled a similar situation?
I honestly cannot tell how this could work without having the primary/secondary responders setup thus enabling thread control to be passed between the two. Although I hope I'm wrong and there is a simple approach / solution.
Possible Solution
One technique I'm investigating is related to this:
https://github.com/palindromed/Bot-HandOff/blob/master/handoff.ts
Since our bot doesn't really have anything to handoff too I just want the bot to stop responding to messages when a page admin dives in and sends a message to the user.
I kind of bot muter middleware. The current trick here is going to be detecting that a particular user is a page admin.
It turns out the Bot Framework connector was not set up to forward the events that are necessary for working with the Messenger platform's handover protocol, but recent updates have fixed this. I have written a blog post explaining everything you need to know about the handover protocol: https://blog.botframework.com/2019/06/03/using-the-facebook-messenger-handover-protocol-with-the-microsoft-bot-framework/