From 0581587adfa211bc589c52274878f12601f6057a Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 10 Dec 2021 12:53:00 +0600 Subject: [PATCH] add support of has_private_forwards --- .../src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt | 1 + .../types/chat/abstracts/extended/ExtendedPrivateChat.kt | 4 ++++ .../tgbotapi/types/chat/extended/ExtendedPrivateChatImpl.kt | 4 +++- 3 files changed, 8 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 d51feb7fcf..3b0116f2a9 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 @@ -113,6 +113,7 @@ const val isBotField = "is_bot" const val firstNameField = "first_name" const val lastNameField = "last_name" const val languageCodeField = "language_code" +const val hasPrivateForwardsField = "has_private_forwards" const val canJoinGroupsField = "can_join_groups" const val canReadAllGroupMessagesField = "can_read_all_group_messages" const val supportInlineQueriesField = "supports_inline_queries" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/abstracts/extended/ExtendedPrivateChat.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/abstracts/extended/ExtendedPrivateChat.kt index 55a03723a5..8fb6617a95 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/abstracts/extended/ExtendedPrivateChat.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/abstracts/extended/ExtendedPrivateChat.kt @@ -7,4 +7,8 @@ import kotlinx.serialization.Serializable @Serializable(ExtendedChatSerializer::class) interface ExtendedPrivateChat : PrivateChat, ExtendedChat { val bio: String + val hasPrivateForwards: Boolean + + val allowCreateUserIdLink: Boolean + get() = hasPrivateForwards } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/extended/ExtendedPrivateChatImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/extended/ExtendedPrivateChatImpl.kt index 4c1d9702de..4f1d86d55d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/extended/ExtendedPrivateChatImpl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/extended/ExtendedPrivateChatImpl.kt @@ -18,5 +18,7 @@ data class ExtendedPrivateChatImpl( @SerialName(lastNameField) override val lastName: String = "", @SerialName(bioField) - override val bio: String = "" + override val bio: String = "", + @SerialName(hasPrivateForwardsField) + override val hasPrivateForwards: Boolean = false ) : ExtendedPrivateChat