简体   繁体   English

如何将chabot作为小部件嵌入另一个网站并打开它?

[英]How to embed chabot in another website as a widget and open it?

I have developed a chatbot using Microsoft Botframework.我使用 Microsoft Botframework 开发了一个聊天机器人。 This particular react project is at one repository.这个特定的反应项目位于一个存储库中。 There is another repository for a page developed with Angular which needs to have a floating button or a widget to open that chatbot.使用 Angular 开发的页面还有另一个存储库,它需要有一个浮动按钮或一个小部件才能打开该聊天机器人。 How do I accomplish this?我该如何做到这一点? This is a sample similar to what I want to achieve, but it has both the code at one repository. 是一个与我想要实现的示例类似的示例,但它在一个存储库中同时拥有这两个代码。

I am assuming that by "different repositories" you mean that you want to host the parent page and chatbot UI separately.我假设“不同的存储库”是指您想要分别托管父页面和聊天机器人 UI。

You can embed the chatbot UI into an existing page using an iframe.您可以使用 iframe 将聊天机器人 UI 嵌入到现有页面中。 That way your chatbot UI can be a self-contained widget that can interact with the parent page hosting the iframe.这样,您的聊天机器人 UI 可以是一个独立的小部件,可以与托管 iframe 的父页面交互。

Your iframe code will look something like this:您的 iframe 代码将如下所示:

<iframe src="<url for your chatbot UI>" width="480" height="540" frameborder="0"></iframe>

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM