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:
parent
9f3cc6eafb
commit
d20b94e52c
@ -33,7 +33,7 @@ sealed interface UsernameChat : Chat {
|
||||
}
|
||||
|
||||
@Serializable(PreviewChatSerializer::class)
|
||||
sealed interface PremiumChat : Chat {
|
||||
sealed interface PossiblyPremiumChat : Chat {
|
||||
val isPremium: Boolean
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user