我正在研究 MS Bot,现在卡在某一点上,我有两个问题
1) How can I get conversation count in MessageController Post method?
2) The values of userData as mentioned in below code becomes null, when bot came back to messagecontroller for further conversation. My bot flow is as below.
MessageController 类调用 (Chain.From(() => new BotManager()) -> 在 BotManager() 中列出了所有意图 -> 从 Intents 我跳转到特定表单,例如我有表单构建器的 SampleForm。
StateClient sc = activity.GetStateClient();
BotData userData = sc.BotState.GetUserData(activity.ChannelId, activity.From.Id);
UserDetails usr = new UserDetails();
usr.EmailId = "test@gmail.com";
userData.SetProperty<string>("EmailId", usr.EmailId);
sc.BotState.SetUserData(activity.ChannelId, activity.From.Id, userData);