I'm trying to send an activity with an adaptive card attachment and include a mention to the user who created the post. From reading online I found you can't currently include mentions in adaptive cards. Is there a way to mention someone when sending the activity, for example in another attachment?. I have tried setting the activity.Text = mention, this works however it creates two posts, the first with the mention and then another post with the adaptive card as a separate message. I feel there must be a way to do this, else if you created a post and someone responded to you, you'd never know automatically on reply. Also note I'm not using Flow. Code Teams Post
Have you thought about (a) sending the adaptive card and (b) sending a "Reply" message to the original Adaptive Card you sent? I haven't done this before, but I'm guessing the id that comes back from turnContext.SendActivityAsync
(on the ResourceResponse instance) is the id you can use to "reply" to the message you just created.
Update: I got it working. This is -very- rough code but hopefully enough that you can figure out/adjust to your scenario:
var result = connector.Conversations.SendToConversationAsync([your conversation id], activity).Result;
// I'm re-using the same activity just as a test, you can do whatever (e.g. create a new one)
activity.Text = "Msg 2";
var conversationReference = activity.GetReplyConversationReference(result);
conversationReference.Conversation.Id = conversationReference.Conversation.Id + ";messageid=" + result.Id;
activity.ApplyConversationReference(conversationReference);
connector.Conversations.SendToConversationAsync(conversationReference.Conversation.Id, activity);
So note, really important, you need to change your conversation id to add ";messageid=" to the end, and ADD the reference the message you just posted.
Hope that helps, and thanks for this - gave me a chance to learn something useful!
I'm just realising I've sent you several answers the last few weeks, but none seems to have been "Accepted". Was it something I said??
Sorry, I'm fairly new to posting! I was pressing the up button, but don't have the reputation yet, didn't see the Tick represented the accepted answer, apologies! Will go back today and mark them(sorry again). They have all helped me progress further. Good idea, will try your suggestion now.
no worries, was only kidding and glad to help. Let me know how this goes, would love to know if it works.
fyi on this - "upvote" is useful to future viewers to help indicate the answer was helpful, but "accept" indicates that it's correct, so people will know you've accepted it as such, and it can help them with the same/a similar problem
I'm just reading your original question again and wondering - maybe the adaptive card itself should be a reply to the original message...