mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-24 11:08:43 +00:00
fixes in webappuser
This commit is contained in:
parent
77ea1f741e
commit
187f340e88
@ -27,18 +27,18 @@ val WebAppUser.isPremium
|
|||||||
|
|
||||||
fun WebAppUser.asUser() = if (isBot == true) {
|
fun WebAppUser.asUser() = if (isBot == true) {
|
||||||
CommonBot(
|
CommonBot(
|
||||||
UserId(id),
|
id = UserId(id),
|
||||||
firstName,
|
firstName = firstName,
|
||||||
lastName ?: "",
|
lastName = lastName ?: "",
|
||||||
username ?.let(::Username) ?: error("Username is absent for bot, but must exists")
|
username = username ?.let(::Username)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
CommonUser(
|
CommonUser(
|
||||||
UserId(id),
|
id = UserId(id),
|
||||||
firstName,
|
firstName = firstName,
|
||||||
lastName ?: "",
|
lastName = lastName ?: "",
|
||||||
username ?.let(::Username),
|
username = username ?.let(::Username),
|
||||||
languageCode ?.let(::IetfLanguageCode),
|
ietfLanguageCode = languageCode ?.let(::IetfLanguageCode),
|
||||||
isPremium = isPremium
|
isPremium = isPremium
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user