如何更改机器人背景颜色

时间:2018-05-31 09:16:05

标签: css .net azure botframework

Curretly我的Luis bot通过iframe html元素嵌入到sharepoint网站,我想添加一个自定义样式,更具体地说,我想改变它的backgrounf颜色。

根据这个tutorial,我必须克隆源代码并编辑typescript和scss文件。但是我的机器人托管在azure中,所以我不知道在哪里部署源代码以及如何在我的机器人中引用它。

是通过iframe我可以定义背景颜色吗?如果没有,有人可以帮助我吗?

1 个答案:

答案 0 :(得分:1)

您无法使用iframe应用样式。 1.您需要在Bot注册门户中创建直接线路通道并获得直线保密。 2.将这些添加到您现有的共享点网站而不是iframe。

<html>
  <head>
    <link href="https://cdn.botframework.com/botframework-webchat/latest/botchat.css" rel="stylesheet" />
  </head>
  <body>
    <div id="bot"/>
    <script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"></script>
    <script>
      BotChat.App({
        directLine: { secret: 'YOUR_DIRECT_LINE_SECRET' },
        user: { id: 'USER_ID' },
        bot: { id: 'YOUR_BOT_ID' },
        resize: 'detect'
      }, document.getElementById("bot"));
    </script>
  </body>
</html>

对于应用样式,请复制css file并根据需要对其进行自定义。

相关问题