pengrad / java-telegram-bot-api

Telegram Bot API for Java

Home Page:https://core.telegram.org/bots

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: File Interface

calebpower opened this issue · comments

This is a feature request (that I might submit a PR for if I ever find the time). It's also possible that perhaps I'm simply missing something in the library, so please call me out if I have.

It would be very useful to have the ability to iterate through the various file variants that can be sent. For example, classes Audio, Document, Video, VideoNote, Voice, Photo, and perhaps others that I've missed, all have fileID() methods that can be used to download the data. It would be nice for those classes to implement some interface (e.g. Downloadable) and for the Message class to have some method getDownloads() so that one can quickly iterate through those files. As it is right now, spaghetti code seems to be required where one checks for the presence of each individual type before downloading it.

Use cases might be for malware scanners, archivers, other scanners, etc.