私はアクセス機能のための簡単なチャットボットを開発しています。私はパスワードリセット機能のためのプロンプトダイアログを持っている必要があります。 likeユーザーアカウントがforgotpassword/lockedの場合、私は秘密の質問にユーザーに尋ねています。そして、秘密の質問に対する回答が質問に一致している場合は、ユーザーに1回限りのパスワードを再試行するオプションを生成します。 ここは私のコードです.. boolChoice(LuisIntent)は、ユーザーがパスワードを忘れたくないときです。その後、私は答えが、その後のマッチングされ、私はワンタイムpassswordまたは私は再び彼を促すために必要なもの、次に一致しない場合、ユーザーに促すために必要がある場合は、何をする必要があるかResumeAfterSecretAnswer内部今プロンプトダイアログをパスワードリセット機能に使用する必要があります
if (boolChoice.ToLower().Equals("yes"))
{
PromptDialog.Text(
context: context,
resume: ResumeAfterSecretAnswer,
prompt: "Ok. I need you to answer your secret question: "+getSecretQuestionForUser(),
retry: "I didn't understand. Please try again.");
}
private string getSecretQuestionForUser()
{
return "What is your favorite color?";
}
private async Task ResumeAfterSecretAnswer(IDialogContext context, IAwaitable<string> result)
{
string answer = await result;
//suppose right answer is blue.. then what next i need to do . do I need to prompt here or how do I compare and generate the one time password.
// need a flow,...
}
を促すメッセージが表示されます。そして
私は流れに少し混乱しています..私はPromoptDialog.Confirmまたは何か他のものを使用する必要がpromptdialogた。..
は、今私は方法を変更した、ここで流れ... ...どうあるべきか 私が持っているは...今の答えが一致しない場合、私は他の部分には何をすべきか
private async Task ResumeAfterSecretAnswer(IDialogContext context, IAwaitable<string> result)
{
string answer = await result;
if (answer.ToLower() == getSecretAnswerForUser())
await context.PostAsync("Your One time password is: "+ getOneTimePasswordForUser());
else
await context.PostAsync("The answers do not match. Please try again.");
context.Wait(MessageReceived);
}
の方法を変更します。私は再びユーザーにプロンプトを出す必要があります..私はここでどのようにしたらいいですか...これを実現します。
助けてください。