telegramsjs
    Preparing search index...

    Class InlineKeyboardBuilder

    Represents an inline keyboard for Telegram bots.

    Index

    Constructors

    Properties

    inline_keyboard: InlineKeyboardButton[][]

    Methods

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

      Parameters

      Returns this

      The current instance for chaining.

    • Adds a copy text button to the inline keyboard.

      Parameters

      • text: string

        The button text.

      • OptionalcopyText: string | CopyTextButton

        The text copy or CopyTextButton object.

      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.

    • Converts the inline keyboard to a JSON format suitable for Telegram API.

      Returns { inline_keyboard: InlineKeyboardButton[][] }

      An object representing the inline keyboard in JSON format.

    • 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 game button.

      Parameters

      • text: string

        The button text.

      Returns GameButton

      The created game button.

    • Creates a login button.

      Parameters

      • text: string

        The button text.

      • loginUrl: string | LoginUrl

        The login URL or LoginUrl object.

      Returns LoginButton

      The created login button.

    • Creates a pay button.

      Parameters

      • text: string

        The button text.

      Returns PayButton

      The created pay button.

    • Creates a switch inline button.

      Parameters

      • text: string

        The button text.

      • Optionalquery: string

        The inline query to switch to.

      Returns SwitchInlineButton

      The created switch inline button.

    • Creates a switch inline current chat button.

      Parameters

      • text: string

        The button text.

      • Optionalquery: string

        The inline query to switch to in the current chat.

      Returns SwitchInlineCurrentChatButton

      The created switch inline current chat button.

    • Creates a callback button.

      Parameters

      • text: string

        The button text.

      • Optionaldata: string

        The callback data.

      Returns CallbackButton

      The created callback button.

    • 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.