Is it possible to iterate through elements and set keyboard buttons?
Java telegram bot
I try to build class that can ask questions from repository and provide answers from another repository with InLineKeyboard. I have many answers for each question, can get them with Preicate var answers = answerRepository.findAll(new AnswerSpecification(model)); (it`s already works fine). The problem is loop thath builds keyboard.
i want it to be build depending on how many answers do repository have, but not more than 3 in line.enter image description here
Main problem is that it sets each button with 1st element in List, how can i fix it? I want each next button have next element from repo.