网络聊天未显示结果

时间:2019-06-18 11:32:11

标签: botframework microsoft-teams

当前,我已经开发了Microsoft Graph ChatBot,它可以从SharePoint检索数据,但是当我在Emulator中调试它的工作时,但是在WebChat中部署时却没有显示结果。

仿真器的结果

WebChat的结果 enter image description here

有人知道如何解决或提出建议吗?

1 个答案:

答案 0 :(得分:1)

当前有两个versions网络聊天:Gemini和Scorpio。网络聊天中的测试仍在使用旧版本-Scorpio-不幸的是,该版本不支持OAuth卡。 BotFramework开发团队正在努力更新Web Chat中的测试,但是如果您需要立即修复,我建议您创建使用最新版本Web Chat的自己的网页。看看下面的示例代码。

<!DOCTYPE html>
<html lang="en-US">
<head>
  <title>WebChat</title>
  <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
  <style>
    html, body { height: 100% }
    body { 
      margin: 0;
      }

    #webchat {
      height: 100%;
    }

  </style>
</head>
<body>

  <div id="webchat" role="main"></div>

  <script>

    (async function() {

      // Note, for the simplicity of this example, we are simply using the Web Chat Secret here;
      // however, it is recommended that you create a backend REST API to generate and manage 
      // tokens for production.

      window.WebChat.renderWebChat({
        directLine: window.WebChat.createDirectLine({ secret: '<WEB_CHAT_SECRET>'}),
      }, document.getElementById('webchat'));

    })().catch(err => console.log(err));

  </script>
</body>

有关如何开始网络聊天的更多示例,请查看网络聊天samples

希望这会有所帮助!