pythonbotframeworkchatbotskypeskype-bots

How to receive files on Skype Bot Built with the Microsoft Bot Framework?


I'm building a bot with the Microsoft Bot Builder Python SDK and host it on Heroku. I'm trying to implement files sending to the bot (for saving and processing it by the bot app) using the _handle_incoming_attachment and _download_attachment_and_write methods of the attachments bot code and facing an issue when sending a file to Skype. When a file is sent via the bot emulator (when the bot is running locally or via the test tool on the Bot Framework portal) it is accepted and processed by the bot successfully. But whent sending from Skype, the bot app returns "401 Unauthorized" response.

2021-02-26T12:51:29.525003+00:00 app[web.1]: HTTP Error 401: Unauthorized

What is not enough in the atachment bot's methods for Skype to accept the file?


Solution

  • I've found that the attachments sent from Skype are saved on the Skype server but not sent directly to the bot. So I implemented the attachment upload method as it is described for C# in the question "How to read attachment content from bot framework C#?" only using appropriate Python tools and now can successfully accept and process the files.