Class InlineKeyboardButton

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

public class InlineKeyboardButton extends Object
This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
See Also:
  • Constructor Details

    • InlineKeyboardButton

      public InlineKeyboardButton()
  • Method Details

    • getText

      @NonNull public @NonNull String getText()
      Returns:
      Label text on the button.
    • setText

      public void setText(@NonNull @NonNull String text)
      Parameters:
      text - Label text on the button.
    • getUrl

      @Nullable public @Nullable String getUrl()
      Returns:
      HTTP or tg:// url to be opened when button is pressed
    • setUrl

      public void setUrl(@Nullable @Nullable String url)
      Parameters:
      url - HTTP or tg:// url to be opened when button is pressed
    • getLoginUrl

      @Nullable public @Nullable LoginUrl getLoginUrl()
      Returns:
      An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
    • setLoginUrl

      public void setLoginUrl(@Nullable @Nullable LoginUrl loginUrl)
      Parameters:
      loginUrl - An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
    • getCallbackData

      @Nullable public @Nullable String getCallbackData()
      Returns:
      Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes.
    • setCallbackData

      public void setCallbackData(@Nullable @Nullable String callbackData)
      Parameters:
      callbackData - Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes.
    • getSwitchInlineQuery

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

      public void setSwitchInlineQuery(@Nullable @Nullable String switchInlineQuery)
      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

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

      @Nullable public @Nullable CallbackGame getCallbackGame()
      Returns:
      Description of the game that will be launched when the user presses the button.
    • setCallbackGame

      public void setCallbackGame(@Nullable @Nullable CallbackGame callbackGame)
      Parameters:
      callbackGame - Description of the game that will be launched when the user presses the button.
    • getPay

      @Nullable public @Nullable Boolean getPay()
      Returns:
      Specify True, to send a Pay button.
    • setPay

      public void setPay(@Nullable @Nullable Boolean pay)
      Parameters:
      pay - Specify True, to send a Pay button.
    • getWebApp

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

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

      public String toString()
      Overrides:
      toString in class Object