1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00

fix serialization/deserialization of chat member statuses

This commit is contained in:
InsanusMokrassar 2023-09-29 22:16:10 +06:00
parent 6103b70a47
commit dee13c03ae
7 changed files with 9 additions and 12 deletions

View File

@ -2,6 +2,9 @@
## 9.2.1 ## 9.2.1
* `Core`:
* All `ChatMember` inheritors have fixes `status` field
## 9.2.0 ## 9.2.0
**Add support of [Telegram Bots API 6.9](https://core.telegram.org/bots/api-changelog#september-22-2023)** **Add support of [Telegram Bots API 6.9](https://core.telegram.org/bots/api-changelog#september-22-2023)**

View File

@ -45,6 +45,5 @@ data class AdministratorChatMemberImpl(
) : AdministratorChatMember { ) : AdministratorChatMember {
@SerialName(statusField) @SerialName(statusField)
@Required @Required
override val status: ChatMember.Status override val status: ChatMember.Status = ChatMember.Status.Administrator
get() = ChatMember.Status.Administrator
} }

View File

@ -13,6 +13,5 @@ data class KickedChatMember(
) : BannedChatMember { ) : BannedChatMember {
@SerialName(statusField) @SerialName(statusField)
@Required @Required
override val status: ChatMember.Status override val status: ChatMember.Status = ChatMember.Status.Kicked
get() = ChatMember.Status.Kicked
} }

View File

@ -11,6 +11,5 @@ data class LeftChatMemberImpl(
) : LeftChatMember { ) : LeftChatMember {
@SerialName(statusField) @SerialName(statusField)
@Required @Required
override val status: ChatMember.Status override val status: ChatMember.Status = ChatMember.Status.Left
get() = ChatMember.Status.Left
} }

View File

@ -11,6 +11,5 @@ data class MemberChatMemberImpl(
) : MemberChatMember { ) : MemberChatMember {
@SerialName(statusField) @SerialName(statusField)
@Required @Required
override val status: ChatMember.Status override val status: ChatMember.Status = ChatMember.Status.Member
get() = ChatMember.Status.Member
} }

View File

@ -45,6 +45,5 @@ data class OwnerChatMember(
@SerialName(statusField) @SerialName(statusField)
@Required @Required
override val status: ChatMember.Status override val status: ChatMember.Status = ChatMember.Status.Creator
get() = ChatMember.Status.Creator
} }

View File

@ -44,6 +44,5 @@ data class RestrictedChatMember(
) : BannedChatMember, SpecialRightsChatMember, ChatPermissions { ) : BannedChatMember, SpecialRightsChatMember, ChatPermissions {
@SerialName(statusField) @SerialName(statusField)
@Required @Required
override val status: ChatMember.Status override val status: ChatMember.Status = ChatMember.Status.Restricted
get() = ChatMember.Status.Restricted
} }