How to continue the dialogue without responding to the message with the buttons

82 Views Asked by At

I send a message using PromptCustomDialog. If a person cannot answer a question for some time, how can the next message be sent? I would be grateful for the examples.

await context.Forward(new PromptCustomDialog(message, answers), Complete, context.MakeMessage(), CancellationToken.None);

public async Task Complete(IDialogContext context, IAwaitable<string> result)
   {
        var res = await result;
        string response = res;
        await Choose(context, response);
    }
1

There are 1 best solutions below

6
On

This would require you to set some kind of timer that would trigger an event that would cause the bot to send out a proactive message to the user. You can read more about sending proactive messages here.

The only thing I would point out is that bots, like web services, are often running multiple instances across multiple servers (e.g. if you're deployed on Azure App Services), so you would need to use some kind of distributed, stateful timer service to help you with this to ensure that the timer fires and triggers the event no matter what server it originated from.