简体   繁体   English

如何在响应中为我的 Dialogflow 聊天机器人创建超链接

[英]How To Create A Hyperlink For My Dialogflow Chatbot In Responses

I created a chatbot using dialogflow and I added a website link to the response, I have integrated the bot in Telegram and the website link is working perfectly, but on the web demo, it is not.我使用对话流创建了一个聊天机器人,并在响应中添加了一个网站链接,我已将机器人集成到 Telegram 中,并且网站链接运行良好,但在 web 演示中,它不是。 Is it possible that when I integrate the chatbot on a website using Kommunicate, the hyperlink will work?当我使用 Kommunicate 将聊天机器人集成到网站上时,超链接是否可以工作?

Kommunicate has a link button template, create a Dialogflow intent using below metadata. Kommunicate 有一个链接按钮模板,使用以下元数据创建一个 Dialogflow 意图。

{
    "message": "click on the buttons",
    "platform":"kommunicate",
    "metadata": {
        "contentType": "300",
        "templateId": "3",
        "payload": [{
                "type": "link",
                "url": "https://www.google.com",
                "name": "Go To Google"
            },
            {
                "type": "link",
                "url": "https://www.facebook.com",
                "name": "Go To Facebook",
                "openLinkInNewTab": false
            }
        ]
    }
}

The openLinkInNewTab: false to open any link in the same tab. openLinkInNewTab: false在同一选项卡中打开任何链接。 Default value is true, which will open the links in the new tab.默认值为 true,这将在新选项卡中打开链接。 Here is more information about the same. 是有关相同内容的更多信息。

Also, you can render HTML content as a message and Kommunicate will render the HTML in the UI.此外,您可以将 HTML 内容呈现为消息,并且 Kommunicate 将在 UI 中呈现 HTML。 Here is the metadata for that. 是相关的元数据。

Sadly the web demo only supports plain text responses, so adding an clickable url within your chatbot for the webdemo isn't possible.遗憾的是,web 演示仅支持纯文本响应,因此无法在您的聊天机器人中为 webdemo 添加可点击的 url。 Luckily, this is a limitation for web demo, so any other integration that do support URL's in their chats will work as you have seen with Telegram.幸运的是,这是 web 演示的限制,因此任何其他在聊天中支持 URL 的集成都可以像您在 Telegram 中看到的那样工作。

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

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