Is there any way to setup a message to be sent every X minutes/hours?
I'd like for people to be able to setup a schedule for a message type. e.g. "Send me $STOCK stock price every X minutes" and then the bot creates a thread that spawns that often with the right context data to run correctly. I'm even happy to store the schedule information in an Azure Table, I'm just trying to figure out the best way to get the bot framework to let me spawn threads and then call into the messages controller.
+1
+1
So, are you saying I can post a message to a conversation which is originating from custom code?
So for example: User: Hi, remind me every day at 12 PM bot creates Azure scheduler Bot replies: Timer created Azure scheduler calls a custom endpoint User receives message: It is now 12 PM
How would the address look like that you're sending the message to? Are you pinging the bot endpoint directly or are you going through the bot-framework canvas?
but does it work now already also, that you can iniate a Skype Group message from botbuilder SDK?
What exactly do you mean by address? Do you mean that the bot should aske the user for a custom web hook which circumvents the bot canvas? So you're saying that this scenario is not directly supported by the bot framework?
Or are you saying that a bot can resume a conversation even after being idle for a while? Again, I'm not sure what you mean by address.
Thank you for your help on this, Alexey.
I am using C# but I found the following: https://docs.botframework.com/en-us/restapi/connector/#navtitle
The old direct line had a unique conversation ID so it wasn't possible to post messages to a slack conversation for example. Seems the new V3 API doesn't have that restriction though I have to verify it.
Also, the SDK seems to be calling these methods directly but I haven't looked at the low level calls yet.
So in short, it seems the scenario is possible though you would probably have to keep the conversation alive from the scheduler side. I would assume a conversation will expire if there's no activity for a while.
If your bot wants to send a proactive message, you can keep the ServiceUrl and the user’s ChannelAccount (extracted from one of the messages from that user) and use this data to send a new activity from your bot to that user using:
SendToConversationAsync(…), CreateConversationAsync(…), or CreateDirectConversation(…)