Creates an instance of Keyboard.
Optional
keyboard: KeyboardButton[][]A 2D array of keyboard buttons.
Optional
input_The placeholder text for the input field.
Optional
is_Indicates whether the keyboard is persistent.
Readonly
keyboardOptional
one_Indicates whether the keyboard is a one-time keyboard.
Optional
resize_Indicates whether the keyboard should be resized.
Optional
selectiveIndicates whether the keyboard is selective.
Adds buttons to the last row of the keyboard.
Rest
...buttons: KeyboardButton[]The buttons to add.
The current instance for chaining.
Builds the keyboard structure.
The built keyboard structure.
Creates a deep copy of the current Keyboard instance.
Optional
keyboard: KeyboardButton[][]A new instance of Keyboard with the same buttons and properties.
Combines the current keyboard with another one.
The current instance for chaining.
Checks if this keyboard is equal to another keyboard.
The other keyboard to compare with.
True if both keyboards are equal based on their structure and properties, otherwise false.
Adds a request chat button to the keyboard.
The button text.
The request ID.
Optional
options: Omit<KeyboardButtonRequestChat, "requestId">Additional options for the button.
The current instance for chaining.
Adds a request users button to the keyboard.
The button text.
The request ID.
Optional
options: Omit<KeyboardButtonRequestUsers, "requestId">Additional options for the button.
The current instance for chaining.
Adds a new row of buttons to the keyboard.
Rest
...buttons: KeyboardButton[]The buttons to add.
The current instance for chaining.
Converts the keyboard to a JSON format suitable for Telegram API.
An object representing the keyboard in JSON format.
Static
fromCreates a Keyboard instance from another instance or a 2D array of buttons.
The source Keyboard instance or 2D array of buttons.
A new instance of Keyboard.
Static
requestCreates a request chat button.
The button text.
The request ID.
Optional
options: Omit<KeyboardButtonRequestChat, "requestId">Additional options for the button.
The created request chat button.
Static
requestCreates a request contact button.
The button text.
The created request contact button.
Static
requestCreates a request location button.
The button text.
The created request location button.
Static
requestCreates a request poll button.
The button text.
Optional
type: "quiz" | "regular"The type of the poll button.
The created request poll button.
Static
requestCreates a request users button.
The button text.
The request ID.
Optional
options: Omit<KeyboardButtonRequestUsers, "requestId">Additional options for the button.
The created request users button.
Static
textCreates a text button.
The button text.
The created text button.
Static
webCreates a web app button.
The button text.
The URL of the web app.
The created web app button.
Represents a custom keyboard for Telegram bots.