@Test public void sendMediaGroup() { MessagesResponse response = bot.execute(new SendMediaGroup(chatId, new InputMediaPhoto(photoFileId), new InputMediaPhoto(imageFile).caption("some caption <b>bold</b>").parseMode(ParseMode.HTML), new InputMediaPhoto(imageBytes), new InputMediaVideo(videoFileId), new InputMediaVideo(videoFile), new InputMediaVideo(videoBytes).caption("my video <b>bold</b>").parseMode(ParseMode.HTML) .duration(10).width(11).height(12).supportsStreaming(true) )); assertTrue(response.isOk()); assertEquals(6, response.messages().length); String mediaGroupId = response.messages()[0].mediaGroupId(); assertNotNull(mediaGroupId); int messagesWithCaption = 0; for (Message message : response.messages()) { assertEquals(mediaGroupId, message.mediaGroupId()); if (message.caption() != null) { assertEquals(MessageEntity.Type.bold, message.captionEntities()[0].type()); messagesWithCaption++; } } assertEquals(2, messagesWithCaption); }
public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) { return api.send(request); }
TelegramBot { public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) { return api.send(request); } }
TelegramBot { public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) { return api.send(request); } TelegramBot(String botToken);   TelegramBot(Builder builder); }
TelegramBot { public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) { return api.send(request); } TelegramBot(String botToken);   TelegramBot(Builder builder); R execute(BaseRequest<T, R> request); void execute(T request, Callback<T, R> callback); String getFullFilePath(File file); byte[] getFileContent(File file); void setUpdatesListener(UpdatesListener listener); void setUpdatesListener(UpdatesListener listener, GetUpdates request); void setUpdatesListener(UpdatesListener listener, ExceptionHandler exceptionHandler); void setUpdatesListener(UpdatesListener listener, ExceptionHandler exceptionHandler, GetUpdates request); void removeGetUpdatesListener(); }
TelegramBot { public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) { return api.send(request); } TelegramBot(String botToken);   TelegramBot(Builder builder); R execute(BaseRequest<T, R> request); void execute(T request, Callback<T, R> callback); String getFullFilePath(File file); byte[] getFileContent(File file); void setUpdatesListener(UpdatesListener listener); void setUpdatesListener(UpdatesListener listener, GetUpdates request); void setUpdatesListener(UpdatesListener listener, ExceptionHandler exceptionHandler); void setUpdatesListener(UpdatesListener listener, ExceptionHandler exceptionHandler, GetUpdates request); void removeGetUpdatesListener();  }