Hide navigation sidebar
Hide table of contents sidebar
PTB has undergone significant changes in v20. Please read the documentation carefully and also check out the transition guide in the wiki.
Back to top
Toggle table of contents sidebar

# PassportElementErrorTranslationFile

class telegram.PassportElementErrorTranslationFile(type, file_hash, message, *, api_kwargs=None)

  Bases: `telegram.PassportElementError`

  Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `source`, `type`, `file_hash`, and `message` are equal.

  Parameters:

    - type (`str`) – Type of element of the user’s Telegram Passport which has the issue, one of `"passport"`, `"driver_license"`, `"identity_card"`, `"internal_passport"`, `"utility_bill"`, `"bank_statement"`, `"rental_agreement"`, `"passport_registration"`, `"temporary_registration"`.

    - file_hash (`str`) – Base64-encoded hash of the file.

    - message (`str`) – Error message.

  type

    Type of element of the user’s Telegram Passport which has the issue, one of `"passport"`, `"driver_license"`, `"identity_card"`, `"internal_passport"`, `"utility_bill"`, `"bank_statement"`, `"rental_agreement"`, `"passport_registration"`, `"temporary_registration"`.

    Type:

      `str`

  file_hash

    Base64-encoded hash of the file.

    Type:

      `str`

  message

    Error message.

    Type:

      `str`

  Use In

  `telegram.Bot.set_passport_data_errors()`