Search code examples
c#botframework

Botframework reminder chatbot


Does anyone know how they made bot like this and this? I am using BotFramework V4 and C# and i need to make a reminder feature like this.Does this use proactive bot? and if yes can someone explain in layman how proactive bot works? Thanks!

Update:

enter image description here enter image description here


Solution

  • That likely uses proactive messaging, yes. I'm not sure if either of those use Bot Framework, but to do that in Bot Framework, you'll need proactive messaging.

    Samples:

    A proactive message is generally either:

    1. A message sent to a user that hasn't spoken with the bot before (this is how Teams defines it), or
    2. A message sent to a user that the bot has spoken with previously, but the message being sent is not really a part of the previous conversation (this is more how Bot Framework defines it)

    Please see the docs linked above for more detail.

    The gist of it, however, is that when a user talks with the bot, you save a reference to that conversation. At any future date that you want to talk to that user, you use that reference of the conversation (because it contains all of the pertinent user data) to message the user.

    The tricky part with something like a reminder, however, is having the bot perform it at a particular time. Something like Task.Delay doesn't work very well at scale over long periods of time. The best thing to do for long, time-based delays would be set up some kind of other server to keep track of the time. Once that time expires, send a request to the bot to send the proactive message. The Proactive Sample does something kind of like the last part of that by accepting requests at api/notify.