1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 16:23:48 +00:00

rename PremiumChat -> PossiblyPremiumChat

This commit is contained in:
InsanusMokrassar 2022-06-21 23:06:36 +06:00
parent 9f3cc6eafb
commit d20b94e52c
3 changed files with 5 additions and 5 deletions

View File

@ -33,7 +33,7 @@ sealed interface UsernameChat : Chat {
} }
@Serializable(PreviewChatSerializer::class) @Serializable(PreviewChatSerializer::class)
sealed interface PremiumChat : Chat { sealed interface PossiblyPremiumChat : Chat {
val isPremium: Boolean val isPremium: Boolean
} }

View File

@ -85,7 +85,7 @@ data class CommonUser(
override val isPremium: Boolean = false, override val isPremium: Boolean = false,
@SerialName(addedToAttachmentMenuField) @SerialName(addedToAttachmentMenuField)
override val addedToAttachmentMenu: Boolean = false override val addedToAttachmentMenu: Boolean = false
) : User(), WithOptionalLanguageCode, PremiumChat, AbleToAddInAttachmentMenuChat { ) : User(), WithOptionalLanguageCode, PossiblyPremiumChat, AbleToAddInAttachmentMenuChat {
constructor( constructor(
id: UserId, id: UserId,
firstName: String, firstName: String,

View File

@ -237,13 +237,13 @@ inline fun Chat.asExtendedSupergroupChat(): ExtendedSupergroupChat? = this as? E
inline fun Chat.requireExtendedSupergroupChat(): ExtendedSupergroupChat = this as ExtendedSupergroupChat inline fun Chat.requireExtendedSupergroupChat(): ExtendedSupergroupChat = this as ExtendedSupergroupChat
@PreviewFeature @PreviewFeature
inline fun <T> Chat.whenPremiumChat(block: (PremiumChat) -> T) = asPremiumChat() ?.let(block) inline fun <T> Chat.whenPossiblyPremiumChat(block: (PossiblyPremiumChat) -> T) = asPossiblyPremiumChat() ?.let(block)
@PreviewFeature @PreviewFeature
inline fun Chat.asPremiumChat(): PremiumChat? = this as? PremiumChat inline fun Chat.asPossiblyPremiumChat(): PossiblyPremiumChat? = this as? PossiblyPremiumChat
@PreviewFeature @PreviewFeature
inline fun Chat.requirePremiumChat(): PremiumChat = this as PremiumChat inline fun Chat.requirePossiblyPremiumChat(): PossiblyPremiumChat = this as PossiblyPremiumChat
@PreviewFeature @PreviewFeature
inline fun <T> Chat.whenAbleToAddInAttachmentMenuChat(block: (AbleToAddInAttachmentMenuChat) -> T) = asAbleToAddInAttachmentMenuChat() ?.let(block) inline fun <T> Chat.whenAbleToAddInAttachmentMenuChat(block: (AbleToAddInAttachmentMenuChat) -> T) = asAbleToAddInAttachmentMenuChat() ?.let(block)