CommonUser#addedToAttachmentMenu

This commit is contained in:
InsanusMokrassar 2022-06-21 17:52:16 +06:00
parent 04db76831f
commit 8dfaca7648
4 changed files with 11 additions and 2 deletions

View File

@ -4,6 +4,7 @@
* Add support of functionality for `WebApp`s from [Bot API 6.1](https://core.telegram.org/bots/api-changelog#june-20-2022)
* Add support of functionality for premium feature from [Bot API 6.1](https://core.telegram.org/bots/api-changelog#june-20-2022)
* Add support of `addedToAttachmentMenu` in `CommonUser` from [Bot API 6.1](https://core.telegram.org/bots/api-changelog#june-20-2022)
## 2.0.3

View File

@ -117,6 +117,7 @@ const val isBotField = "is_bot"
const val firstNameField = "first_name"
const val lastNameField = "last_name"
const val languageCodeField = "language_code"
const val addedToAttachmentMenuField = "added_to_attachment_menu"
const val isPremiumField = "is_premium"
const val hasPrivateForwardsField = "has_private_forwards"
const val canJoinGroupsField = "can_join_groups"

View File

@ -37,6 +37,11 @@ sealed interface PremiumChat : Chat {
val isPremium: Boolean
}
@Serializable(PreviewChatSerializer::class)
sealed interface AbleToAddInAttachmentMenuChat : Chat {
val addedToAttachmentMenu: Boolean
}
@Serializable(PreviewChatSerializer::class)
sealed interface Chat {
val id: ChatId

View File

@ -82,8 +82,10 @@ data class CommonUser(
@Serializable(IetfLanguageCodeSerializer::class)
override val ietfLanguageCode: IetfLanguageCode? = null,
@SerialName(isPremiumField)
override val isPremium: Boolean = false
) : User(), WithOptionalLanguageCode, PremiumChat {
override val isPremium: Boolean = false,
@SerialName(addedToAttachmentMenuField)
override val addedToAttachmentMenu: Boolean = false
) : User(), WithOptionalLanguageCode, PremiumChat, AbleToAddInAttachmentMenuChat {
constructor(
id: UserId,
firstName: String,