我正在尝试发送具有2个选项供用户选择的自适应卡。当用户提交自适应卡的响应时,我将收到:
Newtonsoft.Json.JsonReaderException: Error reading JArray from JsonReader. Current JsonReader item is not an array: StartObject. Path ‘[‘BotAccessors.DialogState’].DialogStack.$values[0].State.options.Prompt.attachments.$values[0].content.body’.
Run Code Online (Sandbox Code Playgroud)
完整的代码示例链接:使用对话框管理复杂的对话流
在HotelDialogs.cs中进行的修改:-
public static async Task<DialogTurnResult> PresentMenuAsync(
WaterfallStepContext stepContext,
CancellationToken cancellationToken)
{
// Greet the guest and ask them to choose an option.
await stepContext.Context.SendActivityAsync(
"Welcome to Contoso Hotel and Resort.",
cancellationToken: cancellationToken);
//return await stepContext.PromptAsync(
// Inputs.Choice,
// new PromptOptions
// {
// Prompt = MessageFactory.Text("How may we serve you today?"),
// RetryPrompt = Lists.WelcomeReprompt,
// Choices = Lists.WelcomeChoices,
// }, …
Run Code Online (Sandbox Code Playgroud)