@Test public void sendGame() { InlineKeyboardButton[] buttons = { new InlineKeyboardButton("inline game").callbackGame("pengrad test game description"), new InlineKeyboardButton("inline ok").callbackData("callback ok"), new InlineKeyboardButton("cancel").callbackData("callback cancel"), new InlineKeyboardButton("url").url(someUrl), new InlineKeyboardButton("switch inline").switchInlineQuery("query"), new InlineKeyboardButton("switch inline current").switchInlineQueryCurrentChat("query"), }; InlineKeyboardButton[][] inlineKeyboard = new InlineKeyboardButton[1][]; inlineKeyboard[0] = buttons; InlineKeyboardMarkup keyboardMarkup = new InlineKeyboardMarkup(inlineKeyboard); String desc = "pengrad_test_game"; Message message = bot.execute(new SendGame(chatId, desc).replyMarkup(keyboardMarkup)).message(); MessageTest.checkMessage(message); Game game = message.game(); GameTest.check(game); assertEquals(desc, game.description()); InlineKeyboardButton[] actualButtons = message.replyMarkup().inlineKeyboard()[0]; assertEquals(buttons.length, actualButtons.length); assertNotNull(actualButtons[0].callbackGame()); for (int i = 1; i < buttons.length; i++) { assertEquals(buttons[i].text(), actualButtons[i].text()); assertFalse(buttons[i].isPay()); } assertEquals(buttons[1].callbackData(), actualButtons[1].callbackData()); assertEquals(buttons[2].callbackData(), actualButtons[2].callbackData()); assertEquals(buttons[3].url(), actualButtons[3].url()); assertEquals(buttons[4].switchInlineQuery(), actualButtons[4].switchInlineQuery()); assertEquals(buttons[5].switchInlineQueryCurrentChat(), actualButtons[5].switchInlineQueryCurrentChat()); }
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();  }