Class KeyboardButton
java.lang.Object
io.micronaut.chatbots.telegram.api.KeyboardButton
This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable Boolean
@Nullable Boolean
@Nullable KeyboardButtonPollType
@NonNull String
getText()
@Nullable WebAppInfo
void
setRequestContact
(@Nullable Boolean requestContact) void
setRequestLocation
(@Nullable Boolean requestLocation) void
setRequestPoll
(@Nullable KeyboardButtonPollType requestPoll) void
void
setWebApp
(@Nullable WebAppInfo webApp) toString()
-
Constructor Details
-
KeyboardButton
public KeyboardButton()
-
-
Method Details
-
getText
- Returns:
- Text of the button.
-
setText
- Parameters:
text
- Text of the button.
-
getRequestContact
- Returns:
- If True, the user's phone number will be sent as a contact when the button is pressed.
-
setRequestContact
- Parameters:
requestContact
- If True, the user's phone number will be sent as a contact when the button is pressed.
-
getRequestLocation
- Returns:
- If True, the user's current location will be sent when the button is pressed.
-
setRequestLocation
- Parameters:
requestLocation
- If True, the user's current location will be sent when the button is pressed.
-
getRequestPoll
- Returns:
- If specified, the user will be asked to create a poll and send it to the bot when the button is pressed.
-
setRequestPoll
- Parameters:
requestPoll
- If specified, the user will be asked to create a poll and send it to the bot when the button is pressed.
-
getWebApp
- Returns:
- If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only.
-
setWebApp
- Parameters:
webApp
- If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only.
-
toString
-