简体   繁体   English

Teams Toolkit HelloWorld 聊天机器人 - 发送失败

[英]Teams Toolkit HelloWorld chat bot - Failed to send

I've just downloaded Teams Toolkit onto VSCode and used the plugin to create a Command Bot project.我刚刚将 Teams Toolkit 下载到 VSCode 上并使用该插件创建了一个 Command Bot 项目。 Completed all the prerequisites and configurations on my tenant (I'm the admin for our 365 business account)完成我租户的所有先决条件和配置(我是我们 365 企业帐户的管理员)

Everything installs great.一切都安装得很好。

I hit f5 to launch the debugger.我按 f5 启动调试器。

  • All prerequisite checks pass.所有先决条件检查均通过。
  • Chrome opens Chrome 打开
  • I can [Add] my local debug bot into the web app version of teams我可以 [添加] 我的本地调试机器人到团队的 web 应用程序版本中

I go to send any message OR the helloWorld command that comes with the template app and it gives me “Failed to send message” error.我 go 发送任何消息或模板应用程序附带的 helloWorld 命令,它给我“发送消息失败”错误。

When I hit F12 to bring up the Chrome dev tools and go into the.network tab to see the call that is being sent, I see and Error as the response payload: errorCode 201 errorSubCode 1 with the message “One or more of the user ids provided are not valid."当我按 F12 调出 Chrome 开发工具和 go 到 .network 选项卡以查看正在发送的调用时,我看到错误作为响应负载:errorCode 201 errorSubCode 1 以及消息“一个或多个用户提供的 ID 无效。”

Payload:有效载荷:

{
  "members": [
    {
      "id": "8:orgid:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "role": "Admin"
    },
    {
      "id": "28:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "role": "Admin"
    }
  ],
  "properties": {
    "threadType": "chat",
    "chatFilesIndexId": "2",
    "uniquerosterthread": "true",
    "fixedRoster": "true"
  }
}

Response回复

{
  "errorCode": 201,
  "message": "One or more of the user ids provided are not valid.",
  "standardizedError": {
    "errorCode": 201,
    "errorSubCode": 1,
    "errorDescription": "One or more of the user ids provided are not valid."
  }
}

I haven't written any custom code or made any changes.我没有编写任何自定义代码或进行任何更改。 Just trying to launch the bot straight from Toolkit creation.只是尝试直接从 Toolkit 创建中启动机器人。

I've also tested the ngrok session that is connected to make sure that communication back to me is working fine.我还测试了已连接的 ngrok session,以确保与我的通信正常。 I see logging when I try to hit the ngrok url so I feel this is a failure at the point of Teams trying to send to their API.当我尝试点击 ngrok url 时,我看到了日志记录,所以我觉得这是团队试图发送到他们的 API 的失败。

I've followed all the steps in the documentation regarding setup.我已经按照文档中有关设置的所有步骤进行操作。 I would appreciate any help anyone would have on this.我将不胜感激任何人对此的帮助。

Thank you谢谢

This is probably caused by incorrectly bot identity used in Teams channel registration in Bot Framework .这可能是由于在Bot Framework中的 Teams 频道注册中使用了不正确的机器人身份造成的。 Not quite sure what happen when calling the bot framework service to do the bot registration herre.不太确定在此处调用机器人框架服务进行机器人注册时会发生什么。

You can check if your App ID and password is correctly in Bot Framework registration:您可以在Bot Framework注册中检查您的App ID和密码是否正确: 在此处输入图像描述

The bot credentials in.fx configs: bot 凭据 in.fx 配置: 在此处输入图像描述 The app password can be decrypted from local.userdata应用密码可以从local.userdata中解密

To resolve this, could you please try one of the following solutions:要解决此问题,请您尝试以下解决方案之一:

  1. Create a new Command Bot and run F5 again.创建一个新的Command Bot并再次运行 F5。
  2. Or, you can delete the local.userdata and state.local.json files in your current project.或者,您可以删除当前项目中的local.userdatastate.local.json文件。 And then re-run F5, the toolkit should create a new AAD app for your bot registration in this case.然后重新运行 F5,在这种情况下,工具包应该为您的机器人注册创建一个新的 AAD 应用程序。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM