telegram.EncryptedPassportElement

class telegram.EncryptedPassportElement(*args, **kwargs)[source]

Bases: telegram.TelegramObject

Contains 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_side and selfie are 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 in telegram.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.

  • **kwargs (dict) – Arbitrary keyword arguments.

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

str

hash[source]

Base64-encoded element hash for using in telegram.PassportElementErrorUnspecified.

Type

str

data[source]

Optional. Decrypted or encrypted data, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “identity_passport” and “address” types.

Type

telegram.PersonalDetails | telegram.IdDocumentData | telegram.ResidentialAddress | str

phone_number[source]

Optional. User’s verified phone number, available only for “phone_number” type.

Type

str

email[source]

Optional. User’s verified email address, available only for “email” type.

Type

str

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”.

Type

telegram.PassportFile

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”.

Type

telegram.PassportFile

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”.

Type

telegram.PassportFile

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]

bot[source]

Optional. The Bot to use for instance methods.

Type

telegram.Bot

classmethod de_json(data, bot)[source]

See telegram.TelegramObject.de_json().

classmethod de_json_decrypted(data, bot, credentials)[source]

Variant of telegram.TelegramObject.de_json() that also takes into account passport credentials.

Parameters
Return type

telegram.EncryptedPassportElement

to_dict()[source]

See telegram.TelegramObject.to_dict().