Class InlineKeyboardButton
java.lang.Object
io.micronaut.chatbots.telegram.api.InlineKeyboardButton
This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable String
@Nullable CallbackGame
@Nullable LoginUrl
@Nullable Boolean
getPay()
@Nullable String
@Nullable String
@NonNull String
getText()
@Nullable String
getUrl()
@Nullable WebAppInfo
void
setCallbackData
(@Nullable String callbackData) void
setCallbackGame
(@Nullable CallbackGame callbackGame) void
setLoginUrl
(@Nullable LoginUrl loginUrl) void
void
setSwitchInlineQuery
(@Nullable String switchInlineQuery) void
setSwitchInlineQueryCurrentChat
(@Nullable String switchInlineQueryCurrentChat) void
void
void
setWebApp
(@Nullable WebAppInfo webApp) toString()
-
Constructor Details
-
InlineKeyboardButton
public InlineKeyboardButton()
-
-
Method Details
-
getText
- Returns:
- Label text on the button.
-
setText
- Parameters:
text
- Label text on the button.
-
getUrl
- Returns:
- HTTP or tg:// url to be opened when button is pressed
-
setUrl
- Parameters:
url
- HTTP or tg:// url to be opened when button is pressed
-
getLoginUrl
- Returns:
- An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
-
setLoginUrl
- Parameters:
loginUrl
- An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
-
getCallbackData
- Returns:
- Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes.
-
setCallbackData
- Parameters:
callbackData
- Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes.
-
getSwitchInlineQuery
- Returns:
- If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.
-
setSwitchInlineQuery
- Parameters:
switchInlineQuery
- If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.
-
getSwitchInlineQueryCurrentChat
- Returns:
- If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot’s username will be inserted.
-
setSwitchInlineQueryCurrentChat
public void setSwitchInlineQueryCurrentChat(@Nullable @Nullable String switchInlineQueryCurrentChat) - Parameters:
switchInlineQueryCurrentChat
- If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot’s username will be inserted.
-
getCallbackGame
- Returns:
- Description of the game that will be launched when the user presses the button.
-
setCallbackGame
- Parameters:
callbackGame
- Description of the game that will be launched when the user presses the button.
-
getPay
- Returns:
- Specify True, to send a Pay button.
-
setPay
- Parameters:
pay
- Specify True, to send a Pay button.
-
getWebApp
- Returns:
- 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.
-
setWebApp
- Parameters:
webApp
- 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.
-
toString
-