1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

moving to an explicit API mode

refactored `passport` package
This commit is contained in:
bpavuk 2024-07-12 22:10:31 +03:00
parent b8837bffdc
commit ed39fde776
No known key found for this signature in database
GPG Key ID: B501D26D9DEA9CFE

View File

@ -10,16 +10,16 @@ import dev.inmo.tgbotapi.types.passport.PassportElementError
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement
import dev.inmo.tgbotapi.utils.passport.Decryptor import dev.inmo.tgbotapi.utils.passport.Decryptor
suspend fun TelegramBot.setPassportDataErrors( public suspend fun TelegramBot.setPassportDataErrors(
userId: UserId, userId: UserId,
errors: List<PassportElementError> errors: List<PassportElementError>
) = execute(SetPassportDataErrors(userId, errors)) ): Boolean = execute(SetPassportDataErrors(userId, errors))
suspend fun TelegramBot.setPassportDataErrors( public suspend fun TelegramBot.setPassportDataErrors(
user: User, user: User,
errors: List<PassportElementError> errors: List<PassportElementError>
) = setPassportDataErrors(user.id, errors) ): Boolean = setPassportDataErrors(user.id, errors)
suspend fun TelegramBot.setPassportDataErrors( public suspend fun TelegramBot.setPassportDataErrors(
userId: UserId, userId: UserId,
passportData: PassportData, passportData: PassportData,
decryptor: Decryptor, decryptor: Decryptor,
@ -32,15 +32,15 @@ suspend fun TelegramBot.setPassportDataErrors(
} }
} }
) )
suspend fun TelegramBot.setPassportDataErrors( public suspend fun TelegramBot.setPassportDataErrors(
user: User, user: User,
passportData: PassportData, passportData: PassportData,
decryptor: Decryptor, decryptor: Decryptor,
mapper: suspend Decryptor.(EncryptedPassportElement) -> PassportElementError mapper: suspend Decryptor.(EncryptedPassportElement) -> PassportElementError
) = setPassportDataErrors(user.id, passportData, decryptor, mapper) ): Boolean = setPassportDataErrors(user.id, passportData, decryptor, mapper)
suspend fun TelegramBot.setPassportDataErrors( public suspend fun TelegramBot.setPassportDataErrors(
passportMessage: PassportMessage, passportMessage: PassportMessage,
decryptor: Decryptor, decryptor: Decryptor,
mapper: suspend Decryptor.(EncryptedPassportElement) -> PassportElementError mapper: suspend Decryptor.(EncryptedPassportElement) -> PassportElementError
) = setPassportDataErrors(passportMessage.user, passportMessage.passportData, decryptor, mapper) ): Boolean = setPassportDataErrors(passportMessage.user, passportMessage.passportData, decryptor, mapper)