从上下文获取ConversationId [英] Get ConversationId from Context

查看:153
本文介绍了从上下文获取ConversationId的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从IDialogContext context获取ConversationId?我知道有一个ConverationData属性,但这似乎只是一个可以容纳任何东西的数据包.

How can I get the ConversationId from the IDialogContext context? I know that there is a ConverationData property but that seems to just be a data bag that can hold anything.

这个袋子里的身份证是吗?如果是这样,检索它的关键是什么?

Is the id in this bag? If so, what is the key to retrieve it?

public async Task General(IDialogContext context, LuisResult result)
{
    //how can I access the conversationId here
}

推荐答案

使用最新版本的框架,您可以更轻松地从DialogContext对象中获取它:

With the last version of the framework you can get it from the DialogContext object easier:

var conversationId = context.Activity.Conversation.Id;

我使用了它,并且可以在我的机器人上使用它.

I used it and it worked on my bot.

这篇关于从上下文获取ConversationId的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆