我们无法通过Bot应用程序从英雄卡中获取所选卡值

时间:2017-07-28 06:46:20

标签: c# botframework

问题:我们无法从Bot应用程序中的英雄卡中获取选定的卡值

代码:

string val = message.Text; //this value every time coming null after selected card button.

ResultInCSV = URL;
Activity replyToConversation = (Activity) context.MakeMessage();
RootObjects holder = JsonConvert.DeserializeObject < RootObjects > (ResultInCSV);
List < Attachment > a = new List < Attachment > ();
Attachment attach = new Attachment();
for (int v = 0; v < holder.VehicleListsResult.Count; v++) {
    attach = GetHeroCard(
        holder.VehicleListsResult[v].Name,
        "",
        holder.VehicleListsResult[v].ID.ToString(),
        new CardImage(url: holder.VehicleListsResult[v].ImagePath),
        new CardAction(ActionTypes.ImBack, holder.VehicleListsResult[v].Description, value: holder.VehicleListsResult[v].ID.ToString()));
    a.Add(attach);
}

replyToConversation.AttachmentLayout = AttachmentLayoutTypes.Carousel;
replyToConversation.Attachments = a;
await context.PostAsync(replyToConversation);

0 个答案:

没有答案