@Test public void underlineStrikethroughMessageEntity() { String cap = "<u>under1</u> <ins>under2</ins> <s>strike1</s> <strike>strike2</strike> <del>strike3</del>"; cap += " <u><del>nested-tag</del></u>"; ParseMode parseMode = ParseMode.HTML; SendAudio sendAudio = new SendAudio(chatId, audioFileId).caption(cap).parseMode(parseMode); Message message = bot.execute(sendAudio).message(); MessageTest.checkMessage(message); String htmlCaption = cap .replace("<u>", "").replace("</u>", "") .replace("<ins>", "").replace("</ins>", "") .replace("<s>", "").replace("</s>", "") .replace("<strike>", "").replace("</strike>", "") .replace("<del>", "").replace("</del>", ""); assertEquals(htmlCaption, message.caption()); assertEquals(7, message.captionEntities().length); MessageEntity captionEntity = message.captionEntities()[0]; assertEquals(MessageEntity.Type.underline, captionEntity.type()); assertEquals((Integer) 0, captionEntity.offset()); assertEquals((Integer) 6, captionEntity.length()); captionEntity = message.captionEntities()[1]; assertEquals(MessageEntity.Type.underline, captionEntity.type()); assertEquals((Integer) 7, captionEntity.offset()); assertEquals((Integer) 6, captionEntity.length()); captionEntity = message.captionEntities()[2]; assertEquals(MessageEntity.Type.strikethrough, captionEntity.type()); assertEquals((Integer) 14, captionEntity.offset()); assertEquals((Integer) 7, captionEntity.length()); captionEntity = message.captionEntities()[3]; assertEquals(MessageEntity.Type.strikethrough, captionEntity.type()); assertEquals((Integer) 22, captionEntity.offset()); assertEquals((Integer) 7, captionEntity.length()); captionEntity = message.captionEntities()[4]; assertEquals(MessageEntity.Type.strikethrough, captionEntity.type()); assertEquals((Integer) 30, captionEntity.offset()); assertEquals((Integer) 7, captionEntity.length()); captionEntity = message.captionEntities()[5]; assertEquals(MessageEntity.Type.underline, captionEntity.type()); assertEquals((Integer) 38, captionEntity.offset()); assertEquals((Integer) 10, captionEntity.length()); captionEntity = message.captionEntities()[6]; assertEquals(MessageEntity.Type.strikethrough, captionEntity.type()); assertEquals((Integer) 38, captionEntity.offset()); assertEquals((Integer) 10, 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();  }