0

so i have to dialog activities, the 1st one for managing the user profile, the second will take car of the conversation.

       StateClient stateClient = activity.GetStateClient();
       BotData userData = await stateClient.BotState.GetUserDataAsync(activity.ChannelId, activity.From.Id);
            if (userData.GetProperty<bool>("ProfileDone") == false)
            {
                await Conversation.SendAsync(activity, () => new ProfileSetup());
            }
            else
            {
                await Conversation.SendAsync(activity, () => new RootLuisDi());
            }

Now when the 1st time interacting with the bot, it sends the user to the ProfileSetup, no issues. After completing the profile and set the ProfileDone flag to true. If the user interacts again it goes to RootLuisDi() but nothing trigger there. However, if I removed the conversation and chat again it actually works. !!

H. Rashid
  • 176
  • 13

1 Answers1

0

I wouldn't branch the conversation in the controller. My suggestion for you is to create a RootDialog and branch the conversation there calling/forwarding the messages to the other dialogs accordingly.

You could even use your RootLuisDi dialog as the root and branch the conversation there. Override the MessageReceived method, check for the profile flag and forward the message to the ProfileSetup dialog or call to the base.MessageReceived.

Check this to read more about how to initiate new dialogs.

Community
  • 1
  • 1
Ezequiel Jadib
  • 14,767
  • 2
  • 38
  • 43