async Task OnAfterAnythingElse(IDialogContext context, IAwaitable <string> result) { var answer = await result.GetValueAsync <string>(); if (answer == BaseDialog.ChoiceYes) { await context.PostAsync("Ok - what else would you like to know about the team?"); } else { PopDialog(context); } }
/// <summary> /// Gets called if we checked the Q&A because the current dialog did not know an answer. /// </summary> /// <param name="context"></param> /// <param name="result">contains the answer found by the Q&A dialog or NULL if nothing found</param> /// <returns></returns> async Task OnResumeAfterQandAChecked(IDialogContext context, IAwaitable <object> result) { string foundAnswer = await result.GetValueAsync <string>(); if (string.IsNullOrWhiteSpace(foundAnswer)) { await ShowDefaultNotUnderstoodPicker(context, "Our FAQs don't seem to contain anything about your inquiry"); return; } await context.PostAsync($"This is what I found in the FAQs: {foundAnswer}."); WaitForNextMessage(context); }
async Task OnNotUnderstoodSelected(IDialogContext context, IAwaitable <object> result) { var selectedChoice = await result.GetValueAsync <string>(); switch (selectedChoice) { case NotUnderstood_PickerOption_BackToMain: PopToRootDialog(context); break; case NotUnderstood_PickerOption_KeepTrying: default: // Just wait for next message. await context.PostAsync("Ok!"); WaitForNextMessage(context); break; } }
async Task OnMainTopicSelectedAsync(IDialogContext context, IAwaitable <object> result) { string selectedChoice = await result.GetValueAsync <string>(); await ProcessSelectedMainMenuItemAsync(context, selectedChoice); }