Class InlineKeyboardButton
java.lang.Object
io.github.natanimn.telebof.types.keyboard.InlineKeyboardButton
- All Implemented Interfaces:
Serializable
This object represents one button of an inline keyboard.
Exactly one of the optional fields must be used to specify type of the button.
- Since:
- 3 March 2025
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInlineKeyboardButton
(String text) RequiredInlineKeyboardButton
(String text, String callback_data) -
Method Summary
Modifier and TypeMethodDescriptioncallbackGame
(CallbackGame callback_game) OptionalcopyText
(CopyTextButton copy_text) boolean
int
hashCode()
Optionalpay
(boolean pay) OptionalswitchInlineQueryChosenChat
(SwitchInlineQueryChosenChat switch_inline_query_chosen_chat) OptionalswitchInlineQueryCurrentChat
(String switch_inline_query_current_chat) OptionalOptionalwebApp
(WebAppInfo web_app) Optional
-
Field Details
-
text
-
url
-
callback_data
-
switch_inline_query_current_chat
-
wep_app
-
login_url
-
pay
-
callback_game
-
switch_inline_query_chosen_chat
-
copy_text
-
-
Constructor Details
-
InlineKeyboardButton
-
InlineKeyboardButton
-
-
Method Details
-
url
Optional- Parameters:
url
- HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings. - Returns:
InlineKeyboardButton
-
webApp
Optional- Parameters:
web_app
- Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.- Returns:
InlineKeyboardButton
-
loginUrl
Optional- Parameters:
login_url
- An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.- Returns:
InlineKeyboardButton
-
switchInlineQueryCurrentChat
Optional- Parameters:
switch_inline_query_current_chat
- If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.- Returns:
InlineKeyboardButton
-
callbackGame
Optional- Parameters:
callback_game
- Description of the game that will be launched when the user presses the button.
NOTE: This type of button must always be the first button in the first row.- Returns:
InlineKeyboardButton
-
pay
Optional- Parameters:
pay
- Specify True, to send a Pay button. Substrings “⭐” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.
NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.- Returns:
-
switchInlineQueryChosenChat
public InlineKeyboardButton switchInlineQueryChosenChat(SwitchInlineQueryChosenChat switch_inline_query_chosen_chat) Optional- Parameters:
switch_inline_query_chosen_chat
- If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent on behalf of a Telegram Business account.- Returns:
InlineKeyboardButton
-
copyText
-
equals
-
hashCode
-