From 6f2271480fdae8236fb7a48b9fa519b9e19a411a Mon Sep 17 00:00:00 2001 From: Uladzislau Hramyka Date: Sun, 19 Apr 2026 17:14:59 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74896=20[telegram-?= =?UTF-8?q?web-app]=20add=20support=20for=20Bot=20API=209.6=20by=20@Second?= =?UTF-8?q?ThundeR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/telegram-web-app/index.d.ts | 12 ++++++++++++ types/telegram-web-app/package.json | 2 +- types/telegram-web-app/telegram-web-app-tests.ts | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/types/telegram-web-app/index.d.ts b/types/telegram-web-app/index.d.ts index 1b142fb36cbf63..1905ee2f0e67b6 100644 --- a/types/telegram-web-app/index.d.ts +++ b/types/telegram-web-app/index.d.ts @@ -616,6 +616,18 @@ export interface WebApp { */ requestContact(callback?: (success: boolean, response: RequestContactResponse) => void): void; + /** + * A method that opens a dialog allowing the user to select an existing chat + * or create a new one. If an optional _callback_ parameter is provided, + * the _callback_ function will be called with a boolean as the first argument, + * indicating whether the message was successfully sent. + * The request id passed to this method must belong to a {@link https://core.telegram.org/bots/api#preparedkeyboardbutton | PreparedKeyboardButton} + * previously obtained via the Bot API method {@link https://core.telegram.org/bots/api#savepreparedkeyboardbutton | savePreparedKeyboardButton}. + * + * @since Bot API 9.6+ + */ + requestChat(req_id: string, callback?: (success: boolean) => void): void; + /** * A method that informs the Telegram app that the Mini 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. diff --git a/types/telegram-web-app/package.json b/types/telegram-web-app/package.json index ec080c1d7488e8..1f7c5245d3ab4d 100644 --- a/types/telegram-web-app/package.json +++ b/types/telegram-web-app/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/telegram-web-app", - "version": "9.5.9999", + "version": "9.6.9999", "nonNpm": "conflict", "nonNpmDescription": "telegram-web-app", "projects": ["https://telegram.org/js/telegram-web-app.js"], diff --git a/types/telegram-web-app/telegram-web-app-tests.ts b/types/telegram-web-app/telegram-web-app-tests.ts index 529ad9326a227f..1c4342f598d454 100644 --- a/types/telegram-web-app/telegram-web-app-tests.ts +++ b/types/telegram-web-app/telegram-web-app-tests.ts @@ -138,3 +138,7 @@ app.SecondaryButton.iconCustomEmojiId; // $ExpectType string app.SecondaryButton.setParams({ icon_custom_emoji_id: "", // $ExpectType string }); + +app.requestChat("req_id", (success) => { + success; // $ExpectType boolean +});