1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-03 23:29:33 +00:00

fix: brought back the canReceiveGifts field, marked as deprecated

This commit is contained in:
bpavuk
2025-04-16 16:34:33 +03:00
parent cb6127bf91
commit 713130fd13

View File

@@ -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