在Microsoft Bot Framework中难以访问现有对话中的消息

问题描述:

我正在尝试构建一个单独的应用程序-基本上是在我的Intranet上运行的守护程序-可以连接到Bot Connector应用程序并访问用户与漫游器之间的现有对话.

I'm trying to build a separate app - basically a daemon running on my intranet - that can connect to a Bot Connector app and access an existing conversation between a user and the bot.

首先,我使用DirectLine NuGet程序包,然后通过模拟器从机器人开始的对话中搜索带有对话ID的现有消息.

To start at this, I'm using the DirectLine NuGet package, and then searching for existing messages with the conversationId found in a conversation I've started with the bot via the emulator.

例如,我启动了模拟器,并获得了sessionId"8a684db8".在控制台应用程序中,我具有以下相关代码:

For example, I fired up the emulator, and got the conversationId "8a684db8". Over in my console app, I've got the following relevant code:

var uri = new Uri("https://directline.botframework.com");
            DirectLineClientCredentials creds = new DirectLineClientCredentials(secret); //lot into the bot framework
            DirectLineClient client = new DirectLineClient(uri, creds); //connect the client
            Conversations convs = new Conversations(client); //get the list of conversations belonging to the bot? Or does this start a new collection of conversations?
            var existing_conv_messages = convs.GetMessages(convo_id);

现在,当我尝试运行它时,在尝试查找现有消息的最后一行出现了未找到"错误.

Now, when I try to run it, I'm getting a "Not Found" error on the last line where I tried to find existing messages.

有人在这里有解决方案吗?

Anyone have a solution here?

发送到模拟器的会话不会发送到Direct Line API.为了使消息在Direct Line中可见,它们需要通过运行中的在线连接器和Direct Line服务发送.

Conversations sent to the emulator don't get sent to the Direct Line API. For messages to be viewable in Direct Line, they need to be sent through the online, running Connector and Direct Line services.