Constructor
new InlineKeyboardMarkup()
This object represents an inline keyboard that appears right
next to the message it belongs to
- Source:
Members
inline_keyboard
Properties:
| Type | Description |
|---|---|
| Array.<Array.<module:inline_keyboard_markup.InlineKeyboardButton>> | Array of button rows, each represented by an Array of InlineKeyboardButton objects |
- Source:
Methods
addCallbackGameButton(text)
Add a callback game button to inline keyboard
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string | Text label for the button |
- Source:
addPayButton(text)
Add a pay button to inline keyboard
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string | Text label for the button |
- Source:
appendLoginUrlButton(text, url, forwardTextopt, botUsernameopt, requestWriteAccessopt, rowopt)
Append a LoginUrl button to inline keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text |
string | Text label for the button | ||
url |
string | An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data. NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization | ||
forwardText |
string |
<optional> |
New text of the button in forwarded messages | |
botUsername |
string |
<optional> |
Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details | |
requestWriteAccess |
boolean |
<optional> |
false | Pass True to request the permission for your bot to send messages to the user |
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:
appendSwitchInlineQueryButton(text, switchInlineQueryopt, rowopt)
Append a SwitchInlineQuery button to inline keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text |
string | Text label for the button | ||
switchInlineQuery |
string |
<optional> |
"" | If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted |
row |
number |
<optional> |
Row number to append button (0-based). If not specified, the button will append to the last row |
- Source:
appendSwitchInlineQueryCurrentChatButton(text, switchInlineQueryCurrentChatopt, rowopt)
Append a SwitchInlineQueryCurrentChat button to inline keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text |
string | Text label for the button | ||
switchInlineQueryCurrentChat |
string |
<optional> |
"" | If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted. This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options |
row |
number |
<optional> |
Row number to append button (0-based). If not specified, the button will append to the last row |
- Source:
appendTextButton(text, callbackData, rowopt)
Append a text button to inline keyboard
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
text |
string | Text label for the button | |
callbackData |
string | Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes | |
row |
number |
<optional> |
Row number to append button (0-based). If not specified, the button will append to the last row |
- Source:
appendUrlButton(text, url, rowopt)
Append an url button to inline keyboard
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
text |
string | Text label for the button | |
url |
string | HTTP or tg:// url to be opened when the button is
pressed. Links tg://user?id= |
|
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:
insertLoginUrlButton(text, url, forwardTextopt, botUsernameopt, requestWriteAccessopt, rowopt, columnopt)
Insert a LoginUrl button to inline keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text |
string | Text label for the button | ||
url |
string | An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data. NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization | ||
forwardText |
string |
<optional> |
New text of the button in forwarded messages | |
botUsername |
string |
<optional> |
Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details | |
requestWriteAccess |
boolean |
<optional> |
false | Pass True to request the permission for your bot to send messages to the user |
row |
number |
<optional> |
0 | Row number to insert button (0-based). If not specified, the button will insert to the last 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:
insertSwitchInlineQueryButton(text, switchInlineQueryopt, rowopt, columnopt)
Insert a SwitchInlineQuery button to inline keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text |
string | Text label for the button | ||
switchInlineQuery |
string |
<optional> |
"" | If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted |
row |
number |
<optional> |
0 | Row number to insert button (0-based). If not specified, the button will insert to the last 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:
insertSwitchInlineQueryCurrentChatButton(text, switchInlineQueryCurrentChatopt, rowopt, columnopt)
Insert a SwitchInlineQueryCurrentChat button to inline keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text |
string | Text label for the button | ||
switchInlineQueryCurrentChat |
string |
<optional> |
"" | If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted. This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options |
row |
number |
<optional> |
0 | Row number to insert button (0-based). If not specified, the button will insert to the last 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:
insertTextButton(text, callbackData, rowopt, columnopt)
Insert a text button to inline keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text |
string | Text label for the button | ||
callbackData |
string | Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes | ||
row |
number |
<optional> |
0 | Row number to insert button (0-based). If not specified, the button will insert to the last 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:
insertUrlButton(text, url, rowopt, columnopt)
Insert an url button to inline keyboard
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text |
string | Text label for the button | ||
url |
string | HTTP or tg:// url to be opened when the button is
pressed. Links tg://user?id= |
||
row |
number |
<optional> |
0 | Row number to insert button (0-based). If not specified, the button will insert to the last 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: