Currently the only available option for downloading a file from Telegram servers is downloadFile which writes file to the disk. If the file is not needed for long then (i.e. you need file for one second) a write and read from disk plus a delete should be done.
If there be a getFileStream method which returns a memory stream, then such a problem does not happen.
Thanks
yeah, thats true, we'll need streaming , how about implementing fs methods into it?
You can use getFileLink to get the link and create an stream with [your favourite HTTP request module].
@yagop I think we can work on adding a getFileStream method. It would be quite helpful for most users I presume.
Just added TelegramBot#getFileStream() on master branch. Please try it out and give us feedback.
Shipped in v0.30.0.
Most helpful comment
@yagop I think we can work on adding a
getFileStreammethod. It would be quite helpful for most users I presume.