如何从IDialogContext获取活动信息 [英] How to get Activity Info from an IDialogContext

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

问题描述

我正在使用LuisDialog,而我得到的回调返回的只是一个IDialogContext和LuisResult. 有什么方法可以从原始活动(例如频道),名称等中获取信息?

I'm using a LuisDialog and all I get the the callback returns is an IDialogContext and the LuisResult. Is there a way I can get info from the original Activity, like channel, from name, et al?

推荐答案

自v3.2.0版本发布以来,您可以从Intent处理程序中访问原始传入消息.在此处进行了解您的意图处理程序应如何显示.

Since the v3.2.0 release you can access the original incoming message from the intent handlers. Check here to understand how your intent handler should looks like.

public async Task MyHandler(IDialogContext context, IAwaitable<IMessageActivity> activity, LuisResult result)

或者,您可以使用context.MakeMessage,但是我建议您更新您的意图处理程序.

Alternatively, you can use context.MakeMessage but I would recommend updating your intent handlers.

这篇关于如何从IDialogContext获取活动信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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