У меня следующий файл Json
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "Customer Information Form",
"horizontalAlignment": "Center"
},
{
"type": "Input.Text",
"placeholder": "First Name",
"style": "text",
"maxLength": 0,
"id": "SimpleVal",
"color": "Red"
},
{
"type": "Input.Text",
"placeholder": "Last Name",
"style": "Url",
"maxLength": 0,
"id": "UrlVal"
},
{
"type": "Input.Text",
"placeholder": "Company Name",
"style": "text",
"maxLength": 0,
"id": "companyname",
"color": "Red"
},
{
"type": "Input.Text",
"placeholder": "Email",
"style": "Email",
"maxLength": 0,
"id": "EmailVal"
},
{
"type": "Input.ChoiceSet",
"placeholder": "Country",
"id": "CompactSelectVal",
"value": "1",
"choices": [
{
"title": "Country",
"value": "1"
},
{
"title": "United States",
"value": "2"
},
{
"title": "Algeria",
"value": "3"
}
]
},
{
"type": "Input.Text",
"placeholder": "Phone Number",
"style": "Tel",
"maxLength": 0,
"id": "TelVal"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"data": {
"id": "1234567890"
}
}
]
}
Вот форма ввода моего бота:
Когда я пытаюсь получитьзначение из turnContext , я получил нулевое значение. Посмотрите код ниже:
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
Random r = new Random();
var cardAttachment = CreateAdaptiveCardAttachment(_cards[r.Next(_cards.Length)]);
await turnContext.SendActivityAsync(MessageFactory.Attachment(cardAttachment), cancellationToken);
await turnContext.SendActivityAsync(MessageFactory.Text("Your Request has submitted. Thank you"), cancellationToken);
}
Я думаю, что я должен получить значение от активности turnContext. Но это видно пустым.