From 2be342a7694b6164b615bdf86a5a1b9328367b53 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 11 Mar 2021 16:36:01 +0600 Subject: [PATCH] remove BotInviteChatLink --- .../dev/inmo/tgbotapi/types/ChatInviteLink.kt | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatInviteLink.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatInviteLink.kt index cba15be9b9..46a46759d8 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatInviteLink.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatInviteLink.kt @@ -5,7 +5,6 @@ import kotlinx.serialization.* import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder -import kotlinx.serialization.json.JsonObject @Serializable private data class RawChatInviteLink( @@ -42,27 +41,6 @@ sealed class ChatInviteLink { abstract val membersLimit: MembersLimit? } -@Serializable -data class BotInviteLink( - @SerialName(inviteLinkField) - override val inviteLink: String, - @SerialName(creatorField) - override val creator: Bot, - @SerialName(isRevokedField) - override val isRevoked: Boolean = false, - @SerialName(expireDateField) - private val expireDate: UnixTimeStamp? = null, - @SerialName(memberLimitField) - override val membersLimit: MembersLimit? = null -) : ChatInviteLink() { - override val isPrimary: Boolean - get() = false - override val expirationDateTime: DateTime? - get() { - return DateTime(expireDate ?.seconds ?.milliseconds ?: return null) - } -} - @Serializable data class PrimaryInviteLink( @SerialName(inviteLinkField) @@ -114,9 +92,6 @@ object ChatInviteLinkSerializer : KSerializer { val deserializedRaw = RawChatInviteLink.serializer().deserialize(decoder) return deserializedRaw.run { when { - creator is Bot -> BotInviteLink( - inviteLink, creator, isRevoked, expirationDateTime, membersLimit - ) deserializedRaw.isPrimary -> PrimaryInviteLink( inviteLink, creator, isRevoked, expirationDateTime, membersLimit )