【问题标题】:how to change the name of the bot header如何更改机器人标题的名称
【发布时间】:2018-11-15 16:35:34
【问题描述】:

我需要将 [chat] header bot 的名称更改为 Askme。 我可以知道如何在 Microsoft bot 中更改它吗? 图片已附上

【问题讨论】:

标签: botframework bots


【解决方案1】:

如果您不使用 iframe 的网络聊天,您可以像这样修改标题的 .innerHTML:

var header = document.getElementsByClassName("wc-header");
header[0].innerHTML = "<span>Askme</span>"

【讨论】:

    【解决方案2】:

    或者,如果您想在初始化时设置它并且使用Botchat.App() 设置而不是 iframe 版本的 webchat,您可以在发送到 webchat 的参数对象中设置它:

    BotChat.App({
    botConnection:  botConnection,
    user: { id: '1234', name: 'user'},
    bot: { id: 'bot' },
    chatTitle: "I'm a custom chat title"
    }, document.getElementById("bot"));
    

    本例中的关键参数为chatTitle;其他可以发送到网络聊天的选项可以在源代码right here中找到。

    【讨论】:

    • 你太棒了,我只想删除聊天标题所以设置为空
    猜你喜欢
    • 2020-12-25
    • 2015-12-03
    • 2021-11-01
    • 2020-04-05
    • 2021-06-30
    • 1970-01-01
    • 2018-07-10
    • 2013-07-24
    • 2019-07-04
    相关资源
    最近更新 更多