telegram.EncryptedPassportElement#
- class telegram.EncryptedPassportElement(*args, **kwargs)[source]#
Bases:
telegram.TelegramObjectContains information about documents or other Telegram Passport elements shared with the bot by the user. The data has been automatically decrypted by python-telegram-bot.
Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their
type,data,phone_number,email,files,front_side,reverse_sideandselfieare equal.Note
This object is decrypted only when originating from
telegram.PassportData.decrypted_data.- Parameters
type (
str) – Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.hash (
str) – Base64-encoded element hash for using intelegram.PassportElementErrorUnspecified.data (
telegram.PersonalDetails|telegram.IdDocumentData|telegram.ResidentialAddress|str, optional) – Decrypted or encrypted data, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “identity_passport” and “address” types.phone_number (
str, optional) – User’s verified phone number, available only for “phone_number” type.email (
str, optional) – User’s verified email address, available only for “email” type.files (List[
telegram.PassportFile], optional) – Array of encrypted/decrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.front_side (
telegram.PassportFile, optional) – Encrypted/decrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”.reverse_side (
telegram.PassportFile, optional) – Encrypted/decrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”.selfie (
telegram.PassportFile, optional) – Encrypted/decrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”.translation (List[
telegram.PassportFile], optional) – Array of encrypted/decrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.bot (
telegram.Bot, optional) – The Bot to use for instance methods.
- type[source]#
Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
- Type
- hash[source]#
Base64-encoded element hash for using in
telegram.PassportElementErrorUnspecified.- Type
- data[source]#
Optional. Decrypted or encrypted data, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “identity_passport” and “address” types.
- phone_number[source]#
Optional. User’s verified phone number, available only for “phone_number” type.
- Type
- files[source]#
Optional. Array of encrypted/decrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.
- Type
List[
telegram.PassportFile]
- front_side[source]#
Optional. Encrypted/decrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”.
- reverse_side[source]#
Optional. Encrypted/decrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”.
- selfie[source]#
Optional. Encrypted/decrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”.
- translation[source]#
Optional. Array of encrypted/decrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.
- Type
List[
telegram.PassportFile]
- classmethod de_json_decrypted(data, bot, credentials)[source]#
Variant of
telegram.TelegramObject.de_json()that also takes into account passport credentials.- Parameters
bot (
telegram.Bot) – The bot associated with this object.credentials (
telegram.FileCredentials) – The credentials
- Return type