Methods
botRequest(text, requestId, hideopt) → {BotRequestButton}
Button will open a list of suitable bots. Tapping on any bot will send their identifier to the your bot in a user_shared
service message. Available in private chats only & non-inline keyboards
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | Text of the button. | ||
requestId | number | Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message | ||
hide | boolean | <optional> | false | Used by |
- Type:
- BotRequestButton
button(text, hideopt) → {Object}
Adds a new text button. This button will simply send the given text as a text message back to your bot if a user clicks on it. Available for non-inline keyboard only.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display and send | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
callbackButton(text, data, hideopt) → {Object}
Adds a new callback query button. The button contains a text and a custom payload. This payload will be sent back to your bot when the button is pressed. If you omit the payload, the display text will be sent back to your bot.
Your bot will receive an update every time a user presses any of the text buttons. You can listen to these updates like this:
// Specific buttons:
bot.action('some-payload', ctx => { ... })
// Any button of any inline keyboard:
bot.on('callback_query', ctx => { ... })
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
data | string | Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
channelRequest(text, requestId, extra, hideopt) → {ChannelRequestButton}
Button will open a list of suitable channels. Tapping on any group will send their identifier to the your bot in a chat_shared
service message. Available in private chats only & non-inline keyboards
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | Text of the button. | ||
requestId | number | Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message | ||
extra | ChannelRequestButtonExtra | Extra parameters | ||
hide | boolean | <optional> | false | Used by |
- Type:
- ChannelRequestButton
contactRequestButton(text, hideopt) → {Object}
Adds a new contact request button. The user's phone number will be sent as a contact when the button is pressed. Available in private chats only.
Your bot will in turn receive location updates. You can listen to contact updates like this:
bot.on('contact', ctx => { ... })
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
extra(optionsopt) → {object}
Returns a ready object for extra parameters with given additional options, equals result to Extra.markup(markupObj)
ctx.reply('<i>Banana</i>', Markup.inlineKeyboard([
Markup.callbackButton('Yes', 'yes'),
Markup.callbackButton('No', 'no')
]).extra({ parse_mode: 'HTML' }))
Name | Type | Attributes | Description |
---|---|---|---|
options | object | <optional> | Additional options which should be passed into extra |
- Type:
- object
forceReply(valueopt) → {Markup}
Adding force reply option to markup
Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value | boolean | <optional> | true | Value |
- Type:
- Markup
gameButton(text, hideopt) → {Object}
Adds a new game query button
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
groupRequest(text, requestId, extraopt, hideopt) → {GroupRequestButton}
Button will open a list of suitable groups. Tapping on any group will send their identifier to the your bot in a chat_shared
service message. Available in private chats only & non-inline keyboards
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | Text of the button. | ||
requestId | number | Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message | ||
extra | GroupRequestButtonExtra | <optional> | Extra parameters | |
hide | boolean | <optional> | false | Used by |
- Type:
- GroupRequestButton
inlineKeyboard(buttons, options) → {Markup}
Build inline keyboard with given buttons
// Make one-line inline keyboard
Markup.inlineKeyboard([
Markup.urlButton('one', 'https://example.com'),
Markup.urlButton('two', 'https://example.com'),
Markup.urlButton('three', 'https://example.com'),
Markup.urlButton('four', 'https://example.com')
])
// Make two columns inline keyboard with custom function
Markup.inlineKeyboard([
Markup.urlButton('one', 'https://example.com'),
Markup.urlButton('two', 'https://example.com'),
Markup.urlButton('three', 'https://example.com'),
Markup.urlButton('four', 'https://example.com')
], {
wrap: (btn, index, currentRow) => index % 2 !== 0
}
)
// Make fixed two columns inline keyboard with columns option
Markup.inlineKeyboard([
Markup.urlButton('one', 'https://example.com'),
Markup.urlButton('two', 'https://example.com'),
Markup.urlButton('three', 'https://example.com'),
Markup.urlButton('four', 'https://example.com')
], { columns: 2 })
Name | Type | Description |
---|---|---|
buttons | Array.<InlineKeyboardButton> | | Array of buttons |
options | InlineKeyboardOptions | You can pass here columns count or wrap function for slice buttons to columns |
- Type:
- Markup
inputFieldPlaceholder(placeholder) → {Markup}
The placeholder to be shown in the input field when the reply is active; 1-64 characters
Name | Type | Description |
---|---|---|
placeholder | string | Placeholder text |
- Type:
- Markup
keyboard(buttons, optionsopt) → {Markup}
Build keyboard with given buttons
// Make one-line keyboard with resize
Markup.keyboard(['one', 'two', 'three', 'four']).resize()
// Make two columns keyboard with custom function
Markup.keyboard(['one', 'two', 'three', 'four'], {
wrap: (btn, index, currentRow) => index % 2 !== 0
}).resize()
// Make fixed two columns keyboard with columns option
Markup.keyboard(['one', 'two', 'three', 'four'], { columns: 2 }).resize()
Name | Type | Attributes | Description |
---|---|---|---|
buttons | Array.<KeyboardButton> | | Array of buttons | |
options | KeyboardOptions | <optional> | You can pass here columns count or wrap function for slice buttons to columns |
- Type:
- Markup
locationRequestButton(text, hideopt) → {Object}
Adds a new location request button. The user's current location will be sent when the button is pressed. Available in private chats only.
Your bot will in turn receive location updates. You can listen to inline query updates like this:
bot.on('location', ctx => { ... })
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
loginButton(text, url, optsopt, hideopt) → {Object}
Adds a new login button. This can be used as a replacement for the Telegram Login Widget. You must specify an HTTPS URL used to automatically authorize the user.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | Message text | ||
url | string | An HTTPS 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. | ||
opts | LoginButtonOptions | <optional> | Login options | |
hide | boolean | <optional> | false | Used by |
- Type:
- Object
oneTime(valueopt) → {Markup}
Enable / Disable hiding keyboard after click
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.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value | boolean | <optional> | true | Value |
- Type:
- Markup
payButton(text, hideopt) → {Object}
Adds a new payment button
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
persistent(valueopt) → {Markup}
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.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value | boolean | <optional> | true | Value |
- Type:
- Markup
pollRequestButton(text, typeopt, hideopt) → {Object}
Adds a new poll request button. 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.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
type | 'quiz' | | <optional> | The type of permitted polls to create, omit if the user may send a poll of any type | |
hide | boolean | <optional> | false | Used by |
- Type:
- Object
removeKeyboard(valueopt) → {Markup}
Enable / Disable keyboard removing
Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value | boolean | <optional> | true | Value |
- Type:
- Markup
resize(valueopt) → {Markup}
Enable / Disable resize for keyboard.
Keyboards are non-resized by default, use this function to enable it (without any parameters or pass true
). Pass false
to force the keyboard to be non-resized.
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.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value | boolean | <optional> | true | Value |
- Type:
- Markup
selective(valueopt) → {Markup}
Enable / Disable selective for force reply / remove keyboard
Use this parameter if you want to force reply from specific users only. Targets:
- users that are
@mentioned
in the text of the Message object; - if the bot's message is a reply (has
reply_to_message_id
), sender of the original message.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value | boolean | <optional> | true | Value |
- Type:
- Markup
switchToChatButton(text, value, hideopt) → {Object}
Adds a new inline query button. Telegram clients will let the user pick a chat when this button is pressed. This will start an inline query. The selected chat will be prefilled with the name of your bot. You may provide a text that is specified along with it.
Your bot will in turn receive updates for inline queries. You can listen to inline query updates like this:
bot.on('inline_query', ctx => { ... })
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
value | string | Value | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
switchToChosenChatButton(text, value, allowList, hideopt) → {Object}
Returns inline button that switches the current user to inline mode in a chosen chat with an optional default inline query.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
value | string | Query value | ||
allowList | SwitchInlineQueryChosenChatAllowList | Object contains the list of allowed chat types to choose | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
switchToCurrentChatButton(text, value, hideopt) → {Object}
Adds a new inline query button that act on the current chat. The selected chat will be prefilled with the name of your bot. You may provide a text that is specified along with it. This will start an inline query.
Your bot will in turn receive updates for inline queries. You can listen to inline query updates like this:
bot.on('inline_query', ctx => { ... })
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
value | string | Value | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
urlButton(text, url, hideopt) → {Object}
Adds a new URL button. Telegram clients will open the provided URL when the button is pressed.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
url | string | HTTP or | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
userRequest(text, requestId, userIsPremiumopt, hideopt) → {UserRequestButton}
Button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a user_shared
service message. Available in private chats only & non-inline keyboards
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | Text of the button. | ||
requestId | number | Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message | ||
userIsPremium | boolean | <optional> | Optional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied. | |
hide | boolean | <optional> | false | Used by |
- Type:
- UserRequestButton
webApp(text, url, hideopt) → {Object}
Adds a new web app button. The Web App that will be launched when the user presses the button. The Web App will be able to send a web_app_data
service message. Available in private chats only.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | text to display | ||
url | string | An HTTPS URL of a Web App to be opened with additional data | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
(static) botRequest(text, requestId, hideopt) → {BotRequestButton}
Button will open a list of suitable bots. Tapping on any bot will send their identifier to the your bot in a user_shared
service message. Available in private chats only & non-inline keyboards
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | Text of the button. | ||
requestId | number | Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message | ||
hide | boolean | <optional> | false | Used by |
- Type:
- BotRequestButton
(static) button(text, hideopt) → {Object}
Adds a new text button. This button will simply send the given text as a text message back to your bot if a user clicks on it. Available for non-inline keyboard only.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display and send | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
(static) callbackButton(text, data, hideopt) → {Object}
Adds a new callback query button. The button contains a text and a custom payload. This payload will be sent back to your bot when the button is pressed. If you omit the payload, the display text will be sent back to your bot.
Your bot will receive an update every time a user presses any of the text buttons. You can listen to these updates like this:
// Specific buttons:
bot.action('some-payload', ctx => { ... })
// Any button of any inline keyboard:
bot.on('callback_query', ctx => { ... })
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
data | string | Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
(static) channelRequest(text, requestId, extra, hideopt) → {ChannelRequestButton}
Button will open a list of suitable channels. Tapping on any group will send their identifier to the your bot in a chat_shared
service message. Available in private chats only & non-inline keyboards
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | Text of the button. | ||
requestId | number | Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message | ||
extra | ChannelRequestButtonExtra | Extra parameters | ||
hide | boolean | <optional> | false | Used by |
- Type:
- ChannelRequestButton
(static) contactRequestButton(text, hideopt) → {Object}
Adds a new contact request button. The user's phone number will be sent as a contact when the button is pressed. Available in private chats only.
Your bot will in turn receive location updates. You can listen to contact updates like this:
bot.on('contact', ctx => { ... })
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
(static) escapeHTML(text) → {string}
Escape string for HTML
Name | Type | Description |
---|---|---|
text | string | String to escape |
- Type:
- string
(static) escapeMarkdown(text) → {string}
Escape string for Markdown
Name | Type | Description |
---|---|---|
text | string | String to escape |
- Type:
- string
(static) escapeMarkdownV2(text) → {string}
Escape string for Markdown V2
Name | Type | Description |
---|---|---|
text | string | String to escape |
- Type:
- string
(static) forceReply(valueopt) → {Markup}
Adding force reply option to markup
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value | boolean | <optional> | true | Value |
- Type:
- Markup
(static) formatHTML(text, entities) → {string}
Returns build HTML given text and entities object
Name | Type | Description |
---|---|---|
text | string | Message text |
entities | Array.<MessageEntity> | Array of message entities |
- Type:
- string
(static) gameButton(text, hideopt) → {Object}
Adds a new game query button
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
(static) groupRequest(text, requestId, extraopt, hideopt) → {GroupRequestButton}
Button will open a list of suitable groups. Tapping on any group will send their identifier to the your bot in a chat_shared
service message. Available in private chats only & non-inline keyboards
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | Text of the button. | ||
requestId | number | Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message | ||
extra | GroupRequestButtonExtra | <optional> | Extra parameters | |
hide | boolean | <optional> | false | Used by |
- Type:
- GroupRequestButton
(static) inlineKeyboard(buttons, optionsopt) → {Markup}
Build inline keyboard with given buttons
// Make one-line inline keyboard
Markup.inlineKeyboard([
Markup.urlButton('one', 'https://example.com'),
Markup.urlButton('two', 'https://example.com'),
Markup.urlButton('three', 'https://example.com'),
Markup.urlButton('four', 'https://example.com')
])
// Make two columns inline keyboard with custom function
Markup.inlineKeyboard([
Markup.urlButton('one', 'https://example.com'),
Markup.urlButton('two', 'https://example.com'),
Markup.urlButton('three', 'https://example.com'),
Markup.urlButton('four', 'https://example.com')
], {
wrap: (btn, index, currentRow) => index % 2 !== 0
}
)
// Make fixed two columns inline keyboard with columns option
Markup.inlineKeyboard([
Markup.urlButton('one', 'https://example.com'),
Markup.urlButton('two', 'https://example.com'),
Markup.urlButton('three', 'https://example.com'),
Markup.urlButton('four', 'https://example.com')
], { columns: 2 })
Name | Type | Attributes | Description |
---|---|---|---|
buttons | Array.<InlineKeyboardButton> | | Array of buttons | |
options | InlineKeyboardOptions | <optional> | You can pass here columns count or wrap function for slice buttons to columns |
- Type:
- Markup
(static) inputFieldPlaceholder(placeholder) → {Markup}
Changing input field placeholder when reply is active, used with forceReply
Name | Type | Description |
---|---|---|
placeholder | string | Placeholder text |
- Type:
- Markup
(static) keyboard(buttons, optionsopt) → {Markup}
Build keyboard with given buttons
// Make one-line keyboard with resize
Markup.keyboard(['one', 'two', 'three', 'four']).resize()
// Make two columns keyboard with custom function
Markup.keyboard(['one', 'two', 'three', 'four'], {
wrap: (btn, index, currentRow) => index % 2 !== 0
}).resize()
// Make fixed two columns keyboard with columns option
Markup.keyboard(['one', 'two', 'three', 'four'], { columns: 2 }).resize()
Name | Type | Attributes | Description |
---|---|---|---|
buttons | Array.<KeyboardButton> | | Array of buttons | |
options | KeyboardOptions | <optional> | You can pass here columns count or wrap function for slice buttons to columns |
- Type:
- Markup
(static) locationRequestButton(text, hideopt) → {Object}
Adds a new location request button. The user's current location will be sent when the button is pressed. Available in private chats only.
Your bot will in turn receive location updates. You can listen to inline query updates like this:
bot.on('location', ctx => { ... })
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
(static) loginButton(text, url, optsopt, hideopt) → {Object}
Adds a new login button. This can be used as a replacement for the Telegram Login Widget. You must specify an HTTPS URL used to automatically authorize the user.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | Button text | ||
url | string | An HTTPS 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. | ||
opts | LoginButtonOptions | <optional> | Options | |
hide | boolean | <optional> | false | Used by |
- Type:
- Object
(static) oneTime(valueopt) → {Markup}
Enable / Disable hiding keyboard after click
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value | boolean | <optional> | true | Value |
- Type:
- Markup
(static) payButton(text, hideopt) → {Object}
Adds a new payment button
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
(static) pollRequestButton(text, typeopt, hideopt) → {Object}
Adds a new poll request button. 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.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
type | 'quiz' | | <optional> | The type of permitted polls to create, omit if the user may send a poll of any type | |
hide | boolean | <optional> | false | Used by |
- Type:
- Object
(static) removeKeyboard(valueopt) → {Markup}
Enable / Disable keyboard removing
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value | boolean | <optional> | true | Value |
- Type:
- Markup
(static) resize(valueopt) → {Markup}
Enable / Disable resize for keyboard.
Keyboards are non-resized by default, use this function to enable it (without any parameters or pass true
). Pass false
to force the keyboard to be non-resized.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value | boolean | <optional> | true | Value |
- Type:
- Markup
(static) selective(valueopt) → {Markup}
Enable / Disable selective for force reply / remove keyboard
Keyboards are non-selective by default, use this function to enable it (without any parameters or pass true
). Pass false
to force the keyboard to be non-selective.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value | boolean | <optional> | true | Value |
- Type:
- Markup
(static) switchToChatButton(text, value, hideopt) → {Object}
Adds a new inline query button. Telegram clients will let the user pick a chat when this button is pressed. This will start an inline query. The selected chat will be prefilled with the name of your bot. You may provide a text that is specified along with it.
Your bot will in turn receive updates for inline queries. You can listen to inline query updates like this:
bot.on('inline_query', ctx => { ... })
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
value | string | Value | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
(static) switchToChosenChatButton(text, value, allowList, hideopt) → {Object}
Returns inline button that switches the current user to inline mode in a chosen chat with an optional default inline query.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
value | string | Query value | ||
allowList | SwitchInlineQueryChosenChatAllowList | Object contains the list of allowed chat types to choose | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
(static) switchToCurrentChatButton(text, value, hideopt) → {Object}
Adds a new inline query button that act on the current chat. The selected chat will be prefilled with the name of your bot. You may provide a text that is specified along with it. This will start an inline query.
Your bot will in turn receive updates for inline queries. You can listen to inline query updates like this:
bot.on('inline_query', ctx => { ... })
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
value | string | Value | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
(static) urlButton(text, url, hideopt) → {Object}
Adds a new URL button. Telegram clients will open the provided URL when the button is pressed.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | The text to display | ||
url | string | HTTP or | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object
(static) userRequest(text, requestId, userIsPremiumopt, hideopt) → {UserRequestButton}
Button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a user_shared
service message. Available in private chats only & non-inline keyboards
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | Text of the button. | ||
requestId | number | Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message | ||
userIsPremium | boolean | <optional> | Optional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied. | |
hide | boolean | <optional> | false | Used by |
- Type:
- UserRequestButton
(static) webApp(text, url, hideopt) → {Object}
Adds a new web app button. The Web App that will be launched when the user presses the button. The Web App will be able to send a web_app_data
service message. Available in private chats only.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text | string | Text to display | ||
url | string | An HTTPS URL of a Web App to be opened with additional data | ||
hide | boolean | <optional> | false | Used by |
- Type:
- Object