Node-telegram-bot-api: Downloading file to memory stream (feature request)

Created on 16 Oct 2017  路  5Comments  路  Source: yagop/node-telegram-bot-api

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

enhancement telegram

Most helpful comment

@yagop I think we can work on adding a getFileStream method. It would be quite helpful for most users I presume.

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings