首页 > 解决方案 > 机器人状态一团糟。对话框未按预期工作。[SDK V3]

问题描述

我正在使用 SDK V3 版本 3.15.3。在我的机器人中,我正在使用 Dialogs 模拟对话流。但不是点击 context.wait() 中提到的回调函数,而是在点击 Message.Controller 之后,控件将转到我的根对话框中的 StartAsync 函数,因此整个对话框流从头开始重新启动,而不是继续context.wait() 的回调中提到的函数。这种行为也是非常随机的,因为在少数情况下(特别是在本地调试时)机器人会按预期运行。

我已经尝试降级到 3.13 版,但即使这样也行不通

这些是我在 Application_Start() 中进行的注册

var store = new InMemoryDataStore();

        Conversation.UpdateContainer(
                   builder =>
                   {
                       builder.Register(c => store)
                                 .Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
                                 .AsSelf()
                                 .SingleInstance();

                       builder.Register(c => new CachingBotDataStore(store,
                                  CachingBotDataStoreConsistencyPolicy
                                  .ETagBasedConsistency))
                                  .As<IBotDataStore<BotData>>()
                                  .AsSelf()
                                  .InstancePerLifetimeScope();

                       builder.RegisterType<Dialogs.RootDialog>()
                       .AsSelf().InstancePerLifetimeScope();
                   });
        GlobalConfiguration.Configure(WebApiConfig.Register);

预期:机器人:您是否要提出票 [状态 0] 用户:是 机器人:对应于票详细信息的状态 [状态 1]

实际结果:当用户键入 Yes 时,在 State 0 之后,StartAsync 被调用,在 Start Async 我是 doint context.wait(State 0) ,所以它再次进入状态 0

标签: botframeworkdirect-line-botframework

解决方案


推荐阅读