From 14756fd6e8cba9720dbbce3b67c89578ed02c3e7 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 7 Jan 2024 15:16:33 +0600 Subject: [PATCH] add support of has_visible_history field --- .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 1 + .../kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt | 10 +++++++++- .../dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index f4482e3fec..29e4b67754 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -236,6 +236,7 @@ const val accentColorIdField = "accent_color_id" const val profileAccentColorIdField = "profile_accent_color_id" const val backgroundCustomEmojiIdField = "background_custom_emoji_id" const val profileBackgroundCustomEmojiIdField = "profile_background_custom_emoji_id" +const val hasVisibleHistoryField = "has_visible_history" const val iconCustomEmojiIdField = "icon_custom_emoji_id" const val canJoinGroupsField = "can_join_groups" const val canReadAllGroupMessagesField = "can_read_all_group_messages" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt index 4478b120ca..0041828a48 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt @@ -49,6 +49,8 @@ data class ExtendedChannelChatImpl( override val backgroundCustomEmojiId: CustomEmojiId? = null, @SerialName(profileBackgroundCustomEmojiIdField) override val profileBackgroundCustomEmojiId: CustomEmojiId? = null, + @SerialName(hasVisibleHistoryField) + override val newMembersSeeHistory: Boolean = false ) : ExtendedChannelChat @Serializable @@ -85,6 +87,8 @@ data class ExtendedGroupChatImpl( override val backgroundCustomEmojiId: CustomEmojiId? = null, @SerialName(profileBackgroundCustomEmojiIdField) override val profileBackgroundCustomEmojiId: CustomEmojiId? = null, + @SerialName(hasVisibleHistoryField) + override val newMembersSeeHistory: Boolean = false, ) : ExtendedGroupChat @Serializable @@ -178,6 +182,8 @@ data class ExtendedSupergroupChatImpl( override val backgroundCustomEmojiId: CustomEmojiId? = null, @SerialName(profileBackgroundCustomEmojiIdField) override val profileBackgroundCustomEmojiId: CustomEmojiId? = null, + @SerialName(hasVisibleHistoryField) + override val newMembersSeeHistory: Boolean = false, ) : ExtendedSupergroupChat @Serializable @@ -234,6 +240,8 @@ data class ExtendedForumChatImpl( override val backgroundCustomEmojiId: CustomEmojiId? = null, @SerialName(profileBackgroundCustomEmojiIdField) override val profileBackgroundCustomEmojiId: CustomEmojiId? = null, + @SerialName(hasVisibleHistoryField) + override val newMembersSeeHistory: Boolean = false, ) : ExtendedForumChat @Serializable @@ -279,5 +287,5 @@ data class UnknownExtendedChat( @SerialName(backgroundCustomEmojiIdField) override val backgroundCustomEmojiId: CustomEmojiId? = null @SerialName(profileBackgroundCustomEmojiIdField) - override val profileBackgroundCustomEmojiId: CustomEmojiId? = null,\ + override val profileBackgroundCustomEmojiId: CustomEmojiId? = null } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt index 7df107fade..1b044a5b59 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt @@ -50,6 +50,7 @@ sealed interface ExtendedPublicChat : ExtendedChat, PublicChat, ExtendedNonBotCh val pinnedMessage: Message? val membersHidden: Boolean val availableReactions: List? + val newMembersSeeHistory: Boolean } @Serializable(ExtendedChatSerializer.Companion::class)