@Test public void editMessageMedia() { int messageId = 13541; SendResponse response; response = (SendResponse) bot.execute(new EditMessageMedia(chatId, messageId, new InputMediaDocument(docFile).thumb(thumbFile))); assertEquals((Integer) 14, response.message().document().fileSize()); assertEquals(thumbSize, response.message().document().thumb().fileSize()); response = (SendResponse) bot.execute(new EditMessageMedia(chatId, messageId, new InputMediaDocument(docBytes).thumb(thumbBytes))); assertEquals((Integer) 14, response.message().document().fileSize()); assertEquals(thumbSize, response.message().document().thumb().fileSize()); response = (SendResponse) bot.execute(new EditMessageMedia(chatId, messageId, new InputMediaDocument(docFileId))); MessageTest.checkMessage(response.message()); DocumentTest.check(response.message().document()); response = (SendResponse) bot.execute(new EditMessageMedia(chatId, messageId, new InputMediaAnimation(gifFile))); assertEquals(Integer.valueOf(1), response.message().animation().duration()); Integer durationAnim = 17, width = 21, height = 22; response = (SendResponse) bot.execute(new EditMessageMedia(chatId, messageId, new InputMediaAnimation(gifBytes).duration(durationAnim).width(width).height(height) )); Animation animation = response.message().animation(); assertEquals(Integer.valueOf(1), animation.duration()); assertEquals(width, animation.width()); assertEquals(height, animation.height()); response = (SendResponse) bot.execute(new EditMessageMedia(chatId, messageId, new InputMediaAnimation(gifFileId))); assertTrue(response.isOk()); AnimationCheck.check(response.message().animation()); assertEquals(Integer.valueOf(3), response.message().animation().duration()); assertNotEquals(gifFileId, response.message().animation().fileId()); assertNotNull(response.message().document()); assertEquals((Integer) 57527, response.message().document().fileSize()); assertEquals("video/mp4", response.message().document().mimeType()); response = (SendResponse) bot.execute(new EditMessageMedia(chatId, messageId, new InputMediaAudio(audioFileId))); assertEquals((Integer) 10286, response.message().audio().fileSize()); response = (SendResponse) bot.execute(new EditMessageMedia(chatId, messageId, new InputMediaAudio(audioFile))); assertEquals((Integer) 10286, response.message().audio().fileSize()); response = (SendResponse) bot.execute(new EditMessageMedia(chatId, messageId, new InputMediaAudio(audioBytes))); assertEquals((Integer) 10286, response.message().audio().fileSize()); Integer duration = 34; String performer = "some performer", title = "just a title"; response = (SendResponse) bot.execute(new EditMessageMedia(chatId, messageId, new InputMediaAudio(audioFile).duration(duration).performer(performer).title(title) )); Audio audio = response.message().audio(); assertEquals((Integer) 10286, audio.fileSize()); assertEquals(duration, audio.duration()); assertEquals(performer, audio.performer()); assertEquals(title, audio.title()); response = (SendResponse) bot.execute(new EditMessageMedia(chatId, messageId, new InputMediaPhoto(photoFileId).thumb(thumbFile))); assertNotNull(response.message().photo()); response = (SendResponse) bot.execute(new EditMessageMedia(chatId, messageId, new InputMediaVideo(videoFileId).thumb(thumbFile))); assertNotNull(response.message().video()); }
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();  }