Hy everyone,
For a project, i have to create a chatbot, first the user should choose a number betwen 1 and 5. At the end if the user write 1, the bot ask you to write :
- Your first name,
- Your last name,
- Your phone number
after the bot return your name, your phone number and display the welcomeMessage
if the user write 2, the bot ask you to write :
- Your adress,
- your birthday
after the bot return your adress, your birthday and the bot display the welcomeMessage
i used formflow in the beginning but it didn't work because i use SDKBotBuilder V4.
if (turnContext.Activity.Type == ActivityTypes.Message)
{
if ("1".Equals(turnContext.Activity.Text))
{
//name
//phoneNumer
}
else if ("2".Equals(turnContext.Activity.Text))
{
//adress
//birthday
}
else if ("3".Equals(turnContext.Activity.Text))
{
await turnContext.SendActivityAsync($"you choose 3");
}
else if ("4".Equals(turnContext.Activity.Text))
{
await turnContext.SendActivityAsync($"you choose 4");
}
else if ("5".Equals(turnContext.Activity.Text))
{
await turnContext.SendActivityAsync($"you choose 5");
}
else
{
await turnContext.SendActivityAsync($"choose a number between 1 and 5");
}
}