简体   繁体   English

有什么方法可以从bot框架代码内部访问生成的网络聊天令牌值?

[英]Is there any way to access the generated token value for web chat from inside the bot framework code?

According to this URL http://docs.botframework.com/connector/embed-chat-control/ 根据此URL http://docs.botframework.com/connector/embed-chat-c​​ontrol/

We generate a token value which is used generate the iframe embed url. 我们生成一个令牌值,该令牌值用于生成iframe嵌入网址。

I want to be able to access this token value from the corresponding bot. 我希望能够从相应的bot访问此令牌值。

If I can't access it directly, is there any way I can compute it inside the bot framework code? 如果我不能直接访问它,是否可以在bot框架代码中进行任何计算?

If my understanding is right, you want to check whether your bot is working via embed chat through the bot itself rather than creating a new website and embedding it there. 如果我的理解是正确的,那么您想通过机器人本身的嵌入聊天功能来检查您的机器人是否正在运行,而不是创建一个新网站并将其嵌入其中。

I've embedded the widget in the default.htm file of my project and if the project is deployed on Azure, you can test its working. 我已将小部件嵌入项目的default.htm文件中,如果该项目已部署在Azure上,则可以测试其工作情况。

Just code like this.... 只是这样的代码。

    <div><iframe src="https://webchat.botframework.com/embed/MySimpleBotPlan?s=JXYDmEp8p7E.cwA.y6E.amTHXt9V7FN88DOagU7ST39iVBUKAEBcfQdaJgUbCt8">style="height: 502px; max-height: 502px;"></iframe></div>

Please find the sample code here . 请在此处找到示例代码

The test might fail if you try the same code as I've stopped Azure services running, but you can try the sample code by deploying it on your Azure account. 如果您尝试使用与我已停止运行Azure服务相同的代码,则测试可能会失败,但是您可以通过将示例代码部署在Azure帐户上来尝试该示例代码。

This is another example which might be helpful too. 这是另一个示例 ,可能也会有所帮助。

Please refer this documentation for the step by step tutorial . 请参阅本文档以获取分步教程

Regards, 问候,

-Jyo -乔

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure 网络聊天机器人令牌服务器 - Azure Web Chat Bot Token Server 对于bot框架V4 Web聊天中的每个用户,AD身份验证令牌都不相同 - AD authentication token is not getting same for every user in bot framework V4 web chat Bot Framework Emulator VS网络聊天 - Bot Framework Emulator VS Web Chat Bot Framework.Net,如何从我的 Web 应用程序中获取用户名、ID、令牌到 Bot - Bot Framework .Net, How I can get either the Username, Id, Token from my Web App to Bot 无法从 Microsoft web 聊天机器人框架在浏览器的新选项卡中导航 pdf - Unable to navigate pdf in new tab of browser from Microsoft web chat bot framework 如何在Bot Framework网络聊天中删除iframe的标题 - how to remove the title of the iframe in bot framework web chat MS Chat Bot-如何从我的C#代码访问自定义自适应卡属性 - MS Chat Bot --How to access custom adaptive card properties from my C# code Autofac或Delegates的工作方式是在ASP.Net Web API Bot Framework中加载错误的依赖项 - Autofac or the way Delegates work is loading the wrong dependency inside ASP.Net Web API Bot Framework 是否有任何简单的方法可以在 Bot Framework SDKv4 中存储先前的意图值以使用当前话语实体? - Is there any simple way to store the previous intent value in Bot Framework SDKv4 to make use of with current utterance entities? 使用团队中的机器人框架向群聊发送消息 - Sending message to a group chat using bot framework from teams
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM