你如何结束使用DirectLine 3.0的Bot Framework中的对话?

问题描述 投票:0回答:1

我能找到的唯一文档是关于活动endConversation(这是使用DirectLine 3.0)。

发送endConversation类型的活动后,我该怎么办?

通过聊天关闭窗口无法正常结束对话,我需要以编程方式执行此操作。

我结束对话的代码目前只是将事件发送到框​​架:

botConnection.postActivity({
    type: endConversation,
    from: { id: 'Bot' },
    name: 'endActivity',
    value: "The user has closed the session. You can now close this conversation.",
}).subscribe(function (id) { console.log('Command sent'); });
c# botframework direct-line-botframework
1个回答
1
投票

正如documentation所说,在你发送邮件请求到https://directline.botframework.com/v3/directline/conversations/YOUR_CONVERSATION/activities之后

使用您在问题中提到的正文,用户和机器人都不能发送任何其他消息。完成请求后,您应该获得200响应和活动ID,这就是您知道请求成功的方式。

有一个feature request有一个活动类型与DirectLine中的对话结束相关但我不认为还在生产中。当我得到更多信息时,我会更新这个答案。

此致,弗朗西斯科

© www.soinside.com 2019 - 2024. All rights reserved.