telegramx.js

ReplyKeyboardBuilder

class

Fluent builder for a custom reply keyboard (ReplyKeyboardMarkup).

Declaration

declare class ReplyKeyboardBuilder 

Methods

buttonmethod#
button(button: T.KeyboardButton): this;
ParameterType
buttonT.KeyboardButton
Returns this

Add a fully-specified button to the current row.

oneTimemethod#
oneTime(value?: boolean): this;
ParameterType
value?boolean
Returns this

Hide the keyboard after one use.

persistent(value?: boolean): this;
ParameterType
value?boolean
Returns this

Keep the keyboard persistently open.

placeholder(text: string): this;
ParameterType
textstring
Returns this

Set the placeholder shown in the input field while the keyboard is active.

requestContact(text: string): this;
ParameterType
textstring
Returns this

Add a button that requests the user's phone number.

requestLocation(text: string): this;
ParameterType
textstring
Returns this

Add a button that requests the user's location.

requestPoll(text: string, type?: T.KeyboardButtonPollType['type']): this;
ParameterType
textstring
type?T.KeyboardButtonPollType['type']
Returns this

Add a button that asks the user to create a poll.

resizemethod#
resize(value?: boolean): this;
ParameterType
value?boolean
Returns this

Resize the keyboard to fit its buttons.

rowmethod#
row(): this;
Returns this

Start a new row of buttons.

selective(value?: boolean): this;
ParameterType
value?boolean
Returns this

Show the keyboard only to specific users in a group.

textmethod#
text(text: string): this;
ParameterType
textstring
Returns this

Add a plain text button (sends its label as a message when tapped).

toJSONmethod#

Produce the ReplyKeyboardMarkup object, dropping any trailing empty row.

webAppmethod#
webApp(text: string, url: string): this;
ParameterType
textstring
urlstring
Returns this

Add a button that launches a Web App.