the below code is getting error while deleting the message based on the channel id public async Task DeleteSentNotification( string conversationId, string recipientId, string serviceUrl, string tenantId, string name) { // Set the service URL in the trusted list to ensure the SDK includes the token in the request. MicrosoftAppCredentials.TrustServiceUrl(serviceUrl);
var conversationReference = new ConversationReference
{
ServiceUrl = serviceUrl,
Conversation = new ConversationAccount
{
TenantId = tenantId,
Id = conversationId,
name = name,(AdaptiveCard Json)
},
};
await this.botAdapter.ContinueConversationAsync(
botAppId: this.microsoftAppId,
reference: conversationReference,
callback: async (turnContext, cancellationToken) =>
{
try
{
// Delete message.
await turnContext.DeleteActivityAsync(conversationReference);
}
catch (ErrorResponseException e)
{
var errorMessage = $"{e.GetType()}: {e.Message}";
}
},
cancellationToken: CancellationToken.None);
// return response;
}
question from:https://stackoverflow.com/questions/65860117/how-to-delete-the-posted-adaptive-messge-in-msteams-using-c-sharp-code