Open tomorgan opened 11 months ago
looks like this feature request? https://techcommunity.microsoft.com/t5/teams-developer/how-to-send-a-message-to-a-thread-reply-using-botbuilder-4-0-sdk/m-p/3716974
I think this bug / missing feature is very annoying, especially since we make heavy use of group chats.
I think it's probably the same code, albeit a different usage scenario. In the other example, there was (I think) a 1-2-1 conversation between a user and a bot, where the OP wanted to perform a threaded reply.
In my example, it's a channel conversation where I want to perform a standard reply to a channel post, rather than starting a new post.
Quite possibly the code path is the same though.
But also - I would argue that the presence in the SDK of a ReplyToActivityAsync method, which does not actually perform a reply, is a bug and not a missing feature!
In hope this saves someone some time, we got replies working like this: connector.Conversations.SendToConversationAsync($"{groupChatId};messageid={conversationId}", (Activity) message);
Anxiously waiting to see something happen with this.
In hope this saves someone some time, we got replies working like this: connector.Conversations.SendToConversationAsync($"{groupChatId};messageid={conversationId}", (Activity) message);
thank you, it looks great. There my code,
await connectorClient.conversations.sendToConversation(
`${conversation_id};messageid=${activity_id}`,
replyCard
)
Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.
Version
Microsoft.Bot.Builder 4.21.2 .NET SDK
Describe the bug
The ConnectorClient.Conversations object has a method, SendToConversation(Async), which is used to send new message threads into a conversation. (a conversation in this instance could be 1:1 conversation with a user, or a channel chat). The method accepts an activity object and a conversation ID, and returns an Activity ID of the newly created activity. There is also a ReplyToActivityAsync method, which takes a single parameter, an Activity object. However, even when a message has a valid ReplyToID value, the reply is sent to Microsoft Teams as a new message, not a threaded reply. There is also a ConversationExtension method ReplyToActivityAsync, which exhibits the same behaviour.
To Reproduce
IMessageActivity newMessage = Activity.CreateMessageActivity();
newMessage.Type = ActivityTypes.Message;
newMessage.Text = messageText;
newMessage.ReplyToId = {activity_id};
newMessage.Conversation = new ConversationAccount();
newMessage.Conversation.Id = {conversation_id};
var response = await connector.Conversations.ReplyToActivityAsync((Activity)message);
Expected behavior
The message should be sent as a threaded reply to the provided activity.
Tracking Status
Dotnet SDK [TODO]()
Javascript SDK [TODO]()
Python SDK [TODO]()
Java SDK [TODO]()
Samples [TODO]()
Docs [TODO]()
Tools [TODO]()