diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f0e0adf0eb..3cee62db55 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ ktor = "3.1.0" ksp = "2.1.10-1.0.29" kotlin-poet = "1.18.1" -microutils = "0.24.6" +microutils = "0.24.6-branch_0.24.6-build1367" kslog = "1.4.1" versions = "0.51.0" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 381b049e1c..7df1682327 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -267,6 +267,7 @@ const val inviteLinkField = "invite_link" const val viaChatFolderInviteLinkField = "via_chat_folder_invite_link" const val viaJoinRequestField = "via_join_request" const val pinnedMessageField = "pinned_message" +const val canSendGiftsField = "can_send_gift" const val canSendPaidMediaField = "can_send_paid_media" const val activeUsernamesField = "active_usernames" const val customTitleField = "custom_title" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt index 5dc0f90985..fe3e1e760e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt @@ -58,6 +58,8 @@ data class ExtendedChannelChatImpl( override val newMembersSeeHistory: Boolean = false, @SerialName(maxReactionCountField) override val maxReactionsCount: Int = 3, + @SerialName(canSendGiftsField) + override val canReceiveGifts: Boolean = false, ) : ExtendedChannelChat @Serializable @@ -98,6 +100,8 @@ data class ExtendedGroupChatImpl( override val newMembersSeeHistory: Boolean = false, @SerialName(maxReactionCountField) override val maxReactionsCount: Int = 3, + @SerialName(canSendGiftsField) + override val canReceiveGifts: Boolean = false, ) : ExtendedGroupChat @Serializable @@ -146,6 +150,8 @@ data class ExtendedPrivateChatImpl( override val personalChat: PreviewChannelChat? = null, @SerialName(maxReactionCountField) override val maxReactionsCount: Int = 3, + @SerialName(canSendGiftsField) + override val canReceiveGifts: Boolean = false, ) : ExtendedPrivateChat typealias ExtendedUser = ExtendedPrivateChatImpl @@ -212,6 +218,8 @@ data class ExtendedSupergroupChatImpl( override val customEmojiStickerSetName: StickerSetName? = null, @SerialName(maxReactionCountField) override val maxReactionsCount: Int = 3, + @SerialName(canSendGiftsField) + override val canReceiveGifts: Boolean = false, ) : ExtendedSupergroupChat @Serializable @@ -276,6 +284,8 @@ data class ExtendedForumChatImpl( override val customEmojiStickerSetName: StickerSetName? = null, @SerialName(maxReactionCountField) override val maxReactionsCount: Int = 3, + @SerialName(canSendGiftsField) + override val canReceiveGifts: Boolean = false, ) : ExtendedForumChat @Serializable @@ -309,7 +319,9 @@ data class ExtendedBot( @SerialName(maxReactionCountField) override val maxReactionsCount: Int = 3, @SerialName(hasMainWebAppField) - val hasMainWebApp: Boolean = false + val hasMainWebApp: Boolean = false, + @SerialName(canSendGiftsField) + override val canReceiveGifts: Boolean = false, ) : Bot(), ExtendedChat { @SerialName(isBotField) private val isBot = true @@ -339,4 +351,6 @@ data class UnknownExtendedChat( override val profileBackgroundCustomEmojiId: CustomEmojiId? = null @SerialName(maxReactionCountField) override val maxReactionsCount: Int = 3 + @SerialName(canSendGiftsField) + override val canReceiveGifts: Boolean = false } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt index a4048d92b1..a66675f745 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt @@ -19,6 +19,11 @@ sealed interface ExtendedChat : Chat { val backgroundCustomEmojiId: CustomEmojiId? val profileBackgroundCustomEmojiId: CustomEmojiId? val maxReactionsCount: Int + + /** + * Represent `can_send_gifts` field + */ + val canReceiveGifts: Boolean } @Serializable(ExtendedChatSerializer.Companion::class)