@telegram.ts/types 1.0.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,184 @@
1
+ import type {
2
+ WebAppInfo
3
+ } from "./markupTypes.js";
4
+
5
+ /**
6
+ * This interface represents the name of the bot.
7
+ */
8
+ export interface BotName {
9
+ /** The bot's name. */
10
+ name: string;
11
+ }
12
+
13
+ /**
14
+ * This interface represents the description of the bot.
15
+ */
16
+ export interface BotDescription {
17
+ /** The bot's description. */
18
+ description: string;
19
+ }
20
+
21
+ /**
22
+ * This interface represents the short description of the bot.
23
+ */
24
+ export interface BotShortDescription {
25
+ /** The bot's short description. */
26
+ short_description: string;
27
+ }
28
+
29
+ /**
30
+ * This interface describes the bot's menu button in a private chat.
31
+ * It can be one of the following:
32
+ * - MenuButtonCommands
33
+ * - MenuButtonWebApp
34
+ * - MenuButtonDefault
35
+ *
36
+ * If a menu button other than MenuButtonDefault is set for a private chat,
37
+ * then it is applied in the chat. Otherwise, the default menu button is applied.
38
+ * By default, the menu button opens the list of bot commands.
39
+ */
40
+ export type MenuButton = MenuButtonCommands | MenuButtonWebApp | MenuButtonDefault;
41
+
42
+ /**
43
+ * Represents a menu button that opens the bot's list of commands.
44
+ */
45
+ export interface MenuButtonCommands {
46
+ /** The type of the button, must be "commands". */
47
+ type: "commands";
48
+ }
49
+
50
+ /**
51
+ * Represents a menu button that launches a Web App.
52
+ */
53
+ export interface MenuButtonWebApp {
54
+ /** The button type, must be "web_app". */
55
+ type: "web_app";
56
+ /** The text on the button. */
57
+ text: string;
58
+ /**
59
+ * The description of the Web App that will be launched when the user presses the button.
60
+ * The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery.
61
+ */
62
+ web_app: WebAppInfo;
63
+ }
64
+
65
+ /**
66
+ * Describes that no specific value for the menu button was set.
67
+ */
68
+ export interface MenuButtonDefault {
69
+ /** The type of the button, must be "default". */
70
+ type: "default";
71
+ }
72
+
73
+ /**
74
+ * This interface represents the scope to which bot commands are applied.
75
+ * Currently, the following 7 scopes are supported:
76
+ * - BotCommandScopeDefault
77
+ * - BotCommandScopeAllPrivateChats
78
+ * - BotCommandScopeAllGroupChats
79
+ * - BotCommandScopeAllChatAdministrators
80
+ * - BotCommandScopeChat
81
+ * - BotCommandScopeChatAdministrators
82
+ * - BotCommandScopeChatMember
83
+ *
84
+ * Determining list of commands:
85
+ * The following algorithm is used to determine the list of commands for a particular user viewing the bot menu.
86
+ * The first list of commands that is set is returned.
87
+ *
88
+ * Commands in the chat with the bot:
89
+ * - botCommandScopeChat + language_code
90
+ * - botCommandScopeChat
91
+ * - botCommandScopeAllPrivateChats + language_code
92
+ * - botCommandScopeAllPrivateChats
93
+ * - botCommandScopeDefault + language_code
94
+ * - botCommandScopeDefault
95
+ *
96
+ * Commands in group and supergroup chats:
97
+ * - botCommandScopeChatMember + language_code
98
+ * - botCommandScopeChatMember
99
+ * - botCommandScopeChatAdministrators + language_code (administrators only)
100
+ * - botCommandScopeChatAdministrators (administrators only)
101
+ * - botCommandScopeChat + language_code
102
+ * - botCommandScopeChat
103
+ * - botCommandScopeAllChatAdministrators + language_code (administrators only)
104
+ * - botCommandScopeAllChatAdministrators (administrators only)
105
+ * - botCommandScopeAllGroupChats + language_code
106
+ * - botCommandScopeAllGroupChats
107
+ * - botCommandScopeDefault + language_code
108
+ * - botCommandScopeDefault
109
+ */
110
+ export type BotCommandScope =
111
+
112
+
113
+ | BotCommandScopeDefault
114
+ | BotCommandScopeAllPrivateChats
115
+ | BotCommandScopeAllGroupChats
116
+ | BotCommandScopeAllChatAdministrators
117
+ | BotCommandScopeChat
118
+ | BotCommandScopeChatAdministrators
119
+ | BotCommandScopeChatMember;
120
+
121
+ /**
122
+ * Represents the default scope of bot commands.
123
+ * Default commands are used if no commands with a narrower scope are specified for the user.
124
+ */
125
+ export interface BotCommandScopeDefault {
126
+ /** The scope type, must be "default". */
127
+ type: "default";
128
+ }
129
+
130
+ /**
131
+ * Represents the scope of bot commands, covering all private chats.
132
+ */
133
+ export interface BotCommandScopeAllPrivateChats {
134
+ /** The scope type, must be "all_private_chats". */
135
+ type: "all_private_chats";
136
+ }
137
+
138
+ /**
139
+ * Represents the scope of bot commands, covering all group and supergroup chats.
140
+ */
141
+ export interface BotCommandScopeAllGroupChats {
142
+ /** The scope type, must be "all_group_chats". */
143
+ type: "all_group_chats";
144
+ }
145
+
146
+ /**
147
+ * Represents the scope of bot commands, covering all group and supergroup chat administrators.
148
+ */
149
+ export interface BotCommandScopeAllChatAdministrators {
150
+ /** The scope type, must be "all_chat_administrators". */
151
+ type: "all_chat_administrators";
152
+ }
153
+
154
+ /**
155
+ * Represents the scope of bot commands, covering a specific chat.
156
+ */
157
+ export interface BotCommandScopeChat {
158
+ /** The scope type, must be "chat". */
159
+ type: "chat";
160
+ /** The unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). */
161
+ chat_id: number | string;
162
+ }
163
+
164
+ /**
165
+ * Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
166
+ */
167
+ export interface BotCommandScopeChatAdministrators {
168
+ /** The scope type, must be "chat_administrators". */
169
+ type: "chat_administrators";
170
+ /** The unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). */
171
+ chat_id: number | string;
172
+ }
173
+
174
+ /**
175
+ * Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
176
+ */
177
+ export interface BotCommandScopeChatMember {
178
+ /** The scope type, must be "chat_member". */
179
+ type: "chat_member";
180
+ /** The unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). */
181
+ chat_id: number | string;
182
+ /** The unique identifier of the target user. */
183
+ user_id: number;
184
+ }
package/src/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export * from "./api.js";
2
- export * from "./inline.js";
3
- export * from "./manage.js";
4
- export * from "./markup.js";
5
- export * from "./message.js";
6
- export * from "./methods.js";
7
- export * from "./passport.js";
8
- export * from "./payment.js";
9
- export * from "./settings.js";
10
- export * from "./update.js";
1
+ export * from "./telegramTypes.js";
2
+ export * from "./inlineTypes.js";
3
+ export * from "./manageTypes.js";
4
+ export * from "./markupTypes.js";
5
+ export * from "./messageTypes.js";
6
+ export * from "./apiMethodsTypes.js";
7
+ export * from "./passportTypes.js";
8
+ export * from "./invoiceTypes.js";
9
+ export * from "./botCommandTypes.js";
10
+ export * from "./updateTypes.js";
@@ -1,19 +1,19 @@
1
1
  import type {
2
2
  Chat,
3
3
  User
4
- } from "./manage.js";
4
+ } from "./manageTypes.js";
5
5
  import type {
6
6
  InlineKeyboardMarkup,
7
7
  WebAppInfo
8
- } from "./markup.js";
8
+ } from "./markupTypes.js";
9
9
  import type {
10
10
  Location,
11
11
  MessageEntity,
12
12
  ParseMode
13
- } from "./message.js";
13
+ } from "./messageTypes.js";
14
14
  import type {
15
15
  LabeledPrice
16
- } from "./payment.js";
16
+ } from "./invoiceTypes.js";
17
17
  /** This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. */
18
18
  export interface InlineQuery {
19
19
  /** Unique identifier for this query */
@@ -0,0 +1,149 @@
1
+ import type {
2
+ User
3
+ } from "./manageTypes.js";
4
+
5
+ /**
6
+ * This interface represents a labeled portion of the price for goods or services.
7
+ */
8
+ export interface LabeledPrice {
9
+ /** The label of the portion. */
10
+ label: string;
11
+ /**
12
+ * The price of the product in the smallest units of the currency (integer, not float/double).
13
+ * For example, for a price of US$ 1.45, the amount would be 145.
14
+ * See the 'exp' parameter in currencies.json for the number of digits past the decimal point for each currency
15
+ * (2 for the majority of currencies).
16
+ */
17
+ amount: number;
18
+ }
19
+
20
+ /**
21
+ * This interface contains basic information about an invoice.
22
+ */
23
+ export interface Invoice {
24
+ /** The name of the product. */
25
+ title: string;
26
+ /** The description of the product. */
27
+ description: string;
28
+ /** A unique bot deep-linking parameter that can be used to generate this invoice. */
29
+ start_parameter: string;
30
+ /** The three-letter ISO 4217 currency code. */
31
+ currency: string;
32
+ /**
33
+ * The total price in the smallest units of the currency (integer, not float/double).
34
+ * For example, for a price of US$ 1.45, the total_amount would be 145.
35
+ * See the 'exp' parameter in currencies.json for the number of digits past the decimal point for each currency
36
+ * (2 for the majority of currencies).
37
+ */
38
+ total_amount: number;
39
+ }
40
+
41
+ /**
42
+ * This interface represents a shipping address.
43
+ */
44
+ export interface ShippingAddress {
45
+ /** The two-letter ISO 3166-1 alpha-2 country code. */
46
+ country_code: string;
47
+ /** The state, if applicable. */
48
+ state: string;
49
+ /** The city. */
50
+ city: string;
51
+ /** The first line for the address. */
52
+ street_line1: string;
53
+ /** The second line for the address. */
54
+ street_line2: string;
55
+ /** The address postal code. */
56
+ post_code: string;
57
+ }
58
+
59
+ /**
60
+ * This interface represents information about an order.
61
+ */
62
+ export interface OrderInfo {
63
+ /** The user's name. */
64
+ name?: string;
65
+ /** The user's phone number. */
66
+ phone_number?: string;
67
+ /** The user's email. */
68
+ email?: string;
69
+ /** The user's shipping address. */
70
+ shipping_address?: ShippingAddress;
71
+ }
72
+
73
+ /**
74
+ * This interface represents a shipping option.
75
+ */
76
+ export interface ShippingOption {
77
+ /** The shipping option identifier. */
78
+ id: string;
79
+ /** The title of the option. */
80
+ title: string;
81
+ /** The list of price portions. */
82
+ prices: LabeledPrice[];
83
+ }
84
+
85
+ /**
86
+ * This interface contains basic information about a successful payment.
87
+ */
88
+ export interface SuccessfulPayment {
89
+ /** The three-letter ISO 4217 currency code. */
90
+ currency: string;
91
+ /**
92
+ * The total price in the smallest units of the currency (integer, not float/double).
93
+ * For example, for a price of US$ 1.45, the total_amount would be 145.
94
+ * See the 'exp' parameter in currencies.json for the number of digits past the decimal point for each currency
95
+ * (2 for the majority of currencies).
96
+ */
97
+ total_amount: number;
98
+ /** The bot-specified invoice payload. */
99
+ invoice_payload: string;
100
+ /** The identifier of the shipping option chosen by the user. */
101
+ shipping_option_id?: string;
102
+ /** The order information provided by the user. */
103
+ order_info?: OrderInfo;
104
+ /** The Telegram payment identifier. */
105
+ telegram_payment_charge_id: string;
106
+ /** The provider payment identifier. */
107
+ provider_payment_charge_id:
108
+
109
+ string;
110
+ }
111
+
112
+ /**
113
+ * This interface contains information about an incoming shipping query.
114
+ */
115
+ export interface ShippingQuery {
116
+ /** The unique query identifier. */
117
+ id: string;
118
+ /** The user who sent the query. */
119
+ from: User;
120
+ /** The bot-specified invoice payload. */
121
+ invoice_payload: string;
122
+ /** The user-specified shipping address. */
123
+ shipping_address: ShippingAddress;
124
+ }
125
+
126
+ /**
127
+ * This interface contains information about an incoming pre-checkout query.
128
+ */
129
+ export interface PreCheckoutQuery {
130
+ /** The unique query identifier. */
131
+ id: string;
132
+ /** The user who sent the query. */
133
+ from: User;
134
+ /** The three-letter ISO 4217 currency code. */
135
+ currency: string;
136
+ /**
137
+ * The total price in the smallest units of the currency (integer, not float/double).
138
+ * For example, for a price of US$ 1.45, the total_amount would be 145.
139
+ * See the 'exp' parameter in currencies.json for the number of digits past the decimal point for each currency
140
+ * (2 for the majority of currencies).
141
+ */
142
+ total_amount: number;
143
+ /** The bot-specified invoice payload. */
144
+ invoice_payload: string;
145
+ /** The identifier of the shipping option chosen by the user. */
146
+ shipping_option_id?: string;
147
+ /** The order information provided by the user. */
148
+ order_info?: OrderInfo;
149
+ }
@@ -2,10 +2,10 @@ import type {
2
2
  Location,
3
3
  Message,
4
4
  PhotoSize
5
- } from "./message.js";
5
+ } from "./messageTypes.js";
6
6
  import type {
7
7
  Update
8
- } from "./update.js";
8
+ } from "./updateTypes.js";
9
9
  /** Describes the current status of a webhook. */
10
10
  export interface WebhookInfo {
11
11
  /** Webhook URL, may be empty if webhook is not set up */
@@ -1,10 +1,10 @@
1
1
  import type {
2
2
  ChatAdministratorRights,
3
3
  User
4
- } from "./manage.js";
4
+ } from "./manageTypes.js";
5
5
  import type {
6
6
  Message
7
- } from "./message.js";
7
+ } from "./messageTypes.js";
8
8
  /** This object represents an inline keyboard that appears right next to the message it belongs to. */
9
9
  export interface InlineKeyboardMarkup {
10
10
  /** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
@@ -2,17 +2,17 @@ import type {
2
2
  Chat,
3
3
  File,
4
4
  User
5
- } from "./manage.js";
5
+ } from "./manageTypes.js";
6
6
  import type {
7
7
  InlineKeyboardMarkup
8
- } from "./markup.js";
8
+ } from "./markupTypes.js";
9
9
  import type {
10
10
  PassportData
11
- } from "./passport.js";
11
+ } from "./passportTypes.js";
12
12
  import type {
13
13
  Invoice,
14
14
  SuccessfulPayment
15
- } from "./payment.js";
15
+ } from "./invoiceTypes.js";
16
16
  type MsgWith < P extends keyof Message > = Record < P, NonNullable < Message[P]>>;
17
17
  export declare namespace Message {
18
18
  interface ServiceMessage {
@@ -256,12 +256,12 @@ __underline__
256
256
  [inline mention of a user](tg://user?id=123456789)
257
257
  ![👍](tg://emoji?id=5368324170671202286)
258
258
  `inline fixed-width code`
259
- `​`​`
259
+ ```
260
260
  pre-formatted fixed-width code block
261
- `​`​`
262
- `​`​`python
261
+ ```
262
+ ```python
263
263
  pre-formatted fixed-width code block written in the Python programming language
264
- `​`​`
264
+ ```
265
265
  ```
266
266
  Please note:
267
267
 
@@ -0,0 +1,197 @@
1
+ /** Describes the user's Telegram Passport data shared with the bot. */
2
+ export interface PassportData {
3
+ /** Array containing information about documents and other Telegram Passport elements shared with the bot. */
4
+ data: EncryptedPassportElement[];
5
+ /** Encrypted credentials required to decrypt the data. */
6
+ credentials: EncryptedCredentials;
7
+ }
8
+
9
+ /** This object represents a file uploaded to Telegram Passport. Currently, all Telegram Passport files are in JPEG format when decrypted and do not exceed 10MB. */
10
+ export interface PassportFile {
11
+ /** Identifier for this file, which can be used to download or reuse the file. */
12
+ file_id: string;
13
+ /** Unique identifier for this file, which remains the same over time and for different bots. This identifier cannot be used to download or reuse the file. */
14
+ file_unique_id: string;
15
+ /** File size in bytes. */
16
+ file_size: number;
17
+ /** Unix time when the file was uploaded. */
18
+ file_date: number;
19
+ }
20
+
21
+ /** Describes documents or other Telegram Passport elements shared with the bot by the user. */
22
+ export interface EncryptedPassportElement {
23
+ /** Element type. Possible values are "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration", "phone_number", and "email". */
24
+ type: "personal_details" | "passport" | "driver_license" | "identity_card" | "internal_passport" | "address" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration" | "phone_number" | "email";
25
+ /** Base64-encoded encrypted Telegram Passport element data provided by the user. This data is available for types "personal_details", "passport", "driver_license", "identity_card", "internal_passport", and "address". It can be decrypted and verified using the accompanying EncryptedCredentials. */
26
+ data?: string;
27
+ /** User's verified phone number, available only for type "phone_number". */
28
+ phone_number?: string;
29
+ /** User's verified email address, available only for type "email". */
30
+ email?: string;
31
+ /** Array of encrypted files with documents provided by the user. This array is available for types "utility_bill", "bank_statement", "rental_agreement", "passport_registration", and "temporary_registration". The files can be decrypted and verified using the accompanying EncryptedCredentials. */
32
+ files?: PassportFile[];
33
+ /** Encrypted file with the front side of the document, provided by the user. This file is available for types "passport", "driver_license", "identity_card", and "internal_passport". It can be decrypted and verified using the accompanying EncryptedCredentials. */
34
+ front_side?: PassportFile;
35
+ /** Encrypted file with the reverse side of the document, provided by the user. This file is available for types "driver_license" and "identity_card". It can be decrypted and verified using the accompanying EncryptedCredentials. */
36
+ reverse_side?: PassportFile;
37
+ /** Encrypted file with the selfie of the user holding a document, provided by the user. This file is available for types "passport", "driver_license", "identity_card", and "internal_passport". It can be decrypted and verified using the accompanying EncryptedCredentials. */
38
+ selfie?: PassportFile;
39
+ /** Array of encrypted files with translated versions of documents provided by the user. This array is available for types "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", and "temporary_registration". The
40
+
41
+ files can be decrypted and verified using the accompanying EncryptedCredentials. */
42
+ translation?: PassportFile[];
43
+ /** Base64-encoded element hash for use in PassportElementErrorUnspecified. */
44
+ hash: string;
45
+ }
46
+
47
+ /** Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes. */
48
+ export interface EncryptedCredentials {
49
+ /** Base64-encoded encrypted JSON-serialized data with the user's payload, data hashes, and secrets required for EncryptedPassportElement decryption and authentication. */
50
+ data: string;
51
+ /** Base64-encoded data hash for data authentication. */
52
+ hash: string;
53
+ /** Base64-encoded secret encrypted with the bot's public RSA key, required for data decryption. */
54
+ secret: string;
55
+ }
56
+
57
+ /** This object represents an error in the Telegram Passport element that was submitted and should be resolved by the user. It can be one of the following:
58
+ - PassportElementErrorDataField
59
+ - PassportElementErrorFrontSide
60
+ - PassportElementErrorReverseSide
61
+ - PassportElementErrorSelfie
62
+ - PassportElementErrorFile
63
+ - PassportElementErrorFiles
64
+ - PassportElementErrorTranslationFile
65
+ - PassportElementErrorTranslationFiles
66
+ - PassportElementErrorUnspecified
67
+ */
68
+ export type PassportElementError =
69
+ | PassportElementErrorDataField
70
+ | PassportElementErrorFrontSide
71
+ | PassportElementErrorReverseSide
72
+ | PassportElementErrorSelfie
73
+ | PassportElementErrorFile
74
+ | PassportElementErrorFiles
75
+ | PassportElementErrorTranslationFile
76
+ | PassportElementErrorTranslationFiles
77
+ | PassportElementErrorUnspecified;
78
+
79
+ /** Represents an issue in one of the data fields provided by the user. The error is considered resolved when the field's value changes. */
80
+ export interface PassportElementErrorDataField {
81
+ /** Error source, must be "data". */
82
+ source: "data";
83
+ /** The section of the user's Telegram Passport that has the error. Possible values are "personal_details", "passport", "driver_license", "identity_card", "internal_passport", and "address". */
84
+ type: "personal_details" | "passport" | "driver_license" | "identity_card" | "internal_passport" | "address";
85
+ /** Name of the data field that has the error. */
86
+ field_name: string;
87
+ /** Base64-encoded data hash. */
88
+ data_hash: string;
89
+ /** Error message. */
90
+ message: string;
91
+ }
92
+
93
+ /** Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes. */
94
+ export interface PassportElementErrorFrontSide {
95
+ /** Error source, must be "front_side". */
96
+ source: "front_side";
97
+ /** The section of the user's Telegram Passport that has the issue. Possible values are "passport", "driver_license", "identity_card", and "internal_passport". */
98
+ type: "passport" | "driver_license" | "identity_card" | "internal_passport";
99
+ /** Base64-encoded hash of the file with the front side of the document. */
100
+ file_hash: string;
101
+ /** Error message. */
102
+ message: string;
103
+ }
104
+
105
+ /** Represents an issue with the reverse side of a document. The error is considered resolved when the file with the reverse side of the document changes. */
106
+ export interface PassportElementErrorReverseSide {
107
+ /** Error source, must be "reverse_side". */
108
+ source: "reverse_side";
109
+ /** The section of the user's Telegram Passport that has the issue. Possible values are "driver_license" and "identity_card". */
110
+ type: "driver_license" | "identity_card";
111
+ /** Base64-encoded hash of the file with the reverse side
112
+
113
+ of the document. */
114
+ file_hash: string;
115
+ /** Error message. */
116
+ message: string;
117
+ }
118
+
119
+ /** Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes. */
120
+ export interface PassportElementErrorSelfie {
121
+ /** Error source, must be "selfie". */
122
+ source: "selfie";
123
+ /** The section of the user's Telegram Passport that has the issue. Possible values are "passport", "driver_license", "identity_card", and "internal_passport". */
124
+ type: "passport" | "driver_license" | "identity_card" | "internal_passport";
125
+ /** Base64-encoded hash of the file with the selfie. */
126
+ file_hash: string;
127
+ /** Error message. */
128
+ message: string;
129
+ }
130
+
131
+ /** Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes. */
132
+ export interface PassportElementErrorFile {
133
+ /** Error source, must be "file". */
134
+ source: "file";
135
+ /** The section of the user's Telegram Passport that has the issue. Possible values are "utility_bill", "bank_statement", "rental_agreement", "passport_registration", and "temporary_registration". */
136
+ type: "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration";
137
+ /** Base64-encoded file hash. */
138
+ file_hash: string;
139
+ /** Error message. */
140
+ message: string;
141
+ }
142
+
143
+ /** Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes. */
144
+ export interface PassportElementErrorFiles {
145
+ /** Error source, must be "files". */
146
+ source: "files";
147
+ /** The section of the user's Telegram Passport that has the issue. Possible values are "utility_bill", "bank_statement", "rental_agreement", "passport_registration", and "temporary_registration". */
148
+ type: "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration";
149
+ /** List of base64-encoded file hashes. */
150
+ file_hashes: string[];
151
+ /** Error message. */
152
+ message: string;
153
+ }
154
+
155
+ /** Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes. */
156
+ export interface PassportElementErrorTranslationFile {
157
+ /** Error source, must be "translation_file". */
158
+ source: "translation_file";
159
+ /** Type of element of the user's Telegram Passport that has the issue. Possible values are "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", and "temporary_registration". */
160
+ type: "passport" | "driver_license" | "identity_card" | "internal_passport" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration";
161
+ /** Base64-encoded file hash. */
162
+ file_hash: string;
163
+ /** Error message. */
164
+ message: string;
165
+ }
166
+
167
+ /** Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation changes. */
168
+ export interface PassportElementErrorTranslationFiles {
169
+ /** Error source, must be "translation_files". */
170
+ source: "translation_files";
171
+ /** Type of element of the user's Telegram Passport that has the issue. Possible values are "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", and "temporary_registration". */
172
+ type: "passport" | "driver_license" | "identity_card" | "internal_passport" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration";
173
+ /** List of base64-encoded file hashes. */
174
+ file_hashes: string[];
175
+ /** Error message. */
176
+ message: string;
177
+ }
178
+
179
+ /** Represents an issue in an unspecified element of the Telegram Passport. The error is considered resolved when new data is added. */
180
+ export interface PassportElementErrorUnspecified {
181
+ /** Error source, must be "unspecified". */
182
+ source: "unspecified";
183
+ /** Type of element of the user's Telegram Passport that has the issue. Possible values are "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration", "phone_number", and "email". */
184
+ type: "personal_details" | "passport" | "driver_license" | "identity_card" | "internal_passport" | "address" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration" | "phone_number" | "email";
185
+ /** Base64-encoded element hash. */
186
+ element_hash: string;
187
+ /** Error message. */
188
+ message: string;
189
+ }
190
+
191
+ /** This object represents a user's Telegram Passport data. */
192
+ export interface Passport {
193
+ /** Array with information about documents and other Telegram Passport elements that are shared with the bot. */
194
+ data: EncryptedPassportElement[];
195
+ /** Encrypted credentials required to decrypt and authenticate the data. */
196
+ credentials: EncryptedCredentials;
197
+ }