I'm coding a Telegram-bot using MS Bot Framework. I want to use Attachments to collect data from user's selection/choice. Would someone kindly help me with the following:
I attempted to code as per this sample:
var _card = new HeroCard
{
Text = "You can upload an image or select one of the following choices",
Buttons = new List<CardAction>
{
new CardAction(ActionTypes.ImBack, title: "Part1", value: "1"),
new CardAction(ActionTypes.ImBack, title: "Part2", value: "2"),
new CardAction(ActionTypes.ImBack, title: "Part3", value: "3"),
new CardAction(ActionTypes.ImBack, title: "Part4", value: "4"),
},
};
var _reply = MessageFactory.Attachment(_card.ToAttachment());
await turnContext.SendActivityAsync(_reply, cancellationToken);
You won't be able to do this with a Hero card. They are pretty basic and not all that flexible. You might be able to design your intended layout with an Adaptive Card, but Telegram doesn't fully support them. It will render, but only as an image.