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
Comments
@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. |
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. |
@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? |
@xiaomingplus I'm pretty sure the bot can't access files sent using private chat |
Hello @zulip/server-bots members, this issue was labeled with the "area: bots" label, so you may want to check it out! |
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 |
@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. |
This is for the case where a user PMs the bot with a file.
…On Mon, Oct 7, 2019, at 4:44 PM, Tim Abbott wrote:
@WesleyAC <https://github.com/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.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#12077?email_source=notifications&email_token=ABGE7BBGL734CLVGGPG6YUTQNONULA5CNFSM4HEC5HXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEARXUJQ#issuecomment-539195942>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABGE7BAFXDWRVHCC47CW543QNONULANCNFSM4HEC5HXA>.
|
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). |
Yeah, it's a webhook bot.
…On Mon, Oct 7, 2019, at 4:55 PM, Tim Abbott wrote:
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).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#12077?email_source=notifications&email_token=ABGE7BFYJFXKO7R2Y5UB4E3QNOO5RA5CNFSM4HEC5HXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEARYW4Q#issuecomment-539200370>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABGE7BHHRQFOUGIWRSD2EMDQNOO5RANCNFSM4HEC5HXA>.
|
How to deal it?
I want write a bot to handle image and response a pic to user.
The text was updated successfully, but these errors were encountered: