Class MediaGroupSender
java.lang.Object
io.github.yvasyliev.telegramforwarderbot.service.sender.MediaGroupSender
Service for sending media groups to Telegram.
This service allows sending multiple media files (photos, videos, animations) in a single message.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList
<org.telegram.telegrambots.meta.api.objects.message.Message> sendMediaGroup
(List<InputMediaDTO> inputMedias, String caption) Sends a media group to Telegram.
-
Constructor Details
-
MediaGroupSender
public MediaGroupSender()
-
-
Method Details
-
sendMediaGroup
public List<org.telegram.telegrambots.meta.api.objects.message.Message> sendMediaGroup(List<InputMediaDTO> inputMedias, String caption) throws IOException, org.telegram.telegrambots.meta.exceptions.TelegramApiException Sends a media group to Telegram.- Parameters:
inputMedias
- the list of input media files to sendcaption
- the caption for the media group- Returns:
- a list of messages sent
- Throws:
IOException
- if there is an error reading the input filesorg.telegram.telegrambots.meta.exceptions.TelegramApiException
- if there is an error sending the media group
-