@Test public void sendAnimation() { Integer width = 340, height = 240; String caption = "gif *file*", captionCheck = "gif file"; SendResponse response = bot.execute(new SendAnimation(chatId, gifFile) .duration(222).width(width).height(height).thumb(thumbFile) .caption(caption).parseMode(ParseMode.Markdown)); assertTrue(response.isOk()); Animation animation = response.message().animation(); assertEquals((Integer) 1, animation.duration()); assertEquals(width, animation.width()); assertEquals(height, animation.height()); assertNotEquals("telegram should generate thumb", thumbSize, animation.thumb().fileSize()); assertEquals(captionCheck, response.message().caption()); assertEquals(MessageEntity.Type.bold, response.message().captionEntities()[0].type()); response = bot.execute(new SendAnimation(chatId, gifBytes).thumb(thumbBytes)); animation = response.message().animation(); assertEquals((Integer) 1, animation.duration()); assertEquals((Integer) 160, animation.width()); assertEquals((Integer) 160, animation.height()); assertNotEquals("telegram should generate thumb", thumbSize, animation.thumb().fileSize()); response = bot.execute(new SendAnimation(chatId, gifFileId)); animation = response.message().animation(); assertEquals((Integer) 3, animation.duration()); assertEquals((Integer) 128, animation.width()); assertEquals((Integer) 128, animation.height()); }
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();  }