Чтобы перейти к следующему шагу диалога, вам необходимо вызвать NextAsync, следуя шагу, который включает карту.
Например,
private async Task<DialogTurnResult> StartSelectionStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
// Set the user's age to what they entered in response to the age prompt.
var userProfile = (UserProfile)stepContext.Values[UserInfo];
userProfile.Age = (int)stepContext.Result;
if (userProfile.Age < 25)
{
// If they are too young, skip the review selection dialog, and pass an empty list to the next step.
await stepContext.Context.SendActivityAsync(
MessageFactory.Text("You must be 25 or older to participate."),
cancellationToken);
return await stepContext.NextAsync(new List<string>(), cancellationToken);
}
else
{
// Otherwise, start the review selection dialog.
return await stepContext.BeginDialogAsync(nameof(ReviewSelectionDialog), null, cancellationToken);
}
}
В приведенном выше фрагменте, если пользователь не в правильном возрасте, отображается сообщение, говорящее об этом. Вызывается return await stepContext.NextAsync()
, который переводит диалог на следующий шаг. Если пользователь имеет возраст, то начинается новое диалоговое окно («ReviewSelectionDialog»). Фрагмент взят из документации "Создайте расширенный поток разговоров с использованием ветвей и петель", расположенной здесь , на которую вы можете ссылаться.
Надежда на помощь!