Hi,
I am using .NET MS bot framework with directline API.
Now I am stuck in a scenario where I have to initiate a conversation from a bot to user like bot will say "Hey, you have .... work pending, would you like to do it now?" and rememeber there is no direct request from user, bot will intiate the Dialog and for this I am using quartz scheduler
So in my case I have impletemend a ProxyWebAPI which calls my bot throught Directline Api. So it will work like:
Request
Browser Chat window => ProxyWebAPI (Implements directline API) => Bot
Response
Bot => ProxyWebAPI (Implements directline API) => Browser Chat window
Now I want to generate a message from Bot to my Browser Chat window, can anyone please help me out?
Thanks!
Check out the answers to #1303, #1247, #1180, #1288
let us know if any of those help out!
Thanks @brandonh-msft
I couldn't get much help from these links.
The main doubt I have is that I have used quartz to activate Dialog from Bot side. So once timer elapsed a c# code will get execute and there I have placed a code to activate a dialog from bot to user.
Once this is done then I can't figure out how my ProxyWebAPI will recieve the message and how it will pass that message to my browser chat window.
The reason for my doubt is because there is NO REQUEST FROM THE USER here bot is initiating the conversation so how user will recieve a response without any request?
I don't know wherther I am on a right track or not so please guid me to the right direction
@gaurav-1989
If the user has never talked to the bot, then the bot has no idea who/where the user is. The user must first talk to the bot at least once so Bot Connector can associate a User ID & Channel ID which can be used henceforth to send "proactive" messages (this is what we call these) back to the user as-needed.
Think of it as trying to call somebody you've never met - you don't have their number until they contact you first.
@brandonh-msft
I understand this, I think you misunderstood me. Ofcourse user should have to communicate bot atleast once then only bot can send message back to that user in future.
But what I was trying to say is that suppose user communicated with bot a day before and when the same user will come on next day and after saying hi to bot and bot replied hello and after that he haven't typed anything for so long (lets say 15 mins) then I want my bot to say something to user proactively.
It means user haven't send any request and I want bot to send reply for which there is no request. I hope you got the point.
Hi @gaurav-1989, currently Direct Line only allows the client to initiate a conversation. The client does not have a webhook or address where it can be contacted. If the client is a web page, the code may not ever run again after the user departs.
In cases where the client code is able to run again, many developers use existing Notification systems (e.g. Azure Notification Hubs) to send a trigger to the client to open a new conversation with the bot.
Let me know if you have additional questions.
Hi @dandriscoll, are you planning to include the feature in further releases?
Hi @jcmontx, we don't have concrete plans to add a notification path. If one of the existing notification systems (like Azure Notification Hubs) doesn't meet your needs, let me know (in this thread with an at-mention, or in a new issue) and we can discuss in more detail.
@dandriscoll please provide some tutorial or code to use the same .
Most helpful comment
Check out the answers to #1303, #1247, #1180, #1288
let us know if any of those help out!