Skip to content

Instantly share code, notes, and snippets.

@dhinag
Created March 28, 2020 01:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhinag/13f7ef0c7ebe2e4d223bf62a0e1124a5 to your computer and use it in GitHub Desktop.
Save dhinag/13f7ef0c7ebe2e4d223bf62a0e1124a5 to your computer and use it in GitHub Desktop.
// Invoked when a conversation update activity is received from the external Azure Bot Service channel
// Start a Power Virtual Agents bot conversation and store the mapping
protected override async Task OnConversationUpdateActivityAsync(ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
{
AddConversationReference(turnContext.Activity as Bot.Schema.Activity);
await s_conversationManager.GetOrCreateBotConversationAsync(turnContext.Activity.Conversation.Id, _botService);
}
private void AddConversationReference(Bot.Schema.Activity activity)
{
var conversationReference = activity.GetConversationReference();
var convRefJson = JsonConvert.SerializeObject(conversationReference);
var response = RunFlow("https://prod-44.westus.logic.azure.com:443/workflows/13b923e53a14476ec53112f90/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=T1xN6wEvP0hL27BUY", convRefJson);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment