pro.zackpollard.telegrambot.api.menu.button.impl.SubInlineMenuButton Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtelegram-botapi Show documentation
Show all versions of jtelegram-botapi Show documentation
The Java Telegram Bot API is a wrapper for the Telegram HTTP Bot API
package pro.zackpollard.telegrambot.api.menu.button.impl;
import pro.zackpollard.telegrambot.api.chat.CallbackQuery;
import pro.zackpollard.telegrambot.api.keyboards.InlineKeyboardButton;
import pro.zackpollard.telegrambot.api.menu.InlineMenu;
import pro.zackpollard.telegrambot.api.menu.button.AbstractInlineMenuButton;
/**
* A button which opens a sub menu.
*
* @author Mazen Kotb
*/
public class SubInlineMenuButton extends AbstractInlineMenuButton {
private final InlineMenu nextMenu;
public SubInlineMenuButton(InlineMenu owner, int row, int num, InlineMenu nextMenu) {
super(owner, row, num);
this.nextMenu = nextMenu;
}
public SubInlineMenuButton(InlineMenu owner, int row, int num, InlineMenu nextMenu, String text) {
super(owner, row, num, text);
this.nextMenu = nextMenu;
}
@Override
public InlineKeyboardButton toKeyboardButton() {
return keyboardBuilder().build();
}
@Override
public void handlePress(CallbackQuery query) {
executeCallback();
owner.unregister();
nextMenu.start();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy