Constructor
new ReplyKeyboardMarkup()
This object represents a custom keyboard with reply options
- Source:
Members
keyboard
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
|
Array.<Array.<module:reply_keyboard_markup.KeyboardButton>> | Array of button rows, each represented by an Array of KeyboardButton objects | |
is_persistent |
boolean |
<optional> |
Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon |
resize_keyboard |
boolean |
<optional> |
Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard |
one_time_keyboard |
boolean |
<optional> |
Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false |
input_field_placeholder |
string |
<optional> |
The placeholder to be shown in the input field when the keyboard is active; 1-64 characters |
selective |
boolean |
<optional> |
Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard |
- Source:
Methods
appendRequestContactButton(text, rowopt)
Append a request contact button to reply keyboard
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
text |
string | Text label for the button | |
row |
number |
<optional> |
Row number to append button (0-based). If not specified, the button will append to the last row |
- Source:
appendRequestLocationButton(text, rowopt)
Append a request location button to inline keyboard
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
text |
string | Text label for the button | |
row |
number |
<optional> |
Row number to append button (0-based). If not specified, the button will append to the last row |
- Source:
appendRequestPollButton(text, pollTypeopt, rowopt)
Append a request poll button to reply keyboard
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
text |
string | Text label for the button | |
pollType |
module:enums.KeyboardButtonPollTypes |
<optional> |
If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only |
row |
number |
<optional> |
Row number to append button (0-based). If not specified, the button will append to the last row |
- Source:
appendRows(numberopt)
Append one or more rows to the keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
number |
number |
<optional> |
1 | Number of rows to append. If not specified, wlll append one row |
- Source:
appendTextButton(text, rowopt)
Append a text button to reply keyboard
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
text |
string | Text label for the button | |
row |
number |
<optional> |
Row number to append button (0-based). If not specified, the button will append to the last row |
- Source:
appendWebAppButton(text, url, rowopt)
Append a Web App button to reply keyboard
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
text |
string | Text label for the button | |
url |
string | An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps | |
row |
number |
<optional> |
Row number to append button (0-based). If not specified, the button will append to the last row |
- Source:
deleteButton(rowopt, columnopt)
Remove a button from a specific row
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
row |
number |
<optional> |
Number of row of button to delete (0-based). If not specified, will delete a button from the last row |
column |
number |
<optional> |
Number of column of button to delete (0-based). If not specified, will delete the last button from the row |
- Source:
deleteRow(indexopt)
Delete a row from the keyboard
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
index |
number |
<optional> |
Index of row to delete (0-based). If not specified, will delete the last row |
- Source:
insertRequestContactButton(text, rowopt, columnopt)
Insert a request contact button to reply keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text |
string | Text label for the button | ||
row |
number |
<optional> |
0 | Row number to insert button (0-based). If not specified, the button will insert to the first row |
column |
number |
<optional> |
0 | Number of column of button to insert (0-based). If not specified, the button will insert to the first position of the row |
- Source:
insertRequestLocationButton(text, rowopt, columnopt)
Insert a request location button to reply keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text |
string | Text label for the button | ||
row |
number |
<optional> |
0 | Row number to insert button (0-based). If not specified, the button will insert to the first row |
column |
number |
<optional> |
0 | Number of column of button to insert (0-based). If not specified, the button will insert to the first position of the row |
- Source:
insertRequestPollButton(text, pollTypeopt, rowopt, columnopt)
Insert a request poll button to reply keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text |
string | Text label for the button | ||
pollType |
module:enums.KeyboardButtonPollTypes |
<optional> |
If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only | |
row |
number |
<optional> |
0 | Row number to insert button (0-based). If not specified, the button will insert to the first row |
column |
number |
<optional> |
0 | Number of column of button to insert (0-based). If not specified, the button will insert to the first position of the row |
- Source:
insertRows(indexopt, numberopt)
Insert one or more rows to the keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
index |
number |
<optional> |
0 | Number of position to insert rows (0-based). If not specified, rows will insert at the first position |
number |
number |
<optional> |
1 | Number of rows to append. If not specified, wlll insert one row |
- Source:
insertTextButton(text, rowopt, columnopt)
Insert a text button to reply keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text |
string | Text label for the button | ||
row |
number |
<optional> |
0 | Row number to insert button (0-based). If not specified, the button will insert to the first row |
column |
number |
<optional> |
0 | Number of column of button to insert (0-based). If not specified, the button will insert to the first position of the row |
- Source:
insertWebAppButton(text, url, rowopt, columnopt)
Insert a Web App button to reply keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text |
string | Text label for the button | ||
url |
string | An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps | ||
row |
number |
<optional> |
0 | Row number to insert button (0-based). If not specified, the button will insert to the first row |
column |
number |
<optional> |
0 | Number of column of button to insert (0-based). If not specified, the button will insert to the first position of the row |
- Source: