Open joachimpr opened 5 years ago
same problem here, let me know if you find out the fix!
EDIT: Fixed - needed to add the SetAsync and then SaveChangesAsync
await BotAccessors.ConversationDataAccessor.SetAsync(turnContext, state);
await BotAccessors.ConversationState.SaveChangesAsync(turnContext);
Hi James,
I followed the states video (https://www.youtube.com/watch?v=ka0Am45Lo6k&t=58s) to a T. I have noticed that there have been some changes in the way states are managed (using accessors etc) since this video came out so I used the github code as a reference. Everything so far worked but for some reason my states are not saving. I had the same issue when following other tutorials and I don't know what I am doing wrong. The only changes I made is that in my states class, I changed the counter int to a name string value. My bot code looks like this:
The problem is that when saving the value to
state.name
, it cannot be retrieved with the next message that is retrieved indicating that my state is never saved. Any idea what I am doing wrong? The rest of the code all matches the code that is on github.