Difficulty accessing messages in an existing conversation in Microsoft Bot Framework

此生再无相见时 提交于 2019-12-13 06:13:16

问题


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.

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.

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?


回答1:


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.



来源:https://stackoverflow.com/questions/36893418/difficulty-accessing-messages-in-an-existing-conversation-in-microsoft-bot-frame

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!