Empty voice file
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)
Try to log msg.voice.file_size and check for size.
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.
Maybe you can try with adding logs inside downloadFile function and discover the problem.
It could either be because of the proxy or because of #583. Needs further investigation.