4

We've developed a bot for our website which is used as a sort of messenger, the user selects if they want to speak to our support or chat team and it routes them to the correct team. The chat escalation and chat service is provided by Live Assist.

After developing the bot locally, all seemed to work fine, however once we launched it live, we discovered that the bot is only allowed one conversation at a time through Live Assist. What happens is anyone who opens the chat, no matter which device, is apart of the same single instance conversation. We contacted Live Assist and they said we require multiple bots to handle multiple chat instances. They did link us to a few of their online resources but they did not provide any advice for this particular problem (which we assume is a common one?)

I've been scratching my head at how something like this could be implemented, we are able to host multiple bots on Azure but I am stumped at finding a way to cleanly poll a bot to see if a conversation is in progress without interrupting that particular conversation. The only resource found which may assist is here however it is in node.js, whereas our solution is JavaScript on the front end and the bot code is C# .Net.

Any guidance would be greatly appreciated. Many thanks.

Edit: To clarify, we are wondering if what we want is possible, if it is possible to have multiple azure bot framework instances and reach them all through javascript on a webpage, poll if a chat is active, and then use a free bot for the user.

bmo
  • 105
  • 8

1 Answers1

1

In bot framework, there is no built-in feature to accomplish this since natively bot framework supports multiple concurrent conversations across all channels. As a workaround for the limitation of Live Assist let me share one idea I have.

You could in some sort of data store have a time that resets everytime a message is sent/received and once that timer expires that would qualify the bot as "not in a conversation". In this scenario when your webpage loads, it would ping your datastore to see which bot was available and if one is available, return the direct line secret token for the available bot. This would cause your front end to load up the chat for the correct bot. I do not have an implementation to share because I have never seen a scenario like this, but I hope this helps.

D4RKCIDE
  • 3,439
  • 1
  • 18
  • 34
  • 1
    Thanks for your suggestion Jason, this is the route I have taken. I Have an sql database set up which contains the information regarding which bots are active or not. Do you know how I would "ping" that database to see if a bot is active or not? The front end uses JavaScript and this is where I would like the secret to go to, so that I can place the secret in the declaration of the direct line bot. I cannot (and do not want to) fetch the value through connecting to the database via JS as there are security concerns around this. Is it possible to send the string from the bot to JS front end? – bmo Mar 28 '18 at 11:05
  • 2
    I didn't fully think this through and implement it, but could you somehow store a key value pair hash map that maps a secret to a number? That way you could just send a number instead of the secret. Just a thought. – D4RKCIDE Apr 02 '18 at 16:45
  • Just to follow through, I have managed to get a secret dynamically from an azure table (where the secret is only given if the bot is "free"), however we cannot inject the secret dynamically into the web page. We are not sure how to proceed from here, someone has suggested we get a token from a secret but I do not know if that would resolve the problem of dynamically generating a bot instance on a webpage. – bmo Apr 06 '18 at 07:59