简体   繁体   English

如何在Bot Framework网络聊天中删除iframe的标题

[英]how to remove the title of the iframe in bot framework web chat

I got the iFrame for my bot that uses Microsoft bot framework by registering the bot with them. 通过为我的机器人注册iFrame,该机器人使用了Microsoft机器人框架。 Now, I need to remove/change the title of that bot from "chat" to another custom one. 现在,我需要将该机器人的标题从“聊天”中删除/更改为另一个自定义标题。

How can I do this? 我怎样才能做到这一点?

在此处输入图片说明

Thanks in advance. 提前致谢。

I need to remove/change the title of that bot from "chat" to another custom one 我需要将该机器人的标题从“聊天”中删除/更改为另一个自定义标题

To redesign and customize web chat interface, you can try to clone the repo , modify the source code, and compile into your own version. 要重新设计和定制Web聊天界面,您可以尝试克隆存储 ,修改源代码并编译成您自己的版本。 To achieve your requirement: changing the title of web chat, you can find and modify the following code snippet in Chat.tsx . 要实现您的要求:更改网络聊天的标题,您可以在Chat.tsx中找到并修改以下代码片段。

<div className="wc-header">
    <span>{ typeof state.format.chatTitle === 'string' ? state.format.chatTitle : state.format.strings.title }</span>
</div>

Simply modify it with below code and compile it: 只需使用以下代码对其进行修改并进行编译:

<span>{ typeof state.format.chatTitle === 'string' ? "my chat bot" : "my chat bot" }</span>

Use it in my website, which works for me. 在适合我的网站上使用它。

在此处输入图片说明

It isn't possible to edit the title when you use the iFrame without 'hacks' like modifying the DOM with CSS overrides. 使用iFrame时,如果没有“ hacks”(例如使用CSS覆盖修改DOM),就无法编辑标题。 However you don't have to edit / fork the WebChat code itself, as proposed in other answers. 但是,您不必像其他答案中所建议的那样编辑/创建WebChat代码本身。 It is possible to pass a custom title / empty title using ChatProps . 可以使用ChatProps传递自定义标题/空标题。

Have a look at the possibilities to include the WebChat on your own website . 看一下将WebChat包含在您自己的网站中的可能性。 Then pass the chatTitle parameter to change the title to your preference. 然后传递chatTitle参数将标题更改为您的首选项。

Rules for chatTitle: chatTitle规则:

  • undefined or true is passed, we will show the header with default text (locale-sensitive) 传递了undefined或true,我们将显示带有默认文本的标题(对语言环境敏感)
  • false (or falsy except undefined) is passed, we will remove the header 如果传递了false(或除未定义之外为falsy),我们将删除标头
  • a string is passed, we will show the header with the text 传递了一个字符串,我们将显示带有文本的标题

暂无
暂无

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

相关问题 Bot Framework Emulator VS网络聊天 - Bot Framework Emulator VS Web Chat 如何在 C# 中使用 MS Bot 框架开发的 web 频道聊天机器人中显示横幅? - How to display banner in web channel chat bot developed using MS Bot framework in C#? 如何在 Web 频道聊天机器人中显示自适应卡片中的取消按钮,该聊天机器人在 MS Bot 框架 SDK V4 中的 C# 中开发? - How to have cancel button in Adaptive cards to be displayed in Web Channel chat bot developed in MS Bot framework SDK V4 in C#? 如何使用Bot框架重建聊天Bot对话框 - How to rebuild chat bot dialog using bot framework 如何从聊天机器人的网络聊天中删除聊天标题 - How to remove the chat caption from the webchat of chat bot 如何在 Bot Framework v4 中的某些对话后禁用聊天 - How to disable the chat after certain conversation in Bot Framework v4 如何使用Bot框架捕获聊天中发生的所有对话 - How to capture all the conversation happend in the Chat - using Bot framework 如何在使用 C# MS BOT 框架 SDK V4 使用瀑布对话框创建的 Web Chat BOT 中添加状态管理? - How to add state management in Web Chat BOT created with water fall dialog's using C# MS BOT framework SDK V4? 如何将数据从网站传递到Botframework网络聊天机器人? - How to pass data from a website to a botframework web chat bot? 如何在bot框架中点击按钮的标题 - how can i get the title of button on click in bot framework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM