rubenlagus / TelegramBots

Java library to create bots using Telegram Bots API
https://telegram.me/JavaBotsApi
MIT License
4.68k stars 1.18k forks source link

Can't download file via custom baseUrl. #636

Open aleontev opened 5 years ago

aleontev commented 5 years ago

URL template for downloading files is hardcoded:

https://github.com/rubenlagus/TelegramBots/blob/7fd3d871dc832335379c9fe95ea4fd268e4aff70/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/File.java#L61

This static method is invoking from final method and can't be overriden: https://github.com/rubenlagus/TelegramBots/blob/7fd3d871dc832335379c9fe95ea4fd268e4aff70/telegrambots/src/main/java/org/telegram/telegrambots/bots/DefaultAbsSender.java#L115

How can i download file using my custom link (like baseUrl)?

Chase22 commented 5 years ago

Why do you want to download a file via custom base url?

The donwloadFile method is only to download stuff from telegram, therefore having a hardcoded template is okay

aleontev commented 5 years ago

But if main url is blocked, and i want to use reverse proxy?