Пример #1
0
        protected virtual async Task <InterruptionStatus> OnHelp(DialogContext dc)
        {
            var view = new MainResponses();
            await view.ReplyWith(dc.Context, MainResponses.Help);

            // Signal the conversation was interrupted and should immediately continue
            return(InterruptionStatus.Interrupted);
        }
Пример #2
0
        private async Task <InterruptionAction> OnHelp(DialogContext dc)
        {
            var view = new MainResponses();
            await view.ReplyWith(dc.Context, MainResponses.ResponseIds.Help);

            // Signal the conversation was interrupted and should immediately continue
            return(InterruptionAction.MessageSentToUser);
        }
Пример #3
0
        protected override async Task OnStartAsync(DialogContext dc, CancellationToken cancellationToken = default(CancellationToken))
        {
            var view            = new MainResponses();
            var onboardingState = await _onboardingState.GetAsync(dc.Context, () => new OnboardingState());

            if (string.IsNullOrEmpty(onboardingState.Name))
            {
                await view.ReplyWith(dc.Context, MainResponses.ResponseIds.NewUserGreeting);
            }
            else
            {
                await view.ReplyWith(dc.Context, MainResponses.ResponseIds.ReturningUserGreeting);
            }
        }
Пример #4
0
        protected override async Task OnStartAsync(DialogContext innerDc, CancellationToken cancellationToken = default(CancellationToken))
        {
            var onboardingAccessor = _userState.CreateProperty <OnboardingState>(nameof(OnboardingState));
            var onboardingState    = await onboardingAccessor.GetAsync(innerDc.Context, () => new OnboardingState());

            var view = new MainResponses();
            await view.ReplyWith(innerDc.Context, MainResponses.Intro);

            if (string.IsNullOrEmpty(onboardingState.Name))
            {
                // This is the first time the user is interacting with the bot, so gather onboarding information.
                await innerDc.BeginDialogAsync(nameof(OnboardingDialog));
            }
        }