Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The bot does not have permission to read the image sent by the user #12077

Open
xiaomingplus opened this issue Apr 7, 2019 · 10 comments
Open

Comments

@xiaomingplus
Copy link
Contributor

How to deal it?

I want write a bot to handle image and response a pic to user.

@showell
Copy link
Contributor

showell commented Apr 10, 2019

@xiaomingplus I'm not sure I really understand your question, but I'll try to respond. We generally expect API users to only care about the message content and not the image. If you want to get the bits for the image, though, I guess you would have to authenticate yourself to access the image, and I'm not sure we support that off of the top of my head.

@adnrs96 You may understand better what we would need to do here to let users download images with the API.

@adnrs96
Copy link
Member

adnrs96 commented Apr 10, 2019

So actually bot isn't able to access the images because we protect uploaded files from being accessed by someone who doesn't have access to it. If you need to access images, I believe you would need to access the API using an API key of a user who has access to them.

I guess this is another thing we would need to think about when building public archives. We would need to build support for excluding authentication for uploads in case they were uploaded to a web public stream.

@xiaomingplus
Copy link
Contributor Author

xiaomingplus commented Apr 11, 2019

@adnrs96 Does the robot have permission to read the images sent by user through private chat?

How to read it by the bot API key?

@mayankmadan
Copy link
Collaborator

@xiaomingplus I'm pretty sure the bot can't access files sent using private chat

@zulipbot
Copy link
Member

Hello @zulip/server-bots members, this issue was labeled with the "area: bots" label, so you may want to check it out!

@WesleyAC
Copy link
Contributor

Hey, I just wanted to bump this and see if there's any plan for supporting bots being able to see uploaded files - this is something that would be really useful for https://github.com/wesleyac/printer-bot

@timabbott
Copy link
Sponsor Member

@WesleyAC sorry for the slow reply. I expect that what you're trying to do should work if the bot is subscribed to the stream (or whatever) where the message is sent; (and should work for public streams in general). Can you explain the use case more precisely?

I think there's likely a change we need to make here for use with outgoing webhook bots in private streams (etc.); I'm just not sure what the right solution is at present and would like the understand it more.

@WesleyAC
Copy link
Contributor

WesleyAC commented Oct 7, 2019 via email

@timabbott
Copy link
Sponsor Member

Ahh, OK. What type of bot is it? My guess is that would work with a Generic Bot but not with an Outgoing Webhook Bot (and that's the bug here).

@WesleyAC
Copy link
Contributor

WesleyAC commented Oct 7, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants