Class KeyboardButton

java.lang.Object
io.micronaut.chatbots.telegram.api.KeyboardButton

public class KeyboardButton extends Object
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 Details

    • KeyboardButton

      public KeyboardButton()
  • Method Details

    • getText

      @NonNull public @NonNull String getText()
      Returns:
      Text of the button.
    • setText

      public void setText(@NonNull @NonNull String text)
      Parameters:
      text - Text of the button.
    • getRequestContact

      @Nullable public @Nullable Boolean getRequestContact()
      Returns:
      If True, the user's phone number will be sent as a contact when the button is pressed.
    • setRequestContact

      public void setRequestContact(@Nullable @Nullable Boolean requestContact)
      Parameters:
      requestContact - If True, the user's phone number will be sent as a contact when the button is pressed.
    • getRequestLocation

      @Nullable public @Nullable Boolean getRequestLocation()
      Returns:
      If True, the user's current location will be sent when the button is pressed.
    • setRequestLocation

      public void setRequestLocation(@Nullable @Nullable Boolean requestLocation)
      Parameters:
      requestLocation - If True, the user's current location will be sent when the button is pressed.
    • getRequestPoll

      @Nullable public @Nullable KeyboardButtonPollType 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

      public void setRequestPoll(@Nullable @Nullable KeyboardButtonPollType requestPoll)
      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

      @Nullable public @Nullable WebAppInfo 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

      public void setWebApp(@Nullable @Nullable WebAppInfo webApp)
      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

      public String toString()
      Overrides:
      toString in class Object