1
votes

I have created ms teams Bot using Microsoft documentation https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/create-a-bot-for-teams

Bot is working fine but communication started if i do message from ms teams bot and OnMessageActivityAsync get called.

All good but i want to initiate communication from my api, i want to send message to team bot when data is added to database. how can i create instance of ITurnContext?

private static async Task SendMessage()
 {
   ITurnContext<IMessageActivity> turnContext;// how can i get this object?
   var message = MessageFactory.Text("Hi!");
   await turnContext.SendActivityAsync(message);
 } 

Thanks