@Test public void underlineStrikethroughMarkdown() { String cap = "__under1__ ~strike1~ __~nested~__"; ParseMode parseMode = ParseMode.MarkdownV2; SendAudio sendAudio = new SendAudio(chatId, audioFileId).caption(cap).parseMode(parseMode); Message message = bot.execute(sendAudio).message(); MessageTest.checkMessage(message); String htmlCaption = cap.replace("__", "").replace("~", ""); assertEquals(htmlCaption, message.caption()); assertEquals(4, 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.strikethrough, captionEntity.type()); assertEquals((Integer) 7, captionEntity.offset()); assertEquals((Integer) 7, captionEntity.length()); captionEntity = message.captionEntities()[2]; assertEquals(MessageEntity.Type.underline, captionEntity.type()); assertEquals((Integer) 15, captionEntity.offset()); assertEquals((Integer) 6, captionEntity.length()); captionEntity = message.captionEntities()[3]; assertEquals(MessageEntity.Type.strikethrough, captionEntity.type()); assertEquals((Integer) 15, captionEntity.offset()); assertEquals((Integer) 6, 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();  }