'Microsoft Bot Framework Removing "Edited" annotation on message when updating bot message

I have built a MS Teams chatbot along with middleware that successfully proactively updates messages through a REST controller (I pass the conversation ID and activity ID to this REST endpoint).

I tested my implementation and everything works great except for this annoying

enter image description here

"Edited" header that appears. Functionally, it's not too important but the OCD in me wants to get rid of it. I'm wondering if I can get rid of this header by modifying any parameters of my Activity when passing the Activity through UpdateActivityAsync.



Solution 1:[1]

As far as I am aware, the only way to update a message previously sent by the bot and not have it display the Edited flag is to use adaptive cards with Universal Actions and even then only when the card was updated from an action button on the card (with Action.Execute).

You can send content to Teams as a plain text message or an adaptive card - with adaptive cards you can use the new-ish universal action model as documented here: https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/universal-actions-for-adaptive-cards/overview?tabs=mobile.

This model exists to give you the chance to ensure that a card has the most up-to-date content when being viewed (even after closing and re-opening the chat using the "refresh model") and also allows you to display contextual content for the current user if you're in a group or channel chat... this seems to have the subjectively nice side effect that when you update the card using the InvokeResponse after submitting content (by implementing/overriding OnAdaptiveCardInvoke depending on your language of choice), even though you can send brand new card content as an attachment in the response which updates the card in-place, it doesn't say "Edited" and doesn't even change the timestamp on the message.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Scott Perham