setPassportDataErrors()
Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
parameters
| parameter | type | required | description |
|---|---|---|---|
user_id | number | required | User identifier |
errors | PassportElementError[] | required | A JSON-serialized array describing the errors |
returns
boolean
usage in yaebal
not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.
import type { SetPassportDataErrorsParams } from "@yaebal/types";
await bot.api.call<boolean>("setPassportDataErrors", {
user_id: 123456789,
errors: [],
} satisfies SetPassportDataErrorsParams);context shortcut
also available as ctx.setPassportDataErrors() on
16
context types — see @yaebal/contexts.
/** Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns *True* on success. Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. */
ctx.setPassportDataErrors(params: Omit<SetPassportDataErrorsParams, "user_id">)