コード例 #1
0
        /// <summary>
        /// Method called after the user has chosen which persona they'd like buddy to use.
        /// </summary>
        /// <param name="context">Mandatory. The context for the execution of a dialog's conversational process.</param>
        /// <param name="result">Mandatory. The user's preferred bot persona specified from the <see cref="PersonalityChoiceHeroCard"/>.</param>
        private async Task Resume_AfterBotPersonaChoice(IDialogContext context, IAwaitable <IMessageActivity> result)
        {
            var activity = await result;

            PersonalityChatPersona personaChoice = (PersonalityChatPersona)Enum.Parse(typeof(PersonalityChatPersona), activity.Text);

            context.Call(_dialogBuilder.BuildBotPersonaDialog(context.Activity.AsMessageActivity(), null, personaChoice), Resume_AfterBotPersonaDialog);
            await Task.CompletedTask;
        }
コード例 #2
0
 public async Task UpdatePreferredBotPersona(IDialogContext context, LuisResult result)
 {
     context.Call(_dialogBuilder.BuildBotPersonaDialog(GetMessageActivity(context), result.Entities, PersonalityChatPersona.None), Resume_AfterBotPersonaDialog);
     await Task.Yield();
 }