Send full link in getFile operation
gmag11 opened this issue · 2 comments
gmag11 commented
When invoking the getFile
method, the bot responds with the following data:
{
"content": {
"file_id": "AgAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"file_path": "photos/file_19.jpg",
"file_size": 258305,
"file_unique_id": "AQAxxxxxxxxxxx"
},
"getfile": {
"fileId": "AgACAgQxxxxxxxxxxxxxxxxxx-n0fHjoyHyxxxxxxxxxxxxxxxxBAAMCAAN3AAM0BA"
},
"type": "photo"
}
To download the file, a complete web link is required, similar to how the message receiver gets a link when a file is sent to the bot.
I am working with callbacks that include messages with photos. I prefer not to use the downloadFile
command as I wish to pass raw data directly to the subsequent node instead of saving to the file system.
I am considering three potential solutions:
- Add a
webLink
property to themsg
object in response togetFile
. - Implement an additional
getFileLink
command. - Include a
webLink
in callback responses that refer to a message containing a file.
Which one do you think it would be better?
windkh commented
I saw your commit. Well, you can use the autodownload feature, the file id or as you prefered the complete weblink.
In my eyes all of those are valid use cases. So returning the weblink sounds like a useful idea.