mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-25 19:48:43 +00:00
now bot username is not nullable
This commit is contained in:
parent
0b4b4950c2
commit
a0120afb08
@ -2,6 +2,9 @@
|
||||
|
||||
## 0.25.0
|
||||
|
||||
* `TelegramBotAPI`:
|
||||
* `Bot` implementations (as and `Bot` itself) now have not nullable `username`
|
||||
|
||||
## 0.24.0
|
||||
|
||||
* `TelegramBotAPI`:
|
||||
|
@ -22,17 +22,19 @@ data class CommonUser(
|
||||
) : User()
|
||||
|
||||
@Serializable(UserSerializer::class)
|
||||
sealed class Bot : User()
|
||||
sealed class Bot : User() {
|
||||
abstract override val username: Username
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class CommonBot(
|
||||
override val id: ChatId,
|
||||
@SerialName(usernameField)
|
||||
override val username: Username,
|
||||
@SerialName(firstNameField)
|
||||
override val firstName: String,
|
||||
@SerialName(lastNameField)
|
||||
override val lastName: String = "",
|
||||
@SerialName(usernameField)
|
||||
override val username: Username? = null
|
||||
override val lastName: String = ""
|
||||
) : Bot() {
|
||||
@SerialName(isBotField)
|
||||
private val isBot = true
|
||||
@ -41,12 +43,12 @@ data class CommonBot(
|
||||
@Serializable
|
||||
data class ExtendedBot(
|
||||
override val id: ChatId,
|
||||
@SerialName(usernameField)
|
||||
override val username: Username,
|
||||
@SerialName(firstNameField)
|
||||
override val firstName: String,
|
||||
@SerialName(lastNameField)
|
||||
override val lastName: String = "",
|
||||
@SerialName(usernameField)
|
||||
override val username: Username? = null,
|
||||
@SerialName(canJoinGroupsField)
|
||||
val canJoinGroups: Boolean = false,
|
||||
@SerialName(canReadAllGroupMessagesField)
|
||||
|
Loading…
Reference in New Issue
Block a user