in experimental/sso-with-skills/RootBot/Dialogs/MainDialog.cs [45:72]
protected override async Task<DialogTurnResult> OnBeginDialogAsync(DialogContext innerDc, object options, CancellationToken cancellationToken = default(CancellationToken))
{
if (innerDc.Context.Activity.Type == ActivityTypes.Message)
{
var text = innerDc.Context.Activity.Text.ToLowerInvariant();
// Top level commands
if (text == "signin" || text == "login" || text == "sign in" || text == "log in")
{
return await innerDc.BeginDialogAsync(nameof(SignInDialog), null, cancellationToken);
}
else if (text == "signout" || text == "logout" || text == "sign out" || text == "log out")
{
return await innerDc.BeginDialogAsync(nameof(SignOutDialog), null, cancellationToken);
}
else if (text == "token" || text == "get token" || text == "gettoken")
{
return await innerDc.BeginDialogAsync(nameof(DisplayTokenDialog), null, cancellationToken);
}
else
{
var skillResult = await innerDc.BeginDialogAsync(nameof(SkillDialog), new BeginSkillDialogOptions() { Activity = innerDc.Context.Activity }, cancellationToken);
return skillResult;
}
}
return await base.OnBeginDialogAsync(innerDc, options, cancellationToken);
}