@Test public void answerCallback() { CallbackQuery callbackQuery = BotUtils.parseUpdate(testCallbackQuery).callbackQuery(); assertNotNull(callbackQuery); assertFalse(callbackQuery.id().isEmpty()); UserTest.checkUser(callbackQuery.from(), true); assertEquals(chatId, callbackQuery.from().id()); MessageTest.checkMessage(callbackQuery.message()); assertFalse(callbackQuery.chatInstance().isEmpty()); assertEquals("pengrad_test_game", callbackQuery.gameShortName()); assertNull(callbackQuery.inlineMessageId()); assertNull(callbackQuery.data()); BaseResponse response = bot.execute(new AnswerCallbackQuery(callbackQuery.id()) .text("answer callback") .url("telegram.me/pengrad_test_bot?game=pengrad_test_game") .showAlert(false) .cacheTime(1)); assertFalse(response.isOk()); assertEquals(400, response.errorCode()); assertEquals("Bad Request: query is too old and response timeout expired or query ID is 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();  }