depoio / node-telegram-bot

Client wrapper for Telegram Bot API (Under heavy development)
MIT License
136 stars 30 forks source link

Multipart stream parameter #14

Closed Christilut closed 9 years ago

Christilut commented 9 years ago

I noticed you removed the stream parameter from the multipart method. Filepath as parameter is more user friendly but I am missing the stream parameter since I download files and forward it to Telegram.

I quick and dirty patched it like this for now:

//    var file = options.files[key]
//     , filename = path.basename(file)
//      , stream = fs.createReadStream(file);

var file = options.files[key];
var stream = file.stream;
var filename = file.filename;

A nicer way to handle stream as parameter would be great

shernshiou commented 9 years ago

Ahh.. I am currently reimplement a readable way for this part. Thanks for the headsup!

shernshiou commented 9 years ago

Hello, I have implemented the feature you have requested. Please try it out. I appreciate your feedback. The method of implementing stream can be found at echobot sample. fc4a3f7e73789f523368a6bb40cfb73ced5a6038