From 98cbd95421a9e1ea039d41b34cb8519d1ea099c7 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Mon, 16 Dec 2019 17:21:16 +0545 Subject: [PATCH] Added Passport support (#41036) --- types/node-telegram-bot-api/index.d.ts | 33 +++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/types/node-telegram-bot-api/index.d.ts b/types/node-telegram-bot-api/index.d.ts index 0dbf61144e..c30d2d4202 100644 --- a/types/node-telegram-bot-api/index.d.ts +++ b/types/node-telegram-bot-api/index.d.ts @@ -281,6 +281,36 @@ declare namespace TelegramBot { } /// TELEGRAM TYPES /// + interface PassportFile { + file_id: string; + file_size: number; + file_date: number; + } + + interface EncryptedPassportElement { + type: string; + data?: string; + phone_number?: string; + email?: string; + files?: PassportFile[]; + front_side?: PassportFile; + reverse_side?: PassportFile; + selfie?: PassportFile; + translation?: PassportFile[]; + hash: string; + } + + interface EncryptedCredentials { + data: string; + hash: string; + secret: string; + } + + interface PassportData { + data: EncryptedPassportElement[]; + credentials: EncryptedCredentials; + } + interface Update { update_id: number; message?: Message; @@ -379,6 +409,7 @@ declare namespace TelegramBot { invoice?: Invoice; successful_payment?: SuccessfulPayment; connected_website?: string; + passport_data?: PassportData; reply_markup?: InlineKeyboardMarkup; } @@ -1109,7 +1140,7 @@ declare class TelegramBot extends EventEmitter { deleteMessage(chatId: number | string, messageId: string, options?: any): Promise; sendInvoice(chatId: number | string, title: string, description: string, payload: string, providerToken: string, startParameter: string, currency: string, - prices: ReadonlyArray, options?: TelegramBot.SendInvoiceOptions): Promise; + prices: ReadonlyArray, options?: TelegramBot.SendInvoiceOptions): Promise; answerShippingQuery(shippingQueryId: string, ok: boolean, options?: TelegramBot.AnswerShippingQueryOptions): Promise;