@Test public void sendAudio() { Message message = bot.execute(new SendAudio(chatId, audioFileId)).message(); MessageTest.checkMessage(message); AudioTest.checkAudio(message.audio(), false); message = bot.execute(new SendAudio(chatId, audioFile).thumb(thumbFile)).message(); MessageTest.checkMessage(message); AudioTest.checkAudio(message.audio()); assertEquals(thumbSize, message.audio().thumb().fileSize()); String cap = "http: ParseMode parseMode = ParseMode.HTML; int duration = 100; SendAudio sendAudio = new SendAudio(chatId, audioBytes).thumb(thumbBytes).duration(duration) .caption(cap).parseMode(parseMode).performer(performer).title(title); message = bot.execute(sendAudio).message(); MessageTest.checkMessage(message); Audio audio = message.audio(); AudioTest.checkAudio(audio); assertEquals(cap.replace("<b>", "").replace("</b>", ""), message.caption()); assertEquals((Integer) 100, audio.duration()); assertEquals(performer, audio.performer()); assertEquals(title, audio.title()); assertEquals(thumbSize, audio.thumb().fileSize()); MessageEntity captionEntity = message.captionEntities()[0]; assertEquals(MessageEntity.Type.url, captionEntity.type()); assertEquals((Integer) 0, captionEntity.offset()); assertEquals((Integer) 12, captionEntity.length()); captionEntity = message.captionEntities()[1]; assertEquals(MessageEntity.Type.bold, captionEntity.type()); assertEquals((Integer) 14, captionEntity.offset()); assertEquals((Integer) 4, captionEntity.length()); assertEquals(MessageEntity.Type.hashtag, message.captionEntities()[2].type()); }
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();  }