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