Hi!
Got a exception, when try use InlineButton from telegram, sended via bot
version - 4.3
Error:
Caused by: com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Missing type id when trying to resolve subtype of [simple type, class org.telegram.telegrambots.meta.api.objects.replykeyboard.InlineKeyboardMarkup]: missing type id property '@class' (for POJO property 'reply_markup')
at [Source: (String)"{"ok":true,"result":{"message_id":97,"from":{"id":123,"is_bot":true,"first_name":"MyBot","username":"MyBot_bot"},"chat":{"id":321,"first_name":"Me","last_name":"Me","username":"Me","type":"private"},"date":1559825108,"text":"\u0438\u044e\u043d. test1\ntest2\ntest3\ntest4","entities":[{"offset":23,"length":38,"type":"bold"},{"offset":113,"length":9,"type":"bold"}]"[truncated 92 chars]; line: 1, column: 590] (through reference chain: org.telegram.telegrambots.meta.api.objects.replykeyboard.ApiResponse["result"]->org.telegram.telegrambots.meta.api.objects.Message["reply_markup"])
Code:
ArrayList<String> eventsStringList = new ArrayList<>();
events.forEach(event ->
eventsStringList.add(event.presentation())
);
preparedMessage.enableMarkdown(true);
preparedMessage.setChatId(message.getChatId());
preparedMessage.setText(String.join("\n", eventsStringList));
InlineKeyboardMarkup markupInline = new InlineKeyboardMarkup();
List<List<InlineKeyboardButton>> rowsInline = new ArrayList<>();
List<InlineKeyboardButton> rowInline = new ArrayList<>();
rowInline.add(new InlineKeyboardButton().setText("test1").setCallbackData("update_msg_text"));
rowsInline.add(rowInline);
markupInline.setKeyboard(rowsInline);
preparedMessage.setReplyMarkup(markupInline);
sendMessage(preparedMessage); //here will try/catch execute(preparedMessage)
Hi! Got a exception, when try use InlineButton from telegram, sended via bot
version - 4.3 Error:
Code: