自定义 bot 框架网络聊天

customize bot framework web chat

我已经克隆了 Microsoft Bot Framework WebChat 存储库并且能够构建它。但是我很难查看我所做的更改。

npm start

在本地端口启动服务器,但不显示网络聊天。相反,它显示了项目中的文件。我对 Angular 有点熟悉,但我对 React 没有任何了解。我有一个基于 Python 构建的机器人,并在 Azure 的 Bot Channel registration 上注册。

如何在本地启动网络聊天以查看我所做的更改?

假设您将样本留在了本地计算机的存储库中,您需要转到 localhost:8000/samples/{sample name} 或只需从您看到的文件中单击适当的路径。

在反应样本中也是这样说的:

  1. Build the project: "npm run build"
  2. Start a web server: "npm run start"
  3. Aim your browser at "http://localhost:8000/samples?[parameters as listed below]"

  For ease of testing, several parameters can be set in the query string:
    * s = Direct Line secret, or
    * t = Direct Line token (obtained by calling Direct Line's Generate Token)
    * domain = optionally, the URL of an alternate Direct Line endpoint
    * webSocket = set to 'true' to use WebSocket to receive messages (currently defaults to false)
    * userid, username = id (and optionally name) of bot user
    * botid, botname = id (and optionally name) of bot