Skip to content

Instantly share code, notes, and snippets.

@adoprog
Created August 9, 2016 07:29
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 adoprog/6ded6a1eb1b223025980bb1924d95e27 to your computer and use it in GitHub Desktop.
Save adoprog/6ded6a1eb1b223025980bb1924d95e27 to your computer and use it in GitHub Desktop.
DirectLine post message
private void ImModality_InstantMessageReceived(object sender, MessageSentEventArgs e)
{
...
var botConversation = directLineCLient.Conversations.NewConversationWithHttpMessagesAsync().Result.Body;
// Send message from Lync to Bot Framework
var message = new Message();
message.ConversationId = botConversation.ConversationId;
message.Text = e.Text;
var result = directLineCLient.Conversations.PostMessageWithHttpMessagesAsync(botConversation.ConversationId, message).Result;
// Wait and then call to get the response back
directLineCLient.Conversations.GetMessagesWithHttpMessagesAsync(botConversation.ConversationId).Result;
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment