go-telegram / bot

Telegram Bot API Go framework
MIT License
507 stars 46 forks source link

Getting a URL for the file object #48

Closed ykarulin closed 7 months ago

ykarulin commented 7 months ago

The File struct contains FilePath field.

To access the file, we need to construct URL using the bot token and file path:

https://api.telegram.org/file/bot<token>/<file_path>

Would storing directly in the File struct or somewhere else make sense?

negasus commented 7 months ago

Added function func (b *Bot) FileDownloadLink(f *models.File) string in v0.8.3