Bot or inline keyboard buttons
اسکیمای روش از لایه 224 در دسترس است. تغییر »
| Constructor | Description |
|---|---|
| keyboardButton | Bot keyboard button Available only in reply keyboards. When pressed, clients must send text as a message to the current chat, replying to the message that attached the replyKeyboardMarkup. |
| keyboardButtonUrl | URL button Available only in inline keyboards. When pressed, clients open url, showing a confirmation prompt unless the URL is one of the internal URIs. |
| keyboardButtonCallback | Callback button Available only in inline keyboards. When pressed, clients send data to the bot, optionally providing the user's 2FA SRP parameters for identity verification, as described in callback queries. |
| keyboardButtonRequestPhone | Button to request a user's phone number Available only in private chats, in reply keyboards. When pressed, clients must request permission from the user to send the current user's contact to the chat, replying to the message that attached the replyKeyboardMarkup. |
| keyboardButtonRequestGeoLocation | Button to request a user's geolocation Available only in private chats, in reply keyboards. When pressed, clients must request permission from the user to send the current user's geolocation to the chat, replying to the message that attached the replyKeyboardMarkup. |
| keyboardButtonSwitchInline | Button to switch the user to inline mode Available only in inline keyboards. When pressed, clients must insert the bot's username and query into the chat input field, triggering an inline query.If same_peer is set, clients use the current chat. Otherwise, clients prompt the user to select a chat, filtered by peer_types if specified. |
| keyboardButtonGame | Button to start a game Available only in inline keyboards. When pressed, clients must open the game from the attached messageMediaGame constructor by invoking messages.getBotCallbackAnswer with the game flag set, as described in Starting a game. |
| keyboardButtonBuy | Button to buy a product Available only in inline keyboards. When pressed, clients must start the payment flow for the attached invoice. |
| keyboardButtonUrlAuth | Button to request a user to authorize via URL using Seamless Telegram Login. When the user clicks on such a button, messages.requestUrlAuth should be called, providing the button_id and the ID of the container message. The returned urlAuthResultRequest object will contain more details about the authorization request (request_write_access if the bot would like to send messages to the user along with the username of the bot which will be used for user authorization). Finally, the user can choose to call messages.acceptUrlAuth to get a urlAuthResultAccepted with the URL to open instead of the url of this constructor, or a urlAuthResultDefault, in which case the url of this constructor must be opened, instead. If the user refuses the authorization request but still wants to open the link, the url of this constructor must be used.Available only in inline keyboards. |
| inputKeyboardButtonUrlAuth | Button to request a user to authorize via URL using Seamless Telegram Login. Use this constructor to send a keyboardButtonUrlAuth button in an inline keyboard. |
| keyboardButtonRequestPoll | Button to request a poll from the user Available only in private chats, in reply keyboards. When pressed, clients prompt the user to create and send a poll, replying to the message that attached the replyKeyboardMarkup. If quiz is set, the prompt must create a quiz poll. |
| inputKeyboardButtonUserProfile | Button that links directly to a user profile Use this constructor to send a keyboardButtonUserProfile button in an inline keyboard. |
| keyboardButtonUserProfile | Button that links directly to a user profile Available only in inline keyboards. When pressed, clients must open the profile of the user identified by user_id. |
| keyboardButtonWebView | Button to open a bot mini app using messages.requestWebView, sending over user information after user confirmation. Can only be sent or received as part of an inline keyboard, use keyboardButtonSimpleWebView for reply keyboards. When pressed, clients must open an Inline Button Mini App using messages.requestWebView, passing url to messages.requestWebView.url. |
| keyboardButtonSimpleWebView | Button to open a bot mini app using messages.requestSimpleWebView, without sending user information to the web app. Can only be sent or received as part of a reply keyboard, use keyboardButtonWebView for inline keyboards. When pressed, clients must open a Keyboard Button Mini App using messages.requestSimpleWebView, passing url to messages.requestSimpleWebView.url. |
| keyboardButtonRequestPeer | Prompts the user to select and share one or more peers with the bot using messages.sendBotRequestedPeer Available only in private chats, in reply keyboards. See peer requests for the full flow. |
| inputKeyboardButtonRequestPeer | Prompts the user to select and share one or more peers with the bot using messages.sendBotRequestedPeer. Use this constructor to send a keyboardButtonRequestPeer button in a reply keyboard in a private chat. See peer requests for the full flow. |
| keyboardButtonCopy | Clipboard button Available only in inline keyboards. When pressed, clients must copy copy_text to the clipboard. |
| Method | Description |
|---|---|
| bots.getRequestedWebViewButton | Fetch the peer request button a bot prepared for a Mini App with bots.requestWebViewButton, invoked when the Mini App emits a web_app_request_chat event, see here » for more info. |