小编Him*_*nik的帖子

WaterfallStep对话框MS Bot框架v4的自适应卡响应

我正在尝试发送具有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)

c# dialog bots waterfall botframework

5
推荐指数
1
解决办法
2474
查看次数

标签 统计

botframework ×1

bots ×1

c# ×1

dialog ×1

waterfall ×1