Skip to content

Instantly share code, notes, and snippets.

@r4hulp r4hulp/AnyDialog.cs
Created Dec 29, 2017

Embed
What would you like to do?
Retrieve user data
//In your dialog
Activity message = result as Activity;
//Create scope with respect to activity
using (var scope = DialogModule.BeginLifetimeScope(Conversation.Container, message))
{
//Resolve scope for IBotDataStore<BotData>
IBotDataStore<BotData> stateStore = scope.Resolve<IBotDataStore<BotData>>();
/* Retrieve user address. Address key holds information about Bot, Channel, User and conversation */
Address key = Address.FromActivity(message);
//Load user data with the help of key
BotData userData = await stateStore.LoadAsync(key, BotStoreType.BotUserData, CancellationToken.None);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.