Class InlineKeyboard

Represents an inline keyboard for Telegram bots.

Constructors

Properties

inlineKeyboard: InlineKeyboardButton[][]

Methods

  • Adds buttons to the last row of the inline keyboard.

    Parameters

    Returns this

    The current instance for chaining.

  • Checks if this inline keyboard is equal to another inline keyboard.

    Parameters

    Returns boolean

    True if both keyboards are equal based on their structure and button properties, otherwise false.

  • Adds a game button to the inline keyboard.

    Parameters

    • text: string

      The button text.

    Returns this

    The current instance for chaining.

  • Adds a login button to the inline keyboard.

    Parameters

    • text: string

      The button text.

    • loginUrl: string | LoginUrl

      The login URL or LoginUrl object.

    Returns this

    The current instance for chaining.

  • Adds a pay button to the inline keyboard.

    Parameters

    • text: string

      The button text.

    Returns this

    The current instance for chaining.

  • Adds a new row of buttons to the inline keyboard.

    Parameters

    Returns this

    The current instance for chaining.

  • Adds a switch inline button to the inline keyboard.

    Parameters

    • text: string

      The button text.

    • Optionalquery: string

      The inline query to switch to.

    Returns this

    The current instance for chaining.

  • Adds a switch inline chosen chat button to the inline keyboard.

    Parameters

    Returns this

    The current instance for chaining.

  • Adds a switch inline current chat button to the inline keyboard.

    Parameters

    • text: string

      The button text.

    • Optionalquery: string

      The inline query to switch to in the current chat.

    Returns this

    The current instance for chaining.

  • Adds a callback button to the inline keyboard.

    Parameters

    • text: string

      The button text.

    • Optionaldata: string

      The callback data.

    Returns this

    The current instance for chaining.

  • Adds a URL button to the inline keyboard.

    Parameters

    • text: string

      The button text.

    • url: string

      The URL to be opened when the button is pressed.

    Returns this

    The current instance for chaining.

  • Adds a WebApp button to the inline keyboard.

    Parameters

    • text: string

      The button text.

    • url: string

      The URL to the WebApp.

    Returns this

    The current instance for chaining.

  • Creates a URL button.

    Parameters

    • text: string

      The button text.

    • url: string

      The URL to be opened when the button is pressed.

    Returns UrlButton

    The created URL button.