mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-04 15:49:41 +00:00
fix: brought back the canReceiveGifts
field, marked as deprecated
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user