java.lang.Object
io.github.yvasyliev.telegramforwarderbot.service.sender.MediaGroupSender

@Service public class MediaGroupSender extends Object
Service for sending media groups to Telegram. This service allows sending multiple media files (photos, videos, animations) in a single message.
  • 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 send
      caption - the caption for the media group
      Returns:
      a list of messages sent
      Throws:
      IOException - if there is an error reading the input files
      org.telegram.telegrambots.meta.exceptions.TelegramApiException - if there is an error sending the media group