Forum Discussion
oclipa
Jan 27, 2021Copper Contributor
Manage a long-running operation How-To
I have been working through the "https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-long-operations-guidance?view=azure-bot-service-4.0" How-To but have hit a brick wall. I strongl...
oclipa
Jan 27, 2021Copper Contributor
I have one solution, but I don't know if it is the correct approach: if I add an override of OnMessageActivityAsync(), I can then trigger the dialog:
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
Logger.LogInformation("Running dialog with Message Activity.");
// Run the Dialog with the new message Activity.
await Dialog.RunAsync(turnContext, ConversationState.CreateProperty<DialogState>(nameof(DialogState)), cancellationToken);
}
I'm guessing this wasn't the solution intended by the author of the How-To, since they don't include that override in the example code, but at least it moves me forward for now...