1 2 3 4 5 6 7 8 9 10 11 12 | public async void PostMessage(string id, string msg) { MicrosoftAppCredentials Credentials = new MicrosoftAppCredentials("ID", "Password"); ConnectorClient connector = new ConnectorClient(new Uri("https://dev.botframework.com/"), Credentials); IMessageActivity newMessage = Activity.CreateMessageActivity(); newMessage.Type = ActivityTypes.Message; newMessage.Conversation = new ConversationAccount(null, id, null); newMessage.Text = msg; await connector.Conversations.SendToConversationAsync((Activity)newMessage); } |
Direct link: https://paste.plurk.com/show/2525228