TelegramBots / Telegram.Bot

.NET Client for Telegram Bot API
https://telegrambots.github.io/book
MIT License
3.17k stars 686 forks source link

How to download voice file? #959

Closed onurcansen closed 3 years ago

onurcansen commented 3 years ago

I Try this:

Telegram.Bot.Types.File file = await bot.GetFileAsync(e.Message.Voice.FileId);
file.

But im stuck here how save this file on my computer ?

Fedorus commented 3 years ago

https://github.com/TelegramBots/Telegram.Bot/blob/e09ed3f20ba6a1f05ac0ea8c2e3dccc3550a641f/src/Telegram.Bot/TelegramBotClient.cs#L854

karb0f0s commented 3 years ago

@onurcansen take a look at this code this should allow you to download file by fileId to a desired destination.

karb0f0s commented 3 years ago

Please follow issue template If you want to chat, feel free to join our group.