1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-25 19:48:43 +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)
sealed interface PremiumChat : Chat {
sealed interface PossiblyPremiumChat : Chat {
val isPremium: Boolean
}

View File

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

View File

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