diff --git a/core/samples/CompatBot/EchoBot.cs b/core/samples/CompatBot/EchoBot.cs index 5ce32902..a1131d65 100644 --- a/core/samples/CompatBot/EchoBot.cs +++ b/core/samples/CompatBot/EchoBot.cs @@ -37,6 +37,9 @@ protected override async Task OnMessageActivityAsync(ITurnContext m.Name).ToList(), Formatting.Indented)); } - - - - // await turnContext.SendActivityAsync(MessageFactory.Text($"Send a proactive message `/api/notify/{turnContext.Activity.Conversation.Id}`"), cancellationToken); - + // Targeted Messaging via Core SDK (preferred): sends directly through ConversationClient + // to bypass the BF compat layer's ApplyConversationReference which would overwrite the Recipient. var incomingCoreActivity = ((Activity)turnContext.Activity).FromCompatActivity(); CoreActivity tm = CoreActivity.CreateBuilder() .WithConversation(new Conversation { Id = incomingCoreActivity.Conversation?.Id! }) @@ -101,6 +100,7 @@ await teamsBotApp.ConversationClient.AddReactionAsync( cancellationToken); await Task.Delay(500, cancellationToken); + await teamsBotApp.ConversationClient.AddReactionAsync( turnContext.Activity.Conversation.Id, res.Id, @@ -116,12 +116,13 @@ await teamsBotApp.ConversationClient.DeleteReactionAsync( turnContext.Activity.Conversation.Id, res.Id, "laugh", - //new Uri("https://pilot1.botapi.skype.com/amer/9a9b49fd-1dc5-4217-88b3-ecf855e91b0e/"), + //new Uri("https://pilot1.botapi.skype.com/amer/9a9b49fd-1dc5-4217-88b3-ecf855e91b0e/"), incomingCoreActivity.ServiceUrl!, AgenticIdentity.FromProperties(incomingCoreActivity.Recipient?.Properties), null, cancellationToken); + // Card submission triggers OnInvokeActivityAsync below. Attachment attachment = new() { ContentType = "application/vnd.microsoft.card.adaptive",