@Test public void sendVideo() { Message message = bot.execute(new SendVideo(chatId, videoFileId)).message(); MessageTest.checkMessage(message); VideoTest.check(message.video(), false); message = bot.execute(new SendVideo(chatId, videoFile).thumb(thumbFile)).message(); MessageTest.checkMessage(message); VideoTest.check(message.video()); assertNotEquals("telegram should generate thumb", thumbSize, message.video().thumb().fileSize()); String caption = "caption <b>bold</b>"; Integer duration = 100; message = bot.execute( new SendVideo(chatId, videoBytes).thumb(thumbBytes) .caption(caption).parseMode(ParseMode.HTML) .duration(duration).height(1).width(2).supportsStreaming(true)) .message(); MessageTest.checkMessage(message); assertEquals(caption.replace("<b>", "").replace("</b>", ""), message.caption()); Video video = message.video(); VideoTest.check(message.video()); assertEquals(duration, video.duration()); assertEquals((Integer) 120, video.height()); assertEquals((Integer) 400, video.width()); assertEquals("video/mp4", video.mimeType()); assertNotEquals("telegram should generate thumb", thumbSize, video.thumb().fileSize()); MessageEntity captionEntity = message.captionEntities()[0]; assertEquals(MessageEntity.Type.bold, captionEntity.type()); assertEquals((Integer) 8, captionEntity.offset()); assertEquals((Integer) 4, captionEntity.length()); }
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();  }