diff --git a/data/web/blogfork.telegram.org/bots/webapps.html b/data/web/blogfork.telegram.org/bots/webapps.html
index 7610d9cabd..8ceb4c30bd 100644
--- a/data/web/blogfork.telegram.org/bots/webapps.html
+++ b/data/web/blogfork.telegram.org/bots/webapps.html
@@ -57,6 +57,12 @@
@@ -192,6 +198,11 @@
The version of the Bot API available in the user's Telegram app. |
+platform NEW |
+String |
+The name of the platform of the user's Telegram app. |
+
+
colorScheme |
String |
The color scheme currently used in the Telegram app. Either “light” or “dark”. Also available as the CSS variable var(--tg-color-scheme) . |
@@ -227,7 +238,7 @@
Current background color in the #RRGGBB format. |
-isClosingConfirmationEnabled NEW |
+isClosingConfirmationEnabled |
Boolean |
True, if the confirmation dialog is enabled while the user is trying to close the Web App. False, if the confirmation dialog is disabled. |
@@ -262,12 +273,12 @@
Bot API 6.1+ A method that sets the app background color in the #RRGGBB format or you can use keywords bg_color, secondary_bg_color instead. |
-enableClosingConfirmation() NEW |
+enableClosingConfirmation() |
Function |
Bot API 6.2+ A method that enables a confirmation dialog while the user is trying to close the Web App. |
-disableClosingConfirmation() NEW |
+disableClosingConfirmation() |
Function |
Bot API 6.2+ A method that disables the confirmation dialog while the user is trying to close the Web App. |
@@ -287,9 +298,9 @@
A method used to send data to the bot. When this method is called, a service message is sent to the bot containing the data data of the length up to 4096 bytes, and the Web App is closed. See the field web_app_data in the class Message.
This method is only available for Web Apps launched via a Keyboard button. |
-openLink(url) |
+openLink(url[, options]) |
Function |
-A method that opens a link in an external browser. The Web App will not be closed.
Note that this method can be called only in response to the user interaction with the Web App interface (e.g. click inside the Web App or on the main button) |
+A method that opens a link in an external browser. The Web App will not be closed. Bot API 6.4+ If the optional options parameter is passed with the field try_instant_view=true, the link will be opened in Instant View mode if possible.
Note that this method can be called only in response to user interaction with the Web App interface (e.g. a click inside the Web App or on the main button) |
openTelegramLink(url) |
@@ -302,21 +313,36 @@
Bot API 6.1+ A method that opens an invoice using the link url. The Web App will receive the event invoiceClosed when the invoice is closed. If an optional callback parameter was passed, the callback function will be called and the invoice status will be passed as the first argument. |
-showPopup(params[, callback]) NEW |
+showPopup(params[, callback]) |
Function |
Bot API 6.2+ A method that shows a native popup described by the params argument of the type PopupParams. The Web App will receive the event popupClosed when the popup is closed. If an optional callback parameter was passed, the callback function will be called and the field id of the pressed button will be passed as the first argument. |
-showAlert(message[, callback]) NEW |
+showAlert(message[, callback]) |
Function |
Bot API 6.2+ A method that shows message in a simple alert with a 'Close' button. If an optional callback parameter was passed, the callback function will be called when the popup is closed. |
-showConfirm(message[, callback]) NEW |
+showConfirm(message[, callback]) |
Function |
Bot API 6.2+ A method that shows message in a simple confirmation window with 'OK' and 'Cancel' buttons. If an optional callback parameter was passed, the callback function will be called when the popup is closed and the first argument will be a boolean indicating whether the user pressed the 'OK' button. |
+showScanQrPopup(params[, callback]) NEW |
+Function |
+Bot API 6.4+ A method that shows a native popup for scanning a QR code described by the params argument of the type ScanQrPopupParams. The Web App will receive the event qrTextReceived every time the scanner catches a code with text data. If an optional callback parameter was passed, the callback function will be called and the text from the QR code will be passed as the first argument. Returning true inside this callback function causes the popup to be closed. |
+
+
+closeScanQrPopup() NEW |
+Function |
+Bot API 6.4+ A method that closes the native popup for scanning a QR code opened with the showScanQrPopup method. Run it if you received valid data in the event qrTextReceived. |
+
+
+readTextFromClipboard([callback]) NEW |
+Function |
+Bot API 6.4+ A method that requests text from the clipboard. The Web App will receive the event clipboardTextReceived. If an optional callback parameter was passed, the callback function will be called and the text from the clipboard will be passed as the first argument.
Note: this method can be called only for Web Apps launched from the attachment menu and only in response to a user interaction with the Web App interface (e.g. a click inside the Web App or on the main button). |
+
+
ready() |
Function |
A method that informs the Telegram app that the Web App is ready to be displayed. It is recommended to call this method as early as possible, as soon as all essential interface elements are loaded. Once this method is called, the loading placeholder is hidden and the Web App is shown. If the method is not called, the placeholder will be hidden only when the page is fully loaded. |
@@ -386,7 +412,7 @@
PopupParams
-NEW This object describes the native popup.
+This object describes the native popup.
+ScanQrPopupParams
+NEW This object describes the native popup for scanning QR codes.
+
+
+
+Field |
+Type |
+Description |
+
+
+
+
+text |
+String |
+Optional. The text to be displayed under the 'Scan QR' heading, 0-64 characters. |
+
+
+
PopupButton
-NEW This object describes the native popup button.
+This object describes the native popup button.
@@ -698,7 +742,7 @@
Optional. IETF language tag of the user's language. Returns in user field only. |
-is_premium NEW |
+is_premium |
True |
Optional. True, if this user is a Telegram Premium user |
@@ -794,9 +838,17 @@ if (hex(HMAC_SHA256(data_check_string, secret_key)) == hash) {
Bot API 6.1+ Occurrs when the opened invoice is closed. eventHandler receives an object with the two fields: url – invoice link provided and status – one of the invoice statuses: - paid – invoice was paid successfully, - cancelled – user closed this invoice without paying, - failed – user tried to pay, but the payment was failed, - pending – the payment is still processing. The bot will receive a service message about a successful payment when the payment is successfully paid. |
-popupClosed NEW |
+popupClosed |
Bot API 6.2+ Occurrs when the opened popup is closed. eventHandler receives an object with the single field button_id – the value of the field id of the pressed button. If no buttons were pressed, the field button_id will be null. |
+
+qrTextReceived NEW |
+Bot API 6.4+ Occurs when the QR code scanner catches a code with text data. eventHandler receives an object with the single field data containing text data from the QR code. |
+
+
+clipboardTextReceived NEW |
+Bot API 6.4+ Occurrs when the readTextFromClipboard method is called. eventHandler receives an object with the single field data containing text data from the clipboard. If the clipboard contains non-text data, the field data will be an empty string. If the Web App has no access to the clipboard, the field data will be null. |
+
Adding Bots to the Attachment Menu
diff --git a/data/web/core.telegram.org/bots/webapps.html b/data/web/core.telegram.org/bots/webapps.html
index 3a57f7e718..3f50e6b623 100644
--- a/data/web/core.telegram.org/bots/webapps.html
+++ b/data/web/core.telegram.org/bots/webapps.html
@@ -57,6 +57,12 @@
Recent changes
+December 30, 2022
+Bot API 6.4
+
+- Added the field platform, the optional parameter options to the method openLink and the methods showScanQrPopup, closeScanQrPopup, readTextFromClipboard to the class WebApp.
+- Added the events qrTextReceived, clipboardTextReceived.
+
August 12, 2022
Bot API 6.2
+platform NEW |
+String |
+The name of the platform of the user's Telegram app. |
+
+
colorScheme |
String |
The color scheme currently used in the Telegram app. Either “light” or “dark”. Also available as the CSS variable var(--tg-color-scheme) . |
@@ -227,7 +238,7 @@
Current background color in the #RRGGBB format. |
-isClosingConfirmationEnabled NEW |
+isClosingConfirmationEnabled |
Boolean |
True, if the confirmation dialog is enabled while the user is trying to close the Web App. False, if the confirmation dialog is disabled. |
@@ -262,12 +273,12 @@
Bot API 6.1+ A method that sets the app background color in the #RRGGBB format or you can use keywords bg_color, secondary_bg_color instead. |
-enableClosingConfirmation() NEW |
+enableClosingConfirmation() |
Function |
Bot API 6.2+ A method that enables a confirmation dialog while the user is trying to close the Web App. |
-disableClosingConfirmation() NEW |
+disableClosingConfirmation() |
Function |
Bot API 6.2+ A method that disables the confirmation dialog while the user is trying to close the Web App. |
@@ -287,9 +298,9 @@
A method used to send data to the bot. When this method is called, a service message is sent to the bot containing the data data of the length up to 4096 bytes, and the Web App is closed. See the field web_app_data in the class Message.
This method is only available for Web Apps launched via a Keyboard button. |
-openLink(url) |
+openLink(url[, options]) |
Function |
-A method that opens a link in an external browser. The Web App will not be closed.
Note that this method can be called only in response to the user interaction with the Web App interface (e.g. click inside the Web App or on the main button) |
+A method that opens a link in an external browser. The Web App will not be closed. Bot API 6.4+ If the optional options parameter is passed with the field try_instant_view=true, the link will be opened in Instant View mode if possible.
Note that this method can be called only in response to user interaction with the Web App interface (e.g. a click inside the Web App or on the main button) |
openTelegramLink(url) |
@@ -302,21 +313,36 @@
Bot API 6.1+ A method that opens an invoice using the link url. The Web App will receive the event invoiceClosed when the invoice is closed. If an optional callback parameter was passed, the callback function will be called and the invoice status will be passed as the first argument. |
-showPopup(params[, callback]) NEW |
+showPopup(params[, callback]) |
Function |
Bot API 6.2+ A method that shows a native popup described by the params argument of the type PopupParams. The Web App will receive the event popupClosed when the popup is closed. If an optional callback parameter was passed, the callback function will be called and the field id of the pressed button will be passed as the first argument. |
-showAlert(message[, callback]) NEW |
+showAlert(message[, callback]) |
Function |
Bot API 6.2+ A method that shows message in a simple alert with a 'Close' button. If an optional callback parameter was passed, the callback function will be called when the popup is closed. |
-showConfirm(message[, callback]) NEW |
+showConfirm(message[, callback]) |
Function |
Bot API 6.2+ A method that shows message in a simple confirmation window with 'OK' and 'Cancel' buttons. If an optional callback parameter was passed, the callback function will be called when the popup is closed and the first argument will be a boolean indicating whether the user pressed the 'OK' button. |
+showScanQrPopup(params[, callback]) NEW |
+Function |
+Bot API 6.4+ A method that shows a native popup for scanning a QR code described by the params argument of the type ScanQrPopupParams. The Web App will receive the event qrTextReceived every time the scanner catches a code with text data. If an optional callback parameter was passed, the callback function will be called and the text from the QR code will be passed as the first argument. Returning true inside this callback function causes the popup to be closed. |
+
+
+closeScanQrPopup() NEW |
+Function |
+Bot API 6.4+ A method that closes the native popup for scanning a QR code opened with the showScanQrPopup method. Run it if you received valid data in the event qrTextReceived. |
+
+
+readTextFromClipboard([callback]) NEW |
+Function |
+Bot API 6.4+ A method that requests text from the clipboard. The Web App will receive the event clipboardTextReceived. If an optional callback parameter was passed, the callback function will be called and the text from the clipboard will be passed as the first argument.
Note: this method can be called only for Web Apps launched from the attachment menu and only in response to a user interaction with the Web App interface (e.g. a click inside the Web App or on the main button). |
+
+
ready() |
Function |
A method that informs the Telegram app that the Web App is ready to be displayed. It is recommended to call this method as early as possible, as soon as all essential interface elements are loaded. Once this method is called, the loading placeholder is hidden and the Web App is shown. If the method is not called, the placeholder will be hidden only when the page is fully loaded. |
@@ -386,7 +412,7 @@
PopupParams
-NEW This object describes the native popup.
+This object describes the native popup.
+ScanQrPopupParams
+NEW This object describes the native popup for scanning QR codes.
+
+
+
+Field |
+Type |
+Description |
+
+
+
+
+text |
+String |
+Optional. The text to be displayed under the 'Scan QR' heading, 0-64 characters. |
+
+
+
PopupButton
-NEW This object describes the native popup button.
+This object describes the native popup button.
@@ -698,7 +742,7 @@
Optional. IETF language tag of the user's language. Returns in user field only. |
-is_premium NEW |
+is_premium |
True |
Optional. True, if this user is a Telegram Premium user |
@@ -794,9 +838,17 @@ if (hex(HMAC_SHA256(data_check_string, secret_key)) == hash) {
Bot API 6.1+ Occurrs when the opened invoice is closed. eventHandler receives an object with the two fields: url – invoice link provided and status – one of the invoice statuses: - paid – invoice was paid successfully, - cancelled – user closed this invoice without paying, - failed – user tried to pay, but the payment was failed, - pending – the payment is still processing. The bot will receive a service message about a successful payment when the payment is successfully paid. |
-popupClosed NEW |
+popupClosed |
Bot API 6.2+ Occurrs when the opened popup is closed. eventHandler receives an object with the single field button_id – the value of the field id of the pressed button. If no buttons were pressed, the field button_id will be null. |
+
+qrTextReceived NEW |
+Bot API 6.4+ Occurs when the QR code scanner catches a code with text data. eventHandler receives an object with the single field data containing text data from the QR code. |
+
+
+clipboardTextReceived NEW |
+Bot API 6.4+ Occurrs when the readTextFromClipboard method is called. eventHandler receives an object with the single field data containing text data from the clipboard. If the clipboard contains non-text data, the field data will be an empty string. If the Web App has no access to the clipboard, the field data will be null. |
+
Adding Bots to the Attachment Menu
diff --git a/data/web/corefork.telegram.org/bots/webapps.html b/data/web/corefork.telegram.org/bots/webapps.html
index ed711b7e21..582fa41ee3 100644
--- a/data/web/corefork.telegram.org/bots/webapps.html
+++ b/data/web/corefork.telegram.org/bots/webapps.html
@@ -57,6 +57,12 @@
Recent changes
+December 30, 2022
+Bot API 6.4
+
+- Added the field platform, the optional parameter options to the method openLink and the methods showScanQrPopup, closeScanQrPopup, readTextFromClipboard to the class WebApp.
+- Added the events qrTextReceived, clipboardTextReceived.
+
August 12, 2022
Bot API 6.2
+platform NEW |
+String |
+The name of the platform of the user's Telegram app. |
+
+
colorScheme |
String |
The color scheme currently used in the Telegram app. Either “light” or “dark”. Also available as the CSS variable var(--tg-color-scheme) . |
@@ -227,7 +238,7 @@
Current background color in the #RRGGBB format. |
-isClosingConfirmationEnabled NEW |
+isClosingConfirmationEnabled |
Boolean |
True, if the confirmation dialog is enabled while the user is trying to close the Web App. False, if the confirmation dialog is disabled. |
@@ -262,12 +273,12 @@
Bot API 6.1+ A method that sets the app background color in the #RRGGBB format or you can use keywords bg_color, secondary_bg_color instead. |
-enableClosingConfirmation() NEW |
+enableClosingConfirmation() |
Function |
Bot API 6.2+ A method that enables a confirmation dialog while the user is trying to close the Web App. |
-disableClosingConfirmation() NEW |
+disableClosingConfirmation() |
Function |
Bot API 6.2+ A method that disables the confirmation dialog while the user is trying to close the Web App. |
@@ -287,9 +298,9 @@
A method used to send data to the bot. When this method is called, a service message is sent to the bot containing the data data of the length up to 4096 bytes, and the Web App is closed. See the field web_app_data in the class Message.
This method is only available for Web Apps launched via a Keyboard button. |
-openLink(url) |
+openLink(url[, options]) |
Function |
-A method that opens a link in an external browser. The Web App will not be closed.
Note that this method can be called only in response to the user interaction with the Web App interface (e.g. click inside the Web App or on the main button) |
+A method that opens a link in an external browser. The Web App will not be closed. Bot API 6.4+ If the optional options parameter is passed with the field try_instant_view=true, the link will be opened in Instant View mode if possible.
Note that this method can be called only in response to user interaction with the Web App interface (e.g. a click inside the Web App or on the main button) |
openTelegramLink(url) |
@@ -302,21 +313,36 @@
Bot API 6.1+ A method that opens an invoice using the link url. The Web App will receive the event invoiceClosed when the invoice is closed. If an optional callback parameter was passed, the callback function will be called and the invoice status will be passed as the first argument. |
-showPopup(params[, callback]) NEW |
+showPopup(params[, callback]) |
Function |
Bot API 6.2+ A method that shows a native popup described by the params argument of the type PopupParams. The Web App will receive the event popupClosed when the popup is closed. If an optional callback parameter was passed, the callback function will be called and the field id of the pressed button will be passed as the first argument. |
-showAlert(message[, callback]) NEW |
+showAlert(message[, callback]) |
Function |
Bot API 6.2+ A method that shows message in a simple alert with a 'Close' button. If an optional callback parameter was passed, the callback function will be called when the popup is closed. |
-showConfirm(message[, callback]) NEW |
+showConfirm(message[, callback]) |
Function |
Bot API 6.2+ A method that shows message in a simple confirmation window with 'OK' and 'Cancel' buttons. If an optional callback parameter was passed, the callback function will be called when the popup is closed and the first argument will be a boolean indicating whether the user pressed the 'OK' button. |
+showScanQrPopup(params[, callback]) NEW |
+Function |
+Bot API 6.4+ A method that shows a native popup for scanning a QR code described by the params argument of the type ScanQrPopupParams. The Web App will receive the event qrTextReceived every time the scanner catches a code with text data. If an optional callback parameter was passed, the callback function will be called and the text from the QR code will be passed as the first argument. Returning true inside this callback function causes the popup to be closed. |
+
+
+closeScanQrPopup() NEW |
+Function |
+Bot API 6.4+ A method that closes the native popup for scanning a QR code opened with the showScanQrPopup method. Run it if you received valid data in the event qrTextReceived. |
+
+
+readTextFromClipboard([callback]) NEW |
+Function |
+Bot API 6.4+ A method that requests text from the clipboard. The Web App will receive the event clipboardTextReceived. If an optional callback parameter was passed, the callback function will be called and the text from the clipboard will be passed as the first argument.
Note: this method can be called only for Web Apps launched from the attachment menu and only in response to a user interaction with the Web App interface (e.g. a click inside the Web App or on the main button). |
+
+
ready() |
Function |
A method that informs the Telegram app that the Web App is ready to be displayed. It is recommended to call this method as early as possible, as soon as all essential interface elements are loaded. Once this method is called, the loading placeholder is hidden and the Web App is shown. If the method is not called, the placeholder will be hidden only when the page is fully loaded. |
@@ -386,7 +412,7 @@
PopupParams
-NEW This object describes the native popup.
+This object describes the native popup.
+ScanQrPopupParams
+NEW This object describes the native popup for scanning QR codes.
+
+
+
+Field |
+Type |
+Description |
+
+
+
+
+text |
+String |
+Optional. The text to be displayed under the 'Scan QR' heading, 0-64 characters. |
+
+
+
PopupButton
-NEW This object describes the native popup button.
+This object describes the native popup button.
@@ -698,7 +742,7 @@
Optional. IETF language tag of the user's language. Returns in user field only. |
-is_premium NEW |
+is_premium |
True |
Optional. True, if this user is a Telegram Premium user |
@@ -794,9 +838,17 @@ if (hex(HMAC_SHA256(data_check_string, secret_key)) == hash) {
Bot API 6.1+ Occurrs when the opened invoice is closed. eventHandler receives an object with the two fields: url – invoice link provided and status – one of the invoice statuses: - paid – invoice was paid successfully, - cancelled – user closed this invoice without paying, - failed – user tried to pay, but the payment was failed, - pending – the payment is still processing. The bot will receive a service message about a successful payment when the payment is successfully paid. |
-popupClosed NEW |
+popupClosed |
Bot API 6.2+ Occurrs when the opened popup is closed. eventHandler receives an object with the single field button_id – the value of the field id of the pressed button. If no buttons were pressed, the field button_id will be null. |
+
+qrTextReceived NEW |
+Bot API 6.4+ Occurs when the QR code scanner catches a code with text data. eventHandler receives an object with the single field data containing text data from the QR code. |
+
+
+clipboardTextReceived NEW |
+Bot API 6.4+ Occurrs when the readTextFromClipboard method is called. eventHandler receives an object with the single field data containing text data from the clipboard. If the clipboard contains non-text data, the field data will be an empty string. If the Web App has no access to the clipboard, the field data will be null. |
+
Adding Bots to the Attachment Menu