在 Teams 中使用 azure bot 服务:如何将文件发送到 bot

Using azure bot services in Teams : how to send files to bot

我是团队和机器人框架开发的新手。

我有一个已启动的 botframework 机器人,并且 运行 在 Teams 上。我没有使用app studio,我直接从azure bot service导出来的。

我想从手机发送一张图片phone(比如自拍)。似乎你可以通过你拥有的任何联系人来做到这一点,但不能通过机器人来做到这一点。现在,在我的 Teams 版本上似乎无法向机器人发送文件。您可以通过 bing 发送图像,仅此而已。

从下面的文档中可以看出:"Sending and receiving files to bots on mobile devices is not supported." https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-and-receive-files?tabs=dotnet 在我的电脑上,它似乎也不被支持。无论如何,我正在寻找使用我的 phone 相机分享自拍的解决方案。

我遇到了这个线程,它讨论了一种添加按钮以提示用户在客户端上传文件的方法。

是否可以在 Teams 中而不是在 Webchat 中执行此操作?

我是这个框架的新手,所以如果对以上内容有任何见解,我们将不胜感激!

这是可能的,实际上我们刚刚发布了一个示例 (Node / C#)。但是请注意,我不相信你可以触发用户的相机......只要求他们上传图像文件。

您可能遗漏的重要部分是 step 7(您需要包含 "supportsFiles": truemanifest.json):

This step is specific to Teams. Edit the manifest.json contained in the teamsAppManifest folder to replace your app id from Bot Framework everywhere you see the place holder string <>. Zip up the contents of the teamsAppManifest folder to create a manifest.zip. Upload the manifest.zip to Teams (in the Apps view click "Upload a custom app")