BotFramework - 记录提示对话的聊天记录

时间:2017-09-18 01:33:01

标签: c# botframework

有谁知道如何使用IActivityLogger访问富卡?因为我现在无法记录富卡的属性(例如标题),但我可以使用activity.AsMessageActivity().Attachments访问内容并使用

访问附件
foreach (var attachment in attachments)
{ 
   attachment.Content 
} 

但我不知道如何访问这些富卡属性?有什么办法吗?谢谢!

1 个答案:

答案 0 :(得分:1)

通过查看附件的ContentType属性,您将知道Attachment的卡片类型。

之后只需将Content属性转换为卡片类型即可。

例如:

// TODO: add switch logic to perform the corresponding cast depending the type of the card.
var heroCard = attachment.Content as HeroCard

可以通过每张卡访问卡的内容类型:

HeroCard.ContentType

ThumbnailCard.ContentType
相关问题