node-telegram-bot-api icon indicating copy to clipboard operation
node-telegram-bot-api copied to clipboard

Empty voice file

Open kayrosik opened this issue 7 years ago • 4 comments

I want to download a voice message: bot.on('voice', (msg)=>{ const voiceId = msg.voice.file_id; bot.downloadFile(voiceId,'./').then((resp) => { console.log(resp); }); }); But the downloaded file is empty. Maybe this is due to the fact that I use a proxy? (Telegram is blocked in Russia)

kayrosik avatar Oct 16 '18 18:10 kayrosik

Try to log msg.voice.file_size and check for size.

sidelux avatar Oct 17 '18 15:10 sidelux

It is not empty. I try to use getFileStream() and I have same problem. It's work, when I use request module with socks5-https-client, I can save it by url from getFileLink(), but I can't understand why downloadFile and getFileStream doesn't work.

kayrosik avatar Oct 17 '18 19:10 kayrosik

Maybe you can try with adding logs inside downloadFile function and discover the problem.

sidelux avatar Oct 18 '18 09:10 sidelux

It could either be because of the proxy or because of #583. Needs further investigation.

kamikazechaser avatar Oct 31 '18 11:10 kamikazechaser