botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Doesn't seem to be a way to clear the iBotDataBags

Open rodzillarr opened this issue 10 years ago • 3 comments

I can overwrite key values but can't get rid of the keys. Haven't found any methods on any of the other objects to reset state.

Thanks!

Roland

rodzillarr avatar Apr 13 '16 18:04 rodzillarr

You don't say which platform library you are using, but you can clear out any botdata by calling the connector.Bots.SetBotData() with empty data property.

tomlm avatar Apr 13 '16 19:04 tomlm

Thanks Tom. I'm on C# working through the chat emulator. Having trouble finding access to the current connector instance.

rodzillarr avatar Apr 13 '16 20:04 rodzillarr

You can just new it up var connector = (message.From.ChannelId == "emulator") ? new ConnectorClient(new Uri("http://localhost:9000/api/messages"), new ConnectorCredentials());: new ConnectorClient();

tomlm avatar Apr 13 '16 20:04 tomlm