1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-03-03 17:32:23 +00:00

fix support of paid_message_star_count

This commit is contained in:
2026-02-18 17:18:38 +06:00
parent ac05fa0fe3
commit 4252db489a
4 changed files with 38 additions and 23 deletions

View File

@@ -0,0 +1,5 @@
package dev.inmo.tgbotapi.types.abstracts
interface WithOptionalPaidMessageStarCount {
val paidMessageStarCount: Int?
}

View File

@@ -69,8 +69,6 @@ data class ExtendedChannelChatImpl(
override val maxReactionsCount: Int = 3,
@SerialName(ratingField)
override val rating: UserRating? = null,
@SerialName(paidMessageStarCountField)
override val paidMessageStarCount: Int? = null,
@SerialName(uniqueGiftColorsField)
override val uniqueGiftColors: UniqueGiftColors? = null
) : ExtendedChannelChat
@@ -176,6 +174,8 @@ data class ExtendedPrivateChatImpl(
override val maxReactionsCount: Int = 3,
@SerialName(acceptedGiftTypesField)
override val acceptedGiftTypes: AcceptedGiftTypes = AcceptedGiftTypes(),
@SerialName(paidMessageStarCountField)
override val paidMessageStarCount: Int? = null,
) : ExtendedPrivateChat
@Serializable
@@ -230,6 +230,8 @@ data class ExtendedPrivateForumChatImpl(
override val maxReactionsCount: Int = 3,
@SerialName(acceptedGiftTypesField)
override val acceptedGiftTypes: AcceptedGiftTypes = AcceptedGiftTypes(),
@SerialName(paidMessageStarCountField)
override val paidMessageStarCount: Int? = null,
) : ExtendedPrivateForumChat
typealias ExtendedUser = ExtendedPrivateChat

View File

@@ -1,6 +1,7 @@
package dev.inmo.tgbotapi.types.chat
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.abstracts.WithOptionalPaidMessageStarCount
import dev.inmo.tgbotapi.types.business_connection.BusinessIntro
import dev.inmo.tgbotapi.types.business_connection.BusinessLocation
import dev.inmo.tgbotapi.types.business_connection.BusinessOpeningHours
@@ -51,13 +52,16 @@ sealed interface ExtendedChannelChat : ChannelChat, ExtendedPublicChat, Extended
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@Serializable(ExtendedChatSerializer.Companion::class)
sealed interface ExtendedGroupChat : GroupChat, ExtendedPublicChat {
sealed interface ExtendedGroupChat : GroupChat, ExtendedPublicChat, WithOptionalPaidMessageStarCount {
val permissions: ChatPermissions
}
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@Serializable(ExtendedChatSerializer.Companion::class)
sealed interface ExtendedPrivateChat : PrivateUserChat, ExtendedChatWithUsername, ExtendedNonBotChat {
sealed interface ExtendedPrivateChat : PrivateUserChat,
ExtendedChatWithUsername,
ExtendedNonBotChat,
WithOptionalPaidMessageStarCount {
val bio: String
val hasPrivateForwards: Boolean
val hasRestrictedVoiceAndVideoMessages: Boolean
@@ -87,7 +91,6 @@ sealed interface ExtendedPublicChat : ExtendedChat, PublicChat, ExtendedNonBotCh
val availableReactions: List<Reaction>?
val newMembersSeeHistory: Boolean
val rating: UserRating?
val paidMessageStarCount: Int?
val uniqueGiftColors: UniqueGiftColors?
}