I am new to Bot Framework and just started using the Echo Bot example using C# . However, in the end, I want to integrate my bot to Teams channel and one of the dialogue flow will need to consolidate information from multiple API and send it to the user.
I figured we can use 'ColumnSet' to display data in table format from how-to-display-data-in-table-format-in-microsoft-bot-framework
Now that I have the adaptive card JSON object (the data in a table), I am not sure where and how do I exactly integrate this adaptive card component to the echo bot script. Few examples showed storing the Adaptive card JSON and reading from a path and sending it as an attachment, but I am still not clear.
Below is the C# bot code (Echobot.cs) in the echo bot project folder. Should a create a different function for implementing the adaptive card ?
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Schema;
namespace Microsoft.BotBuilderSamples.Bots
{
public class EchoBot : ActivityHandler
{
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
var replyText = $"Echo: {turnContext.Activity.Text}";
await turnContext.SendActivityAsync(MessageFactory.Text(replyText, replyText), cancellationToken);
}
protected override async Task OnMembersAddedAsync(IList<ChannelAccount> membersAdded, ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
{
var welcomeText = "Hello and welcome!";
foreach (var member in membersAdded)
{
if (member.Id != turnContext.Activity.Recipient.Id)
{
await turnContext.SendActivityAsync(MessageFactory.Text(welcomeText, welcomeText), cancellationToken);
}
}
}
}
}