Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions types/telegram-web-app/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion types/telegram-web-app/package.json
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down
4 changes: 4 additions & 0 deletions types/telegram-web-app/telegram-web-app-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});