Я пытаюсь получить событие действия после нажатия кнопки на карточке с миниатюрами, созданной методом OnTeamsMessagingExtensionSelectItemAsync
. Все образцы вокруг этого использовали только Action.OpenUrl. Кто-нибудь пробовал это?
protected override Task<MessagingExtensionResponse> OnTeamsMessagingExtensionSelectItemAsync(ITurnContext<IInvokeActivity> turnContext, JObject query, CancellationToken cancellationToken)
{
var packages1 = JsonConvert.DeserializeObject<TicketClass>(query.ToString());
var card = new ThumbnailCard
{
Title = $"{packages1.Title}, {packages1.ShortDescription}",
Subtitle = packages1.LongDescription,
Buttons = new List<CardAction>
{
new CardAction { Type = ActionTypes.ImBack, Title = "Action 1 ", Value = "Show me more" },
new CardAction { Type = ActionTypes.OpenUrl, Title = "Action 2", Value = "" },
},
};
var attachment = new MessagingExtensionAttachment
{
ContentType = ThumbnailCard.ContentType,
Content = card,
};
return Task.FromResult(new MessagingExtensionResponse
{
ComposeExtension = new MessagingExtensionResult
{
Type = "result",
AttachmentLayout = "list",
Attachments = new List<MessagingExtensionAttachment> { attachment }
}
});
}