public class InlineMenu extends Object
builder(TelegramBot),
builder(TelegramBot, Chat)| Modifier and Type | Method and Description |
|---|---|
void |
addRow(InlineMenuRow row) |
void |
apply()
Apply any updates to the message (for viewer on Telegram)
|
static InlineMenuBuilder |
builder(TelegramBot bot)
Create a new inline menu builder
|
static InlineMenuBuilder |
builder(TelegramBot bot,
Chat forWhom)
Creates new builder, initializes with the required Chat field
|
void |
deleteRow(InlineMenuRow row) |
void |
deleteRowAt(int index) |
boolean |
handle(CallbackQuery query,
int row,
int button)
Handle an inline query sent.
|
InlineMenuRow |
rowAt(int index)
Returns row of specified index
|
List<InlineMenuRow> |
rows() |
void |
setInternalId(int newId)
Set the new internal id.
|
void |
setMessageText(SendableTextMessage.SendableTextMessageBuilder messageBuilder)
Set the text of the current message, updates keyboard
|
void |
setRow(int index,
InlineMenuRow row) |
int |
size() |
void |
start()
Starts the inline menu, applies it's keyboard to the menu.
|
InlineKeyboardMarkup |
toKeyboard()
Converts rows to the inline keyboard markup used by the Telegram API
|
void |
unregister()
Disables listener of the menu.
|
public static InlineMenuBuilder builder(TelegramBot bot)
bot - The bot that will be used to send the message for this inline menupublic static InlineMenuBuilder builder(TelegramBot bot, Chat forWhom)
bot - The bot that will be used to send the message for this inline menuforWhom - The chat the inline menu will be sent topublic List<InlineMenuRow> rows()
public int size()
public void start()
apply(),
InlineMenuRegistry.register(InlineMenu)public void unregister()
public InlineMenuRow rowAt(int index)
index - Index to get the row atIndexOutOfBoundsException - if provided out of bounds indexpublic void deleteRowAt(int index)
public void deleteRow(InlineMenuRow row)
public void addRow(InlineMenuRow row)
public void setRow(int index,
InlineMenuRow row)
public InlineKeyboardMarkup toKeyboard()
public boolean handle(CallbackQuery query, int row, int button)
query - The callback queryrow - The button's rowbutton - The button's columnInlineMenuRegistry,
InlineMenuRow.handle(CallbackQuery, int)public void apply()
public void setMessageText(SendableTextMessage.SendableTextMessageBuilder messageBuilder)
messageBuilder - New Message textapply()public void setInternalId(int newId)
newId - Internal idInlineMenuRegistryCopyright © 2017. All rights reserved.