An Azure service that provides an integrated environment for bot development.
Hello moonKnight,
Welcome to Microsoft Q&A and Thank you for the detailed explanation.
This is a very common point of confusion when working with Microsoft Teams and the Bot Framework SDK. The good news is that your implementation is technically correct. The behavior you're seeing is due to Microsoft Teams channel limitations, not an issue in your code.
You are correctly using connector.conversations.replyToActivity() with the proper conversationId and activityId, and you are also setting replyToId on the activity object. That is exactly how threaded replies should be created in channels that support nested replies. The fact that you receive a valid activity ID confirms that the message is being successfully delivered.
However, visual threading in Microsoft Teams depends on the conversation type, not just the presence of replyToId.
In Teams:
- 1:1 chats do not support threads
Group chats do not support threaded replies
Channel conversations support threaded replies
Since you're working in a group chat conversation, Teams does not support bot-created threaded replies in that context. When replyToActivity() is used in a conversation type that does not support nesting, the SDK falls back to SendToConversation. This matches the documentation note you found:
"If the channel does not support nested replies, ReplyToActivity falls back to SendToConversation."
That fallback is exactly what you are observing. The message is accepted by the platform, but Teams renders it as a new message at the bottom of the chat instead of inside a thread.
If you want proper threaded behavior, your bot must:
Be installed in a Team
Operate inside a channel conversation
Reply to the root post using replyToId (or replyToActivity())
You can confirm the conversation type by inspecting:
context.activity.conversation.conversationType
Possible values:
"personal" → 1:1 chat
"groupChat" → Group chat
"channel" → Teams channel thread
Only "channel" supports visual threading.
Even in channel conversations, there is one important limitation: Teams supports only single-level threading. You can reply to the root post, but you cannot create nested replies under replies.
Your code is correct.
replyToActivity() does not guarantee visual threading.
Teams group chats do not support threaded replies.
Threading works only in Teams channel conversations.
This is expected platform behavior, not an SDK bug.
Please refer this
- Activity Schema
- Send and receive messages with the Bot Connector API
- ConnectorClient class Method Details
I hope this helps, do let me know if you have any further queries.
Thank you!