Passport Data Errors
If the passport data you received contains errors, the bot can use the SetPassportDataErrors method to inform the user and request information again. The user will not be able to resend the data, until all errors are fixed.
Here is an example call using decrypted credentials:
//using Telegram.Bot.Types.Passport;
PassportElementError[] errors =
{
new PassportElementErrorDataField
{
Type = EncryptedPassportElementType.Passport,
FieldName = "document_no",
DataHash = credentials.SecureData.Passport.Data.DataHash,
Message = "Invalid passport number"
},
new PassportElementErrorFrontSide
{
Type = EncryptedPassportElementType.Passport,
FileHash = credentials.SecureData.Passport.FrontSide.FileHash,
Message = "Document scan is redacted"
},
new PassportElementErrorSelfie
{
Type = EncryptedPassportElementType.Passport,
FileHash = credentials.SecureData.Passport.Selfie.FileHash,
Message = "Take a selfie without glasses"
},
new PassportElementErrorTranslationFile
{
Type = EncryptedPassportElementType.Passport,
FileHash = credentials.SecureData.Passport.Translation[0].FileHash,
Message = "Document photo is blury"
},
};
await bot.SetPassportDataErrors(passportMessage.From.Id, errors);