Bot框架自适应表单 - 提交操作不起作用

问题描述 投票:0回答:1

我正在尝试使用c#创建一个Adaptive表单。我已经安装了版本0.5.1的Microsoft.AdaptiveCards Nuget包,Bot Builder版本是3.14.1.1。

我的卡已在Skype频道中正确呈现。但是单击Submit按钮,Forms输入数据Json不会传递给Bot框架Post Activity。提交类型为“Action.Submit”。但这是在网络聊天中工作。

我使用以下代码。

                    var Makedmessage = context.MakeMessage();
                    AdaptiveCards.AdaptiveCard card = new AdaptiveCards.AdaptiveCard();
                    Attachment attach = new Attachment();
                    attach.ContentType = AdaptiveCards.AdaptiveCard.ContentType;
                    card.Body = new List<CardElement>() { new TextBlock() { Text = "Present a form and submit it back to the originator" }, new TextInput() { Id = "firstName", Placeholder = "What is your first name?" }, new TextInput() { Id = "lastName", Placeholder = "What is your last name?" } };
                    card.Actions = new List<ActionBase>() { new SubmitAction() { Title = "Action.Submit" } };
                    attach.Content = card;
                    Makedmessage.AttachmentLayout = AttachmentLayoutTypes.Carousel;
                    Makedmessage.Attachments.Add(attach);
                    await context.PostAsync(Makedmessage, CancellationToken.None);

还附上了截图。 enter image description here

我该如何解决这个问题?

botframework skype adaptive-cards
1个回答
1
投票

适用于Skype频道的自适应卡仍然是under development。您将不得不寻找Bot Framework的其他替代功能,如multi dialogformflow,以获取用户的详细信息。

© www.soinside.com 2019 - 2024. All rights reserved.