botsmicrosoft-teamsteams-toolkit

How to reply to a message(existing conversation) in channel using teams bot


Suppose I have messageId of a Post in a teams channel. Is there a way to send reply to that post through BOT SDK api.

What I want to achieve --

Suppose there is a channel containing 40 posts. On calling the bot anywhere in the channel, send proactive replies to all these posts. The replies that I have to send are mapped with an api, which I can directly fetch.

I want through https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/main/samples/bot-initiate-thread-in-channel/python/app.py

Here a new conversation is being created before sending the reply.


Solution

  • I achieved this using Proactive Messaging. We can store conversation_references when mentioning the bot, and map them to activity id. (Here it was mapped to userId)