Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
new startover message, supress completion in a few places
Browse files Browse the repository at this point in the history
  • Loading branch information
Darren Jefford committed Oct 23, 2019
1 parent 6a0c352 commit 448360a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ protected override async Task<InterruptionAction> OnInterruptDialogAsync(DialogC
return InterruptionAction.End;
}

case GeneralLuis.Intent.StartOver:
{
// No need to send the usual dialog completion message for utility capabilities such as these.
dc.SuppressCompletionMessage(true);

await dc.Context.SendActivityAsync(ActivityGenerator.GenerateFromLG(_templateEngine.EvaluateTemplate("StartOverMessage", userProfile)));

await dc.CancelAllDialogsAsync();

return InterruptionAction.End;
}

case GeneralLuis.Intent.Escalate:
{
await dc.Context.SendActivityAsync(ActivityGenerator.GenerateFromLG(_templateEngine.EvaluateTemplate("EscalateMessage", userProfile)));
Expand Down Expand Up @@ -228,7 +240,9 @@ protected override async Task OnMessageActivityAsync(DialogContext innerDc, Canc
}
else
{
await innerDc.Context.SendActivityAsync(ActivityGenerator.GenerateFromLG(_templateEngine.EvaluateTemplate("ConfusedMessage", userProfile)));
innerDc.SuppressCompletionMessage(true);

await innerDc.Context.SendActivityAsync(ActivityGenerator.GenerateFromLG(_templateEngine.EvaluateTemplate("UnableMessage", userProfile)));
}
}
}
Expand Down Expand Up @@ -338,7 +352,7 @@ private async Task CallQnAMaker(DialogContext innerDc, QnAMaker qnaMaker)
}
else
{
await innerDc.Context.SendActivityAsync(ActivityGenerator.GenerateFromLG(_templateEngine.EvaluateTemplate("ConfusedMessage", userProfile)));
await innerDc.Context.SendActivityAsync(ActivityGenerator.GenerateFromLG(_templateEngine.EvaluateTemplate("UnableMessage", userProfile)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.LanguageGeneration;
using Microsoft.Bot.Builder.Solutions.Extensions;
using Microsoft.Extensions.DependencyInjection;
using VirtualAssistantSample.Models;
using ActivityGenerator = Microsoft.Bot.Builder.Dialogs.Adaptive.Generators.ActivityGenerator;
Expand Down Expand Up @@ -75,6 +76,9 @@ public async Task<DialogTurnResult> FinishOnboardingDialog(WaterfallStepContext
await _accessor.SetAsync(sc.Context, userProfile, cancellationToken);

await sc.Context.SendActivityAsync(ActivityGenerator.GenerateFromLG(_templateEngine.EvaluateTemplate("HaveNameMessage", userProfile)));
await sc.Context.SendActivityAsync(ActivityGenerator.GenerateFromLG(_templateEngine.EvaluateTemplate("FirstPromptMessage", userProfile)));

sc.SuppressCompletionMessage(true);

return await sc.EndDialogAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
- Sure, let's try again.
- No problem, we can start over.

# FirstPromptMessage
- What can I help you with today?
- What can I do for you?
- Is there anything I can do for you?
- How can I help you?

# LogoutMessage
- OK, {RandName()}, you're signed out.
- Alright, {RandName()}, you’re signed out.
Expand Down

0 comments on commit 448360a

Please sign in to comment.