Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
When a message is edited by a bot, the edited message will not be automatically resent to the Teams channel or personal chat.
You can use the updateActivity method from the Bot Framework SDK to edit message. This method allows you to update the content of a previously sent message.
public async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
// Get the original message
var originalMessage = turnContext.Activity;
// Update the message content
originalMessage.Text = "This is the updated message.";
// Update the message using the updateActivity method
await turnContext.UpdateActivityAsync(originalMessage, cancellationToken);
// Send a confirmation message
await turnContext.SendActivityAsync("Message updated successfully.", cancellationToken: cancellationToken);
}
Thanks,
Prasad Das
If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.