diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMember.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMember.kt index e11554acb7..e852e21dcd 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMember.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMember.kt @@ -1,6 +1,11 @@ package dev.inmo.tgbotapi.types.chat.member +import dev.inmo.tgbotapi.abstracts.types.UntilDate +import korlibs.time.DateTime import kotlinx.serialization.Serializable @Serializable(ChatMemberSerializer::class) -sealed interface MemberChatMember : ChatMember +sealed interface MemberChatMember : ChatMember, UntilDate { + val until: DateTime? + get() = untilDate ?.asDate +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMemberImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMemberImpl.kt index 43f9ad4b54..3e2d10dd26 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMemberImpl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMemberImpl.kt @@ -2,12 +2,16 @@ package dev.inmo.tgbotapi.types.chat.member import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.chat.User +import korlibs.time.DateTime import kotlinx.serialization.* @Serializable data class MemberChatMemberImpl( @SerialName(userField) - override val user: User + override val user: User, + @SerialName(untilDateField) + @Serializable(TelegramDateSerializer::class) + override val untilDate: TelegramDate? = null ) : MemberChatMember { @SerialName(statusField) @Required