我正在使用我的一個項目中的漫遊器框架技術,並且希望在下面的鏈接https://docs.botframework.com/en-us/csharp/builder/sdkreference/attachments.html中顯示收據卡用於在我的項目中添加收據卡。在收據卡的多個收據上只顯示一個標題名稱
這是我的關於收據卡的代碼。
#region Receipt Card
ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
Activity replyToConversation = activity.CreateReply("Welcome to **** Hotels.");
replyToConversation.Recipient = activity.From;
replyToConversation.Type = "message";
replyToConversation.Attachments = new List<Attachment>();
//List<CardImage> cardImages = new List<CardImage>();
//cardImages.Add(new CardImage(url: "http://cache.*****.com/propertyimages/h/hydcy/hydcy_main02.jpg",alt: "The **** Hyderabad welcomes guests to the heart of the city centre with an array of amenities and comfortable, sophisticated lodging."));
List<CardAction> cardButtons = new List<CardAction>();
CardAction plButton = new CardAction()
{
Value = "http://www.*****.com/hotels/travel/hydcy-courtyard-hyderabad/",
Type = "openUrl",
Title = "Confirmed"
};
cardButtons.Add(plButton);
ReceiptItem lineItem1 = new ReceiptItem()
{
Title = "***** Hyderabad",
Subtitle = "*****, Hyderabad, IN 500 080",
Text= "The **** Hyderabad welcomes guests to the heart of the city centre with an array of amenities and comfortable, sophisticated lodging."
};
ReceiptItem lineItem2 = new ReceiptItem()
{
Title="Executive Deluxe,Guest Room",
Image = new CardImage(url: "http://cache.****.com/propertyimages/h/hydcy/hydcy_main02.jpg"),
Price = "7000.25",
Quantity = "1",
Tap = null
};
List<ReceiptItem> receiptList = new List<ReceiptItem>();
receiptList.Add(lineItem1);
receiptList.Add(lineItem2);
ReceiptCard plCard = new ReceiptCard()
{
Title = "**** Hyderabad Hotel Reservation Confirmed",
Buttons = cardButtons,
Items = receiptList,
Tax = "27.52",
Total = "7027.77"
};
Attachment plAttachment = plCard.ToAttachment();
replyToConversation.Attachments.Add(plAttachment);
var reply = await connector.Conversations.SendToConversationAsync(replyToConversation);
#endregion
在上面我已經添加了兩個收納物品的不同標題但最後它在我這樣下圖回執卡顯示在兩個項目收到的唯一一個冠軍的名字。
請告訴我,如何解決上述問題。
我認爲Bot Framework Channel Emulator中可能存在一個bug。
-Kishore。
您使用的是什麼頻道? – Lars
我沒有使用任何頻道,只是我測試了我的機器人在最新的機器人模擬器。 – Kishore1021
看起來像一個錯誤。調查 – Lars