mirror of
				https://github.com/InsanusMokrassar/TelegramBotAPI.git
				synced 2025-10-31 04:01:55 +00:00 
			
		
		
		
	add support of can_send_gift
This commit is contained in:
		| @@ -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" | ||||
|   | ||||
| @@ -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" | ||||
|   | ||||
| @@ -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 | ||||
| } | ||||
|   | ||||
| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user