@Test public void sendPollWithKeyboard() { String question = "Question ?"; String[] answers = {"Answer 1", "Answer 2"}; long closeDate = System.currentTimeMillis() / 1000 + 500; SendResponse sendResponse = bot.execute( new SendPoll(chatId, question, answers) .type("regular") .allowsMultipleAnswers(true) .replyMarkup(new ReplyKeyboardMarkup( new KeyboardButton("all polls").requestPoll(new KeyboardButtonPollType()), new KeyboardButton("quiz").requestPoll(new KeyboardButtonPollType(Poll.Type.quiz)), new KeyboardButton("regular").requestPoll(new KeyboardButtonPollType("regular")))) .closeDate(closeDate) ); Poll poll = sendResponse.message().poll(); assertEquals(question, poll.question()); assertEquals(answers.length, poll.options().length); assertTrue(poll.isAnonymous()); assertEquals(poll.totalVoterCount(), Integer.valueOf(0)); assertEquals(poll.type(), Poll.Type.regular); assertTrue(poll.allowsMultipleAnswers()); assertEquals(closeDate, poll.closeDate().longValue()); }
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();  }