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 3a362d8857..fc6bd47080 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 @@ -21,6 +21,17 @@ sealed interface ExtendedChat : Chat { val maxReactionsCount: Int val acceptedGiftTypes: AcceptedGiftTypes + + @Deprecated( + message = "Telegram Bot API v9.0 introduced the new field, `acceptedGiftTypes`, to allow granular" + + " control over which types of gifts user, bot, or chat can accept.", + replaceWith = ReplaceWith("acceptedGiftTypes.uniqueGifts || acceptedGiftTypes.unlimitedGifts || acceptedGiftTypes.limitedGifts || acceptedGiftTypes.premiumSubscription") + ) + val canReceiveGifts: Boolean + get() = acceptedGiftTypes.uniqueGifts || + acceptedGiftTypes.unlimitedGifts || + acceptedGiftTypes.limitedGifts || + acceptedGiftTypes.premiumSubscription } @Serializable(ExtendedChatSerializer.Companion::class) @@ -60,6 +71,7 @@ sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername, Ex sealed interface ExtendedPublicChat : ExtendedChat, PublicChat, ExtendedNonBotChat { val description: String val inviteLink: String? + @Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class) val pinnedMessage: Message? val membersHidden: Boolean