1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-05 08:09:21 +00:00

make bots username nullable

This commit is contained in:
2023-06-30 14:09:13 +06:00
parent 8247e7c69c
commit b3a657b7d6
3 changed files with 8 additions and 10 deletions

View File

@@ -28,9 +28,9 @@ val WebAppUser.isPremium
fun WebAppUser.asUser() = if (isBot == true) {
CommonBot(
UserId(id),
username ?.let(::Username) ?: error("Username is absent for bot, but must exists"),
firstName,
lastName ?: ""
lastName ?: "",
username ?.let(::Username) ?: error("Username is absent for bot, but must exists")
)
} else {
CommonUser(