@Test public void editMessageCaption() { String text = "Update " + System.currentTimeMillis() + " <b>bold</b>"; SendResponse sendResponse = (SendResponse) bot.execute(new EditMessageCaption(chatId, 8124) .caption(text) .parseMode(ParseMode.HTML) .replyMarkup(new InlineKeyboardMarkup())); assertTrue(sendResponse.isOk()); Message message = sendResponse.message(); assertEquals(text.replace("<b>", "").replace("</b>", ""), message.caption()); MessageEntity captionEntity = message.captionEntities()[0]; assertEquals(MessageEntity.Type.bold, captionEntity.type()); assertEquals((Integer) 21, captionEntity.offset()); assertEquals((Integer) 4, captionEntity.length()); BaseResponse response = bot.execute(new EditMessageCaption(channelName, 511).caption(text)); assertTrue(response.isOk()); response = bot.execute(new EditMessageCaption("AgAAAPrwAQCj_Q4D2s-51_8jsuU").caption(text)); if (!response.isOk()) { assertEquals(400, response.errorCode()); assertEquals("Bad Request: MESSAGE_ID_INVALID", response.description()); } }
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();  }