From c9be5041b855615ca322fd8910aa949cb46db8ff Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 20 Feb 2026 17:49:16 +0600 Subject: [PATCH] check new fields and other things related to api updates in gifts --- CHANGELOG.md | 1 + .../api/business/GetBusinessAccountGifts.kt | 6 +- .../extensions/api/gifts/GetChatGifts.kt | 6 +- .../extensions/api/gifts/GetUserGifts.kt | 6 +- .../expectations/WaitEventAction.kt | 7 +- .../expectations/WaitEventActionMessages.kt | 6 +- .../triggers_handling/EventTriggers.kt | 23 +- tgbotapi.core/api/tgbotapi.core.api | 174 ++--- .../GetBusinessAccountGifts.kt | 8 +- .../tgbotapi/requests/gifts/GetChatGifts.kt | 8 +- .../tgbotapi/requests/gifts/GetUserGifts.kt | 8 +- .../dev/inmo/tgbotapi/types/OwnedGifts.kt | 4 +- .../dev/inmo/tgbotapi/types/gifts/Gift.kt | 4 +- ...Received.kt => GiftSentOrReceivedEvent.kt} | 60 +- .../inmo/tgbotapi/types/message/RawMessage.kt | 8 +- tgbotapi.utils/api/tgbotapi.utils.api | 48 +- .../extensions/utils/ClassCastsNew.kt | 630 ++++++++++++++++++ 17 files changed, 824 insertions(+), 183 deletions(-) rename tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/{GiftSentOrReceived.kt => GiftSentOrReceivedEvent.kt} (91%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30300a093f..2d294b5889 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * `Core`: * **THIS IS BREAKING CHANGE** All media files with sizes changed type of `fileSize` field from `Long` to `FileSize` (value class) + * **THIS IS BREAKING CHANGE** Class `GiftSentOrReceived` have been renamed to `GiftSentOrReceivedEvent` to clarify naming * **THIS IS BREAKING CHANGE** For `CheclistTask` have been made several changes: * `ChecklistTask.Done` -> `ChecklistTask.Completed` * `ChecklistTask.Undone` -> `ChecklistTask.Uncompleted` diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/business/GetBusinessAccountGifts.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/business/GetBusinessAccountGifts.kt index 067e559d61..c28efca43e 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/business/GetBusinessAccountGifts.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/business/GetBusinessAccountGifts.kt @@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.business_connection.GetBusinessAccountGifts import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.OwnedGifts -import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived +import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow import kotlin.runCatching @@ -21,7 +21,7 @@ public suspend fun TelegramBot.getBusinessAccountGifts( sortByPrice: Boolean = false, offset: String? = null, limit: Int? = null -): OwnedGifts = execute( +): OwnedGifts = execute( GetBusinessAccountGifts( businessConnectionId, excludeUnsaved, @@ -71,7 +71,7 @@ public fun TelegramBot.getBusinessAccountGiftsFlow( initialOffset: String? = null, limit: Int? = null, onErrorContinueChecker: suspend (Throwable?) -> Boolean = { false } -): Flow> = flow { +): Flow> = flow { var currentOffset = initialOffset do { val response = runCatching { diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/gifts/GetChatGifts.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/gifts/GetChatGifts.kt index dc1189bbb7..4020bd53a5 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/gifts/GetChatGifts.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/gifts/GetChatGifts.kt @@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.gifts.GetChatGifts import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.OwnedGifts -import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived +import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow @@ -20,7 +20,7 @@ public suspend fun TelegramBot.getChatGifts( sortByPrice: Boolean = false, offset: String? = null, limit: Int? = null -): OwnedGifts = execute( +): OwnedGifts = execute( GetChatGifts( chatId, excludeUnsaved, @@ -49,7 +49,7 @@ public fun TelegramBot.getChatGiftsFlow( initialOffset: String? = null, limit: Int? = null, onErrorContinueChecker: suspend (Throwable?) -> Boolean = { false } -): Flow> = flow { +): Flow> = flow { var currentOffset = initialOffset do { val response = runCatching { diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/gifts/GetUserGifts.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/gifts/GetUserGifts.kt index 14a420ecba..05f6e46336 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/gifts/GetUserGifts.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/gifts/GetUserGifts.kt @@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.gifts.GetUserGifts import dev.inmo.tgbotapi.types.OwnedGifts import dev.inmo.tgbotapi.types.UserId -import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived +import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow @@ -18,7 +18,7 @@ public suspend fun TelegramBot.getUserGifts( sortByPrice: Boolean = false, offset: String? = null, limit: Int? = null -): OwnedGifts = execute( +): OwnedGifts = execute( GetUserGifts( userId, excludeUnlimited, @@ -43,7 +43,7 @@ public fun TelegramBot.getUserGiftsFlow( initialOffset: String? = null, limit: Int? = null, onErrorContinueChecker: suspend (Throwable?) -> Boolean = { false } -): Flow> = flow { +): Flow> = flow { var currentOffset = initialOffset do { val response = runCatching { diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt index 316c2be7b7..0ac34061fd 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventAction.kt @@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.chat.ChatBackground import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone -import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived +import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults import dev.inmo.tgbotapi.types.message.ChatEvents.* @@ -25,7 +25,6 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined -import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostInfo import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded import dev.inmo.tgbotapi.types.message.ChatEvents.voice.* @@ -277,12 +276,12 @@ fun BehaviourContext.waitPaidMessagePriceChanged( fun BehaviourContext.waitRegularGiftSentOrReceived( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } -) = waitEvents(initRequest, errorFactory) +) = waitEvents(initRequest, errorFactory) fun BehaviourContext.waitUniqueGiftSentOrReceived( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } -) = waitEvents(initRequest, errorFactory) +) = waitEvents(initRequest, errorFactory) fun BehaviourContext.waitChecklistTasksDone( initRequest: Request<*>? = null, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventActionMessages.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventActionMessages.kt index 32bd015ba5..61464cefe7 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventActionMessages.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEventActionMessages.kt @@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.chat.ChatBackground -import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived +import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent import dev.inmo.tgbotapi.types.message.ChatEvents.* import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed @@ -245,9 +245,9 @@ fun BehaviourContext.waitPaidMessagePriceChangedMessages( fun BehaviourContext.waitRegularGiftSentOrReceivedMessages( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } -) = waitEventsMessages(initRequest, errorFactory) +) = waitEventsMessages(initRequest, errorFactory) fun BehaviourContext.waitUniqueGiftSentOrReceivedMessages( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } -) = waitEventsMessages(initRequest, errorFactory) +) = waitEventsMessages(initRequest, errorFactory) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt index ef8370127a..5f6b1dfe29 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt @@ -15,7 +15,7 @@ import dev.inmo.tgbotapi.types.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.chat.ChatBackground import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone -import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived +import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults import dev.inmo.tgbotapi.types.message.ChannelEventMessage @@ -31,7 +31,6 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined -import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostInfo import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded import dev.inmo.tgbotapi.types.message.ChatEvents.voice.* @@ -1182,11 +1181,11 @@ fun BC.onPaidMessagePriceChanged( * data */ fun BC.onRegularGiftSentOrReceived( - initialFilter: SimpleFilter>? = null, - subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, - additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver>? = null, - scenarioReceiver: CustomBehaviourContextAndTypeReceiver> + initialFilter: SimpleFilter>? = null, + subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, + additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver>? = null, + scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) @@ -1204,11 +1203,11 @@ fun BC.onRegularGiftSentOrReceived( * data */ fun BC.onUniqueGiftSentOrReceived( - initialFilter: SimpleFilter>? = null, - subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, - additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver>? = null, - scenarioReceiver: CustomBehaviourContextAndTypeReceiver> + initialFilter: SimpleFilter>? = null, + subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, + additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver>? = null, + scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 83ea9faa6f..d65680d25b 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -21682,6 +21682,7 @@ public abstract interface class dev/inmo/tgbotapi/types/gifts/Gift { public static final field Companion Ldev/inmo/tgbotapi/types/gifts/Gift$Companion; public abstract fun getId-FhTg01o ()Ljava/lang/String; public abstract fun getPublisherChat ()Ldev/inmo/tgbotapi/types/chat/PreviewChat; + public abstract fun isPremium ()Z } public final class dev/inmo/tgbotapi/types/gifts/Gift$Companion : kotlinx/serialization/KSerializer { @@ -21706,7 +21707,6 @@ public abstract interface class dev/inmo/tgbotapi/types/gifts/Gift$Regular : dev public abstract fun getTotalCount ()Ljava/lang/Integer; public abstract fun getUniqueGiftVariantCount ()Ljava/lang/Integer; public abstract fun getUpgradeStarCount ()Ljava/lang/Integer; - public abstract fun isPremium ()Z } public final class dev/inmo/tgbotapi/types/gifts/Gift$Regular$Companion : kotlinx/serialization/KSerializer { @@ -21853,7 +21853,7 @@ public final class dev/inmo/tgbotapi/types/gifts/Gift$Unique : dev/inmo/tgbotapi public fun hashCode ()I public final fun isBurned ()Z public final fun isFromBlockchain ()Z - public final fun isPremium ()Z + public fun isPremium ()Z public fun toString ()Ljava/lang/String; } @@ -21903,28 +21903,28 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftBackground$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived : dev/inmo/tgbotapi/types/message/ChatEvents/abstracts/CommonEvent { - public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Companion; +public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent : dev/inmo/tgbotapi/types/message/ChatEvents/abstracts/CommonEvent { + public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$Companion; public abstract fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift; public abstract fun getNextTransferDate ()Ldev/inmo/tgbotapi/types/TelegramDate; public abstract fun getOwnedGiftId-FhTg01o ()Ljava/lang/String; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Companion { +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$ReceivedInBusinessAccount : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived { - public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$ReceivedInBusinessAccount$Companion; +public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$ReceivedInBusinessAccount : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent { + public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$ReceivedInBusinessAccount$Companion; public abstract fun getOwnedGiftId-OyCYJok ()Ljava/lang/String; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$ReceivedInBusinessAccount$Companion { +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$ReceivedInBusinessAccount$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular : dev/inmo/tgbotapi/abstracts/TextedInput, dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived { - public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Companion; +public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift : dev/inmo/tgbotapi/abstracts/TextedInput, dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent { + public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Companion; public abstract fun getCanBeUpgraded ()Z public abstract fun getConvertStarCount ()Ljava/lang/Integer; public abstract fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift$Regular; @@ -21934,8 +21934,8 @@ public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived public abstract fun isUpgradeSeparate ()Z } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular { - public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common$Companion; +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Common : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift { + public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Common$Companion; public fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZZLjava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)V public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZZLjava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/gifts/Gift$Regular; @@ -21947,8 +21947,8 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Comm public final fun component7 ()Z public final fun component8 ()Z public final fun component9 ()Ljava/lang/Integer; - public final fun copy (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZZLjava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common; - public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common;Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZZLjava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common; + public final fun copy (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZZLjava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Common; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Common;Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZZLjava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Common; public fun equals (Ljava/lang/Object;)Z public fun getCanBeUpgraded ()Z public fun getConvertStarCount ()Ljava/lang/Integer; @@ -21966,34 +21966,34 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Comm public fun toString ()Ljava/lang/String; } -public final synthetic class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common$$serializer; +public final synthetic class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Common$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Common$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Common; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Common;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common$Companion { +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Common$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Companion : kotlinx/serialization/KSerializer { - public final fun PublicConstructor (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;IZZLjava/lang/Integer;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular; - public static synthetic fun PublicConstructor$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Companion;Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;IZZLjava/lang/Integer;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular; +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Companion : kotlinx/serialization/KSerializer { + public final fun PublicConstructor (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;IZZLjava/lang/Integer;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift; + public static synthetic fun PublicConstructor$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Companion;Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;IZZLjava/lang/Integer;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular;)V + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$ReceivedInBusinessAccount, dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular { - public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount$Companion; +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$ReceivedInBusinessAccount : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$ReceivedInBusinessAccount, dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift { + public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$ReceivedInBusinessAccount$Companion; public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZZLjava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZZLjava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/gifts/Gift$Regular; @@ -22006,8 +22006,8 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Rece public final fun component6 ()Ljava/lang/String; public final fun component8 ()Z public final fun component9 ()Z - public final fun copy-1Bd2j3Y (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZZLjava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount; - public static synthetic fun copy-1Bd2j3Y$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount;Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZZLjava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount; + public final fun copy-1Bd2j3Y (Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZZLjava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$ReceivedInBusinessAccount; + public static synthetic fun copy-1Bd2j3Y$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$ReceivedInBusinessAccount;Ldev/inmo/tgbotapi/types/gifts/Gift$Regular;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;ZLjava/lang/String;Ljava/util/List;ZZLjava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$ReceivedInBusinessAccount; public fun equals (Ljava/lang/Object;)Z public fun getCanBeUpgraded ()Z public fun getConvertStarCount ()Ljava/lang/Integer; @@ -22026,47 +22026,47 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Rece public fun toString ()Ljava/lang/String; } -public final synthetic class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount$$serializer; +public final synthetic class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$ReceivedInBusinessAccount$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$ReceivedInBusinessAccount$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$ReceivedInBusinessAccount; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$ReceivedInBusinessAccount;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount$Companion { +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$ReceivedInBusinessAccount$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived { - public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Companion; +public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent { + public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Companion; public abstract fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift$Unique; public abstract fun getLastResaleAmount ()Ljava/lang/Long; public abstract fun getLastResaleCurrency ()Ljava/lang/String; public abstract fun getLastResaleStarCount ()Ljava/lang/Integer; public abstract fun getOrigin ()Ljava/lang/String; - public abstract fun getOriginTyped ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; + public abstract fun getOriginTyped ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin; public abstract fun getTransferStarCount ()Ljava/lang/Integer; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique { - public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common$Companion; - public fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)V - public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Common : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift { + public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Common$Companion; + public fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)V public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/gifts/Gift$Unique; - public final fun component2 ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; + public final fun component2 ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin; public final fun component3 ()Ljava/lang/Integer; public final fun component4 ()Ljava/lang/String; public final fun component5 ()Ljava/lang/Long; public final fun component6 ()Ljava/lang/Integer; public final fun component7 ()Ldev/inmo/tgbotapi/types/TelegramDate; - public final fun copy (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common; - public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common;Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common; + public final fun copy (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Common; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Common;Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Common; public fun equals (Ljava/lang/Object;)Z public fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift$Unique; public synthetic fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift; @@ -22075,56 +22075,56 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Commo public fun getLastResaleStarCount ()Ljava/lang/Integer; public fun getNextTransferDate ()Ldev/inmo/tgbotapi/types/TelegramDate; public fun getOrigin ()Ljava/lang/String; - public fun getOriginTyped ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; + public fun getOriginTyped ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin; public fun getOwnedGiftId-FhTg01o ()Ljava/lang/String; public fun getTransferStarCount ()Ljava/lang/Integer; public fun hashCode ()I public fun toString ()Ljava/lang/String; } -public final synthetic class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common$$serializer; +public final synthetic class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Common$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Common$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Common; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Common;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common$Companion { +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Common$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Companion : kotlinx/serialization/KSerializer { - public final fun PublicConstructor (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique; - public static synthetic fun PublicConstructor$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Companion;Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique; - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique; +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Companion : kotlinx/serialization/KSerializer { + public final fun PublicConstructor (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift; + public static synthetic fun PublicConstructor$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Companion;Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique;)V + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin { - public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Companion; +public abstract interface class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin { + public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Companion; public abstract fun getString ()Ljava/lang/String; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Companion : kotlinx/serialization/KSerializer { - public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Companion : kotlinx/serialization/KSerializer { + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun fromString (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; + public final fun fromString (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin; public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;)V + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$GiftedUpgrade : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin { - public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$GiftedUpgrade; +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$GiftedUpgrade : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$GiftedUpgrade; public fun equals (Ljava/lang/Object;)Z public fun getString ()Ljava/lang/String; public fun hashCode ()I @@ -22132,8 +22132,8 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origi public fun toString ()Ljava/lang/String; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Offer : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin { - public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Offer; +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Offer : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Offer; public fun equals (Ljava/lang/Object;)Z public fun getString ()Ljava/lang/String; public fun hashCode ()I @@ -22141,8 +22141,8 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origi public fun toString ()Ljava/lang/String; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Resale : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin { - public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Resale; +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Resale : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Resale; public fun equals (Ljava/lang/Object;)Z public fun getString ()Ljava/lang/String; public fun hashCode ()I @@ -22150,8 +22150,8 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origi public fun toString ()Ljava/lang/String; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Transfer : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin { - public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Transfer; +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Transfer : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Transfer; public fun equals (Ljava/lang/Object;)Z public fun getString ()Ljava/lang/String; public fun hashCode ()I @@ -22159,9 +22159,9 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origi public fun toString ()Ljava/lang/String; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Unknown : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin { - public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Unknown$Companion; - public static final synthetic fun box-impl (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Unknown; +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Unknown : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin { + public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Unknown$Companion; + public static final synthetic fun box-impl (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Unknown; public static fun constructor-impl (Ljava/lang/String;)Ljava/lang/String; public fun equals (Ljava/lang/Object;)Z public static fun equals-impl (Ljava/lang/String;Ljava/lang/Object;)Z @@ -22174,12 +22174,12 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origi public final synthetic fun unbox-impl ()Ljava/lang/String; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Unknown$Companion { +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Unknown$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Upgrade : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin { - public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin$Upgrade; +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Upgrade : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin$Upgrade; public fun equals (Ljava/lang/Object;)Z public fun getString ()Ljava/lang/String; public fun hashCode ()I @@ -22187,22 +22187,22 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origi public fun toString ()Ljava/lang/String; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$ReceivedInBusinessAccount, dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique { - public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount$Companion; - public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/jvm/internal/DefaultConstructorMarker;)V +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$ReceivedInBusinessAccount : dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$ReceivedInBusinessAccount, dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift { + public static final field Companion Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$ReceivedInBusinessAccount$Companion; + public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public synthetic fun (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/gifts/Gift$Unique; public final fun component2-OyCYJok ()Ljava/lang/String; - public final fun component3 ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; + public final fun component3 ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin; public final fun component4 ()Ljava/lang/Integer; public final fun component5 ()Ljava/lang/String; public final fun component6 ()Ljava/lang/Long; public final fun component7 ()Ljava/lang/Integer; public final fun component8 ()Ldev/inmo/tgbotapi/types/TelegramDate; - public final fun copy-xVLKMpc (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount; - public static synthetic fun copy-xVLKMpc$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount;Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount; + public final fun copy-xVLKMpc (Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$ReceivedInBusinessAccount; + public static synthetic fun copy-xVLKMpc$default (Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$ReceivedInBusinessAccount;Ldev/inmo/tgbotapi/types/gifts/Gift$Unique;Ljava/lang/String;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$ReceivedInBusinessAccount; public fun equals (Ljava/lang/Object;)Z public fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift$Unique; public synthetic fun getGift ()Ldev/inmo/tgbotapi/types/gifts/Gift; @@ -22211,7 +22211,7 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Recei public fun getLastResaleStarCount ()Ljava/lang/Integer; public fun getNextTransferDate ()Ldev/inmo/tgbotapi/types/TelegramDate; public fun getOrigin ()Ljava/lang/String; - public fun getOriginTyped ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Origin; + public fun getOriginTyped ()Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Origin; public synthetic fun getOwnedGiftId-FhTg01o ()Ljava/lang/String; public fun getOwnedGiftId-OyCYJok ()Ljava/lang/String; public fun getTransferStarCount ()Ljava/lang/Integer; @@ -22219,18 +22219,18 @@ public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Recei public fun toString ()Ljava/lang/String; } -public final synthetic class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount$$serializer; +public final synthetic class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$ReceivedInBusinessAccount$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$ReceivedInBusinessAccount$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$ReceivedInBusinessAccount; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$ReceivedInBusinessAccount;)V public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount$Companion { +public final class dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$ReceivedInBusinessAccount$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/business_connection/GetBusinessAccountGifts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/business_connection/GetBusinessAccountGifts.kt index 3766f78b14..31961b650c 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/business_connection/GetBusinessAccountGifts.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/business_connection/GetBusinessAccountGifts.kt @@ -15,7 +15,7 @@ import dev.inmo.tgbotapi.types.excludeFromBlockchainField import dev.inmo.tgbotapi.types.sortByPriceField import dev.inmo.tgbotapi.types.offsetField import dev.inmo.tgbotapi.types.limitField -import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived +import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent import kotlinx.serialization.DeserializationStrategy import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -45,16 +45,16 @@ data class GetBusinessAccountGifts( val offset: String? = null, @SerialName(limitField) val limit: Int? = null, -) : BusinessRequest.Simple> { +) : BusinessRequest.Simple> { override fun method(): String = "getBusinessAccountGifts" - override val resultDeserializer: DeserializationStrategy> + override val resultDeserializer: DeserializationStrategy> get() = Companion.resultSerializer override val requestSerializer: SerializationStrategy<*> get() = serializer() companion object { @Warning("This API can be changed without any warranties of backward compatibility") - val resultSerializer = OwnedGifts.serializer(GiftSentOrReceived.ReceivedInBusinessAccount.serializer()) + val resultSerializer = OwnedGifts.serializer(GiftSentOrReceivedEvent.ReceivedInBusinessAccount.serializer()) } } \ No newline at end of file diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/gifts/GetChatGifts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/gifts/GetChatGifts.kt index 334e0221a1..d9759d7752 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/gifts/GetChatGifts.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/gifts/GetChatGifts.kt @@ -14,7 +14,7 @@ import dev.inmo.tgbotapi.types.excludeLimitedNonUpgradableField import dev.inmo.tgbotapi.types.excludeFromBlockchainField import dev.inmo.tgbotapi.types.excludeUniqueField import dev.inmo.tgbotapi.types.sortByPriceField -import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived +import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent import dev.inmo.tgbotapi.types.limitField import dev.inmo.tgbotapi.types.offsetField import kotlinx.serialization.DeserializationStrategy @@ -46,16 +46,16 @@ data class GetChatGifts( val offset: String? = null, @SerialName(limitField) val limit: Int? = null, -) : SimpleRequest>, ChatRequest { +) : SimpleRequest>, ChatRequest { override fun method(): String = "getChatGifts" - override val resultDeserializer: DeserializationStrategy> + override val resultDeserializer: DeserializationStrategy> get() = Companion.resultSerializer override val requestSerializer: SerializationStrategy<*> get() = serializer() companion object { @Warning("This API can be changed without any warranties of backward compatibility") - val resultSerializer = OwnedGifts.serializer(GiftSentOrReceived.serializer()) + val resultSerializer = OwnedGifts.serializer(GiftSentOrReceivedEvent.serializer()) } } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/gifts/GetUserGifts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/gifts/GetUserGifts.kt index 45dc2437e8..8a6edcdda7 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/gifts/GetUserGifts.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/gifts/GetUserGifts.kt @@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.types.excludeLimitedNonUpgradableField import dev.inmo.tgbotapi.types.excludeFromBlockchainField import dev.inmo.tgbotapi.types.excludeUniqueField import dev.inmo.tgbotapi.types.sortByPriceField -import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived +import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent import dev.inmo.tgbotapi.types.limitField import dev.inmo.tgbotapi.types.offsetField import dev.inmo.tgbotapi.types.userIdField @@ -40,16 +40,16 @@ data class GetUserGifts( val offset: String? = null, @SerialName(limitField) val limit: Int? = null, -) : SimpleRequest> { +) : SimpleRequest> { override fun method(): String = "getUserGifts" - override val resultDeserializer: DeserializationStrategy> + override val resultDeserializer: DeserializationStrategy> get() = Companion.resultSerializer override val requestSerializer: SerializationStrategy<*> get() = serializer() companion object { @Warning("This API can be changed without any warranties of backward compatibility") - val resultSerializer = OwnedGifts.serializer(GiftSentOrReceived.serializer()) + val resultSerializer = OwnedGifts.serializer(GiftSentOrReceivedEvent.serializer()) } } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/OwnedGifts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/OwnedGifts.kt index cd92271476..3be69f833b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/OwnedGifts.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/OwnedGifts.kt @@ -1,11 +1,11 @@ package dev.inmo.tgbotapi.types -import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived +import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable -data class OwnedGifts( +data class OwnedGifts( @SerialName(totalCountField) val totalCount: Int, @SerialName(giftsField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/Gift.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/Gift.kt index 89952de8fe..a7dda5eaa9 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/Gift.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/Gift.kt @@ -18,6 +18,7 @@ import kotlinx.serialization.encoding.Encoder sealed interface Gift { val id: GiftId? val publisherChat: PreviewChat? + val isPremium: Boolean @Serializable(Regular.Companion::class) sealed interface Regular : Gift { override val id: GiftId @@ -28,7 +29,6 @@ sealed interface Gift { val remainingCount: Int? val personalTotalCount: Int? val personalRemainingCount: Int? - val isPremium: Boolean val hasColors: Boolean val background: GiftBackground? val uniqueGiftVariantCount: Int? @@ -199,7 +199,7 @@ sealed interface Gift { @SerialName(backdropField) val backdrop: UniqueGiftBackdrop, @SerialName(isPremiumField) - val isPremium: Boolean = false, + override val isPremium: Boolean = false, @SerialName(isBurnedField) val isBurned: Boolean = false, @SerialName(isFromBlockchainField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent.kt similarity index 91% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent.kt index 0ec3ce7944..b52b990a2a 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/GiftSentOrReceived.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent.kt @@ -2,7 +2,6 @@ package dev.inmo.tgbotapi.types.gifts import dev.inmo.tgbotapi.abstracts.TextedInput import dev.inmo.tgbotapi.types.* -import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived.Unique.Common import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent import dev.inmo.tgbotapi.types.message.RawMessageEntities import dev.inmo.tgbotapi.types.message.asTextSources @@ -10,8 +9,6 @@ import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.toRawMessageEntities import dev.inmo.tgbotapi.types.payments.abstracts.Currency -import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded -import kotlinx.serialization.EncodeDefault import kotlinx.serialization.KSerializer import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -25,28 +22,34 @@ import kotlin.jvm.JvmName /** - * Represent Telegram Bots API abstraction [OwnedGiftUnique](https://core.telegram.org/bots/api#giftinfo) and + * Represent Telegram Bots API abstraction [GiftInfo](https://core.telegram.org/bots/api#giftinfo) and * [UniqueGiftInfo](https://core.telegram.org/bots/api#uniquegiftinfo) * * @see ReceivedInBusinessAccount - * @see Regular.Common - * @see Regular.ReceivedInBusinessAccount - * @see Unique.Common - * @see Unique.ReceivedInBusinessAccount + * @see RegularGift.Common + * @see RegularGift.ReceivedInBusinessAccount + * @see UniqueGift.Common + * @see UniqueGift.ReceivedInBusinessAccount */ @Serializable -sealed interface GiftSentOrReceived : CommonEvent { +sealed interface GiftSentOrReceivedEvent : CommonEvent { val ownedGiftId: GiftId? val gift: Gift val nextTransferDate: TelegramDate? @Serializable - sealed interface ReceivedInBusinessAccount : GiftSentOrReceived { + sealed interface ReceivedInBusinessAccount : GiftSentOrReceivedEvent { override val ownedGiftId: GiftId } - @Serializable(Regular.Companion::class) - sealed interface Regular : GiftSentOrReceived, TextedInput { + /** + * Represent the hierarchy of [GiftInfo](https://core.telegram.org/bots/api#giftinfo). + * + * * For `GiftInfo` **with** `owned_gift_id` see [RegularGift.ReceivedInBusinessAccount] + * * For all other kinds see [RegularGift.Common] + */ + @Serializable(RegularGift.Companion::class) + sealed interface RegularGift : GiftSentOrReceivedEvent, TextedInput { override val gift: Gift.Regular val convertStarCount: Int? val prepaidUpgradeStarCount: Int? @@ -77,7 +80,7 @@ sealed interface GiftSentOrReceived : CommonEvent { override val uniqueGiftNumber: Int? = null, @SerialName(nextTransferDateField) override val nextTransferDate: TelegramDate? = null - ) : Regular { + ) : RegularGift { override val textSources: List by lazy { entities ?.asTextSources(text ?: return@lazy emptyList()) ?: emptyList() } @@ -109,13 +112,13 @@ sealed interface GiftSentOrReceived : CommonEvent { override val uniqueGiftNumber: Int? = null, @SerialName(nextTransferDateField) override val nextTransferDate: TelegramDate? = null - ) : Regular, GiftSentOrReceived.ReceivedInBusinessAccount { + ) : RegularGift, GiftSentOrReceivedEvent.ReceivedInBusinessAccount { override val textSources: List by lazy { entities ?.asTextSources(text ?: return@lazy emptyList()) ?: emptyList() } } - companion object : KSerializer { + companion object : KSerializer { @Serializable private data class Surrogate( @SerialName(giftField) @@ -145,14 +148,14 @@ sealed interface GiftSentOrReceived : CommonEvent { override val descriptor: SerialDescriptor get() = Surrogate.serializer().descriptor - override fun serialize(encoder: Encoder, value: Regular) { + override fun serialize(encoder: Encoder, value: RegularGift) { when (value) { is Common -> Common.serializer().serialize(encoder, value) is ReceivedInBusinessAccount -> ReceivedInBusinessAccount.serializer().serialize(encoder, value) } } - override fun deserialize(decoder: Decoder): Regular { + override fun deserialize(decoder: Decoder): RegularGift { val surrogate = Surrogate.serializer().deserialize(decoder) return when { @@ -227,8 +230,14 @@ sealed interface GiftSentOrReceived : CommonEvent { } } - @Serializable(Unique.Companion::class) - sealed interface Unique : GiftSentOrReceived { + /** + * Represent the hierarchy of [UniqueGiftInfo](https://core.telegram.org/bots/api#uniquegiftinfo). + * + * * For `UniqueGiftInfo` **with** `owned_gift_id` see [UniqueGift.ReceivedInBusinessAccount] + * * For all other kinds see [UniqueGift.Common] + */ + @Serializable(UniqueGift.Companion::class) + sealed interface UniqueGift : GiftSentOrReceivedEvent { override val gift: Gift.Unique val origin: String? val originTyped: Origin? @@ -299,7 +308,7 @@ sealed interface GiftSentOrReceived : CommonEvent { override val transferStarCount: Int? = null, @SerialName(nextTransferDateField) override val nextTransferDate: TelegramDate? = null - ) : Unique { + ) : UniqueGift { override val ownedGiftId: GiftId? get() = null @@ -344,7 +353,7 @@ sealed interface GiftSentOrReceived : CommonEvent { override val transferStarCount: Int? = null, @SerialName(nextTransferDateField) override val nextTransferDate: TelegramDate? = null - ) : Unique, GiftSentOrReceived.ReceivedInBusinessAccount { + ) : UniqueGift, GiftSentOrReceivedEvent.ReceivedInBusinessAccount { @Transient override val origin: String? = originTyped ?.string @@ -369,7 +378,7 @@ sealed interface GiftSentOrReceived : CommonEvent { ) } - companion object : KSerializer { + companion object : KSerializer { @Serializable private data class Surrogate( @SerialName(giftField) @@ -393,14 +402,14 @@ sealed interface GiftSentOrReceived : CommonEvent { override val descriptor: SerialDescriptor get() = Surrogate.serializer().descriptor - override fun serialize(encoder: Encoder, value: Unique) { + override fun serialize(encoder: Encoder, value: UniqueGift) { when (value) { is Common -> Common.serializer().serialize(encoder, value) is ReceivedInBusinessAccount -> ReceivedInBusinessAccount.serializer().serialize(encoder, value) } } - override fun deserialize(decoder: Decoder): Unique { + override fun deserialize(decoder: Decoder): UniqueGift { val surrogate = Surrogate.serializer().deserialize(decoder) return when { @@ -450,3 +459,6 @@ sealed interface GiftSentOrReceived : CommonEvent { } } } + +@Deprecated("Renamed to GiftSentOrReceivedEvent", ReplaceWith("GiftSentOrReceivedEvent", "dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent")) +typealias GiftSentOrReceived = GiftSentOrReceivedEvent diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt index dfba3e0c91..e7100a9dbc 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt @@ -14,7 +14,7 @@ import dev.inmo.tgbotapi.types.dice.Dice import dev.inmo.tgbotapi.types.files.* import dev.inmo.tgbotapi.types.files.Sticker import dev.inmo.tgbotapi.types.games.RawGame -import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceived +import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent import dev.inmo.tgbotapi.types.giveaway.* import dev.inmo.tgbotapi.types.message.content.GiveawayContent import dev.inmo.tgbotapi.types.location.Location @@ -199,9 +199,9 @@ internal data class RawMessage( private val suggested_post_refunded: SuggestedPostRefunded? = null, private val suggested_post_info: SuggestedPostInfo? = null, // Gifts - private val gift: GiftSentOrReceived.Regular? = null, - private val unique_gift: GiftSentOrReceived.Unique? = null, - private val gift_upgrade_sent: GiftSentOrReceived? = null, + private val gift: GiftSentOrReceivedEvent.RegularGift? = null, + private val unique_gift: GiftSentOrReceivedEvent.UniqueGift? = null, + private val gift_upgrade_sent: GiftSentOrReceivedEvent.RegularGift? = null, private val chat_owner_left: ChatOwnerLeft? = null, private val chat_owner_changed: ChatOwnerChanged? = null, ) { diff --git a/tgbotapi.utils/api/tgbotapi.utils.api b/tgbotapi.utils/api/tgbotapi.utils.api index 85b6bd2b60..32490811ee 100644 --- a/tgbotapi.utils/api/tgbotapi.utils.api +++ b/tgbotapi.utils/api/tgbotapi.utils.api @@ -1513,22 +1513,22 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun generalForumTopicUnhiddenOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/forum/GeneralForumTopicUnhidden; public static final fun giftCodeOrNull (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;)Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$GiftCode; public static final fun giftCodeOrThrow (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;)Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$GiftCode; - public static final fun giftSentOrReceivedOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived; - public static final fun giftSentOrReceivedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived; - public static final fun giftSentOrReceivedReceivedInBusinessAccountOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$ReceivedInBusinessAccount; - public static final fun giftSentOrReceivedReceivedInBusinessAccountOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$ReceivedInBusinessAccount; - public static final fun giftSentOrReceivedRegularCommonOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common; - public static final fun giftSentOrReceivedRegularCommonOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$Common; - public static final fun giftSentOrReceivedRegularOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular; - public static final fun giftSentOrReceivedRegularOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular; - public static final fun giftSentOrReceivedRegularReceivedInBusinessAccountOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount; - public static final fun giftSentOrReceivedRegularReceivedInBusinessAccountOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Regular$ReceivedInBusinessAccount; - public static final fun giftSentOrReceivedUniqueCommonOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common; - public static final fun giftSentOrReceivedUniqueCommonOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$Common; - public static final fun giftSentOrReceivedUniqueOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique; - public static final fun giftSentOrReceivedUniqueOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique; - public static final fun giftSentOrReceivedUniqueReceivedInBusinessAccountOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount; - public static final fun giftSentOrReceivedUniqueReceivedInBusinessAccountOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceived$Unique$ReceivedInBusinessAccount; + public static final fun giftSentOrReceivedEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent; + public static final fun giftSentOrReceivedEventOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent; + public static final fun giftSentOrReceivedEventReceivedInBusinessAccountOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$ReceivedInBusinessAccount; + public static final fun giftSentOrReceivedEventReceivedInBusinessAccountOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$ReceivedInBusinessAccount; + public static final fun giftSentOrReceivedEventRegularGiftCommonOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Common; + public static final fun giftSentOrReceivedEventRegularGiftCommonOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$Common; + public static final fun giftSentOrReceivedEventRegularGiftOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift; + public static final fun giftSentOrReceivedEventRegularGiftOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift; + public static final fun giftSentOrReceivedEventRegularGiftReceivedInBusinessAccountOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$ReceivedInBusinessAccount; + public static final fun giftSentOrReceivedEventRegularGiftReceivedInBusinessAccountOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$RegularGift$ReceivedInBusinessAccount; + public static final fun giftSentOrReceivedEventUniqueGiftCommonOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Common; + public static final fun giftSentOrReceivedEventUniqueGiftCommonOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$Common; + public static final fun giftSentOrReceivedEventUniqueGiftOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift; + public static final fun giftSentOrReceivedEventUniqueGiftOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift; + public static final fun giftSentOrReceivedEventUniqueGiftReceivedInBusinessAccountOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$ReceivedInBusinessAccount; + public static final fun giftSentOrReceivedEventUniqueGiftReceivedInBusinessAccountOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent$UniqueGift$ReceivedInBusinessAccount; public static final fun giveawayClaimedOrNull (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;)Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway$Claimed; public static final fun giveawayClaimedOrThrow (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;)Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway$Claimed; public static final fun giveawayContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/GiveawayContent; @@ -1798,14 +1798,14 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifGeneralForumTopicHidden (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifGeneralForumTopicUnhidden (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifGiftCode (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifGiftSentOrReceived (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifGiftSentOrReceivedReceivedInBusinessAccount (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifGiftSentOrReceivedRegular (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifGiftSentOrReceivedRegularCommon (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifGiftSentOrReceivedRegularReceivedInBusinessAccount (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifGiftSentOrReceivedUnique (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifGiftSentOrReceivedUniqueCommon (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifGiftSentOrReceivedUniqueReceivedInBusinessAccount (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifGiftSentOrReceivedEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifGiftSentOrReceivedEventReceivedInBusinessAccount (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifGiftSentOrReceivedEventRegularGift (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifGiftSentOrReceivedEventRegularGiftCommon (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifGiftSentOrReceivedEventRegularGiftReceivedInBusinessAccount (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifGiftSentOrReceivedEventUniqueGift (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifGiftSentOrReceivedEventUniqueGiftCommon (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifGiftSentOrReceivedEventUniqueGiftReceivedInBusinessAccount (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifGiveaway (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifGiveawayClaimed (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifGiveawayContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt index 77c001681d..49b4af8b4b 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt @@ -29,6 +29,7 @@ import dev.inmo.tgbotapi.types.ChatInviteLink import dev.inmo.tgbotapi.types.ChatInviteLinkUnlimited import dev.inmo.tgbotapi.types.ChatInviteLinkWithJoinRequest import dev.inmo.tgbotapi.types.ChatInviteLinkWithLimitedMembers +import dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged import dev.inmo.tgbotapi.types.IdChatIdentifier import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult @@ -81,6 +82,7 @@ import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessa import dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery import dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery +import dev.inmo.tgbotapi.types.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.PrimaryInviteLink import dev.inmo.tgbotapi.types.ReplyInfo import dev.inmo.tgbotapi.types.SecondaryChatInviteLink @@ -124,6 +126,7 @@ import dev.inmo.tgbotapi.types.chat.BusinessChat import dev.inmo.tgbotapi.types.chat.ChannelChat import dev.inmo.tgbotapi.types.chat.ChannelDirectMessagesChat import dev.inmo.tgbotapi.types.chat.Chat +import dev.inmo.tgbotapi.types.chat.ChatBackground import dev.inmo.tgbotapi.types.chat.ChatJoinRequest import dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated import dev.inmo.tgbotapi.types.chat.CommonBot @@ -181,6 +184,8 @@ import dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember import dev.inmo.tgbotapi.types.chat.member.RestrictedMemberChatMember import dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember import dev.inmo.tgbotapi.types.chat.member.SubscriptionMemberChatMember +import dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded +import dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone import dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType import dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType import dev.inmo.tgbotapi.types.dice.CubeDiceAnimationType @@ -225,6 +230,9 @@ import dev.inmo.tgbotapi.types.files.VideoNoteFile import dev.inmo.tgbotapi.types.files.VideoQuality import dev.inmo.tgbotapi.types.files.VideoSticker import dev.inmo.tgbotapi.types.files.VoiceFile +import dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent +import dev.inmo.tgbotapi.types.giveaway.GiveawayCreated +import dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults import dev.inmo.tgbotapi.types.location.LiveLocation import dev.inmo.tgbotapi.types.location.Location import dev.inmo.tgbotapi.types.location.StaticLocation @@ -252,14 +260,50 @@ import dev.inmo.tgbotapi.types.media.VisualTelegramPaidMedia import dev.inmo.tgbotapi.types.media.WithCustomStartTelegramMedia import dev.inmo.tgbotapi.types.media.WithCustomizableCaptionTelegramMedia import dev.inmo.tgbotapi.types.message.ChannelEventMessage +import dev.inmo.tgbotapi.types.message.ChatEvents.ChannelChatCreated +import dev.inmo.tgbotapi.types.message.ChatEvents.ChatBoostAdded +import dev.inmo.tgbotapi.types.message.ChatEvents.ChatOwnerChanged +import dev.inmo.tgbotapi.types.message.ChatEvents.ChatOwnerLeft +import dev.inmo.tgbotapi.types.message.ChatEvents.DeleteChatPhoto +import dev.inmo.tgbotapi.types.message.ChatEvents.GroupChatCreated import dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent +import dev.inmo.tgbotapi.types.message.ChatEvents.MessageAutoDeleteTimerChanged +import dev.inmo.tgbotapi.types.message.ChatEvents.MigratedToSupergroup +import dev.inmo.tgbotapi.types.message.ChatEvents.NewChatMembers +import dev.inmo.tgbotapi.types.message.ChatEvents.NewChatPhoto +import dev.inmo.tgbotapi.types.message.ChatEvents.NewChatTitle +import dev.inmo.tgbotapi.types.message.ChatEvents.PinnedMessage +import dev.inmo.tgbotapi.types.message.ChatEvents.ProximityAlertTriggered +import dev.inmo.tgbotapi.types.message.ChatEvents.SupergroupChatCreated +import dev.inmo.tgbotapi.types.message.ChatEvents.UserLoggedIn +import dev.inmo.tgbotapi.types.message.ChatEvents.WebAppData import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelEvent import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChatEvent +import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent +import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ForumEvent import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.GroupEvent import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateEvent import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateForumEvent +import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PublicChatEvent import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.SupergroupEvent +import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.VideoChatEvent +import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed +import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicCreated +import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicEdited +import dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened +import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden +import dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden +import dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed +import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed +import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved +import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined +import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid +import dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded +import dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatEnded +import dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatParticipantsInvited +import dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatScheduled +import dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatStarted import dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage import dev.inmo.tgbotapi.types.message.CommonGroupEventMessage import dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage @@ -350,6 +394,8 @@ import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent import dev.inmo.tgbotapi.types.message.content.VoiceContent import dev.inmo.tgbotapi.types.message.content.WithCustomizedCaptionMediaContent import dev.inmo.tgbotapi.types.message.payments.PaidMediaPurchased +import dev.inmo.tgbotapi.types.message.payments.RefundedPaymentEvent +import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent import dev.inmo.tgbotapi.types.message.textsources.BlockquoteTextSource import dev.inmo.tgbotapi.types.message.textsources.BoldTextSource import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource @@ -387,6 +433,26 @@ import dev.inmo.tgbotapi.types.passport.PassportElementFilesError import dev.inmo.tgbotapi.types.passport.PassportMultipleElementsError import dev.inmo.tgbotapi.types.passport.PassportSingleElementError import dev.inmo.tgbotapi.types.passport.UnknownPassportElementError +import dev.inmo.tgbotapi.types.passport.decrypted.AddressSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.BankStatementSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.CommonPassportSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.DriverLicenseSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.IdentityCardSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.IdentityWithReverseSideSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.InternalPassportSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.OtherDocumentsSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.PassportRegistrationSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.PassportSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.PersonalDetailsSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.RentalAgreementSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.TemporalRegistrationSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.UtilityBillSecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValue +import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueIdentity +import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithData +import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithFiles +import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithReverseSide +import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithTranslations import dev.inmo.tgbotapi.types.passport.encrypted.BankStatement import dev.inmo.tgbotapi.types.passport.encrypted.CommonPassport import dev.inmo.tgbotapi.types.passport.encrypted.DriverLicense @@ -2277,6 +2343,456 @@ public inline fun ForwardInfo.fromSupergroupOrThrow(): ForwardInfo.PublicChat.Fr public inline fun ForwardInfo.ifFromSupergroup(block: (ForwardInfo.PublicChat.FromSupergroup) -> T): T? = fromSupergroupOrNull() ?.let(block) +public inline fun ChatEvent.chatSharedOrNull(): ChatShared? = this as? dev.inmo.tgbotapi.types.request.ChatShared + +public inline fun ChatEvent.chatSharedOrThrow(): ChatShared = this as dev.inmo.tgbotapi.types.request.ChatShared + +public inline fun ChatEvent.ifChatShared(block: (ChatShared) -> T): T? = chatSharedOrNull() ?.let(block) + +public inline fun ChatEvent.usersSharedOrNull(): UsersShared? = this as? dev.inmo.tgbotapi.types.request.UsersShared + +public inline fun ChatEvent.usersSharedOrThrow(): UsersShared = this as dev.inmo.tgbotapi.types.request.UsersShared + +public inline fun ChatEvent.ifUsersShared(block: (UsersShared) -> T): T? = usersSharedOrNull() ?.let(block) + +public inline fun ChatEvent.chatSharedRequestOrNull(): ChatSharedRequest? = this as? dev.inmo.tgbotapi.types.request.ChatSharedRequest + +public inline fun ChatEvent.chatSharedRequestOrThrow(): ChatSharedRequest = this as dev.inmo.tgbotapi.types.request.ChatSharedRequest + +public inline fun ChatEvent.ifChatSharedRequest(block: (ChatSharedRequest) -> T): T? = chatSharedRequestOrNull() ?.let(block) + +public inline fun ChatEvent.chatBackgroundOrNull(): ChatBackground? = this as? dev.inmo.tgbotapi.types.chat.ChatBackground + +public inline fun ChatEvent.chatBackgroundOrThrow(): ChatBackground = this as dev.inmo.tgbotapi.types.chat.ChatBackground + +public inline fun ChatEvent.ifChatBackground(block: (ChatBackground) -> T): T? = chatBackgroundOrNull() ?.let(block) + +public inline fun ChatEvent.checklistTasksAddedOrNull(): ChecklistTasksAdded? = this as? dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded + +public inline fun ChatEvent.checklistTasksAddedOrThrow(): ChecklistTasksAdded = this as dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded + +public inline fun ChatEvent.ifChecklistTasksAdded(block: (ChecklistTasksAdded) -> T): T? = checklistTasksAddedOrNull() ?.let(block) + +public inline fun ChatEvent.checklistTasksDoneOrNull(): ChecklistTasksDone? = this as? dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone + +public inline fun ChatEvent.checklistTasksDoneOrThrow(): ChecklistTasksDone = this as dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone + +public inline fun ChatEvent.ifChecklistTasksDone(block: (ChecklistTasksDone) -> T): T? = checklistTasksDoneOrNull() ?.let(block) + +public inline fun ChatEvent.paidMessagePriceChangedOrNull(): PaidMessagePriceChanged? = this as? dev.inmo.tgbotapi.types.PaidMessagePriceChanged + +public inline fun ChatEvent.paidMessagePriceChangedOrThrow(): PaidMessagePriceChanged = this as dev.inmo.tgbotapi.types.PaidMessagePriceChanged + +public inline fun ChatEvent.ifPaidMessagePriceChanged(block: (PaidMessagePriceChanged) -> T): T? = paidMessagePriceChangedOrNull() ?.let(block) + +public inline fun ChatEvent.giftSentOrReceivedEventOrNull(): GiftSentOrReceivedEvent? = this as? dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent + +public inline fun ChatEvent.giftSentOrReceivedEventOrThrow(): GiftSentOrReceivedEvent = this as dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent + +public inline fun ChatEvent.ifGiftSentOrReceivedEvent(block: (GiftSentOrReceivedEvent) -> T): T? = giftSentOrReceivedEventOrNull() ?.let(block) + +public inline fun ChatEvent.giftSentOrReceivedEventReceivedInBusinessAccountOrNull(): GiftSentOrReceivedEvent.ReceivedInBusinessAccount? = this as? dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.ReceivedInBusinessAccount + +public inline fun ChatEvent.giftSentOrReceivedEventReceivedInBusinessAccountOrThrow(): GiftSentOrReceivedEvent.ReceivedInBusinessAccount = this as dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.ReceivedInBusinessAccount + +public inline fun ChatEvent.ifGiftSentOrReceivedEventReceivedInBusinessAccount(block: (GiftSentOrReceivedEvent.ReceivedInBusinessAccount) -> T): T? = giftSentOrReceivedEventReceivedInBusinessAccountOrNull() ?.let(block) + +public inline fun ChatEvent.giftSentOrReceivedEventRegularGiftOrNull(): GiftSentOrReceivedEvent.RegularGift? = this as? dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.RegularGift + +public inline fun ChatEvent.giftSentOrReceivedEventRegularGiftOrThrow(): GiftSentOrReceivedEvent.RegularGift = this as dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.RegularGift + +public inline fun ChatEvent.ifGiftSentOrReceivedEventRegularGift(block: (GiftSentOrReceivedEvent.RegularGift) -> T): T? = giftSentOrReceivedEventRegularGiftOrNull() ?.let(block) + +public inline fun ChatEvent.giftSentOrReceivedEventUniqueGiftOrNull(): GiftSentOrReceivedEvent.UniqueGift? = this as? dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.UniqueGift + +public inline fun ChatEvent.giftSentOrReceivedEventUniqueGiftOrThrow(): GiftSentOrReceivedEvent.UniqueGift = this as dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.UniqueGift + +public inline fun ChatEvent.ifGiftSentOrReceivedEventUniqueGift(block: (GiftSentOrReceivedEvent.UniqueGift) -> T): T? = giftSentOrReceivedEventUniqueGiftOrNull() ?.let(block) + +public inline fun ChatEvent.giftSentOrReceivedEventRegularGiftCommonOrNull(): GiftSentOrReceivedEvent.RegularGift.Common? = this as? dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.RegularGift.Common + +public inline fun ChatEvent.giftSentOrReceivedEventRegularGiftCommonOrThrow(): GiftSentOrReceivedEvent.RegularGift.Common = this as dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.RegularGift.Common + +public inline fun ChatEvent.ifGiftSentOrReceivedEventRegularGiftCommon(block: (GiftSentOrReceivedEvent.RegularGift.Common) -> T): T? = giftSentOrReceivedEventRegularGiftCommonOrNull() ?.let(block) + +public inline fun ChatEvent.giftSentOrReceivedEventRegularGiftReceivedInBusinessAccountOrNull(): GiftSentOrReceivedEvent.RegularGift.ReceivedInBusinessAccount? = this as? dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.RegularGift.ReceivedInBusinessAccount + +public inline fun ChatEvent.giftSentOrReceivedEventRegularGiftReceivedInBusinessAccountOrThrow(): GiftSentOrReceivedEvent.RegularGift.ReceivedInBusinessAccount = this as dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.RegularGift.ReceivedInBusinessAccount + +public inline fun ChatEvent.ifGiftSentOrReceivedEventRegularGiftReceivedInBusinessAccount(block: (GiftSentOrReceivedEvent.RegularGift.ReceivedInBusinessAccount) -> T): T? = giftSentOrReceivedEventRegularGiftReceivedInBusinessAccountOrNull() ?.let(block) + +public inline fun ChatEvent.giftSentOrReceivedEventUniqueGiftCommonOrNull(): GiftSentOrReceivedEvent.UniqueGift.Common? = this as? dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.UniqueGift.Common + +public inline fun ChatEvent.giftSentOrReceivedEventUniqueGiftCommonOrThrow(): GiftSentOrReceivedEvent.UniqueGift.Common = this as dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.UniqueGift.Common + +public inline fun ChatEvent.ifGiftSentOrReceivedEventUniqueGiftCommon(block: (GiftSentOrReceivedEvent.UniqueGift.Common) -> T): T? = giftSentOrReceivedEventUniqueGiftCommonOrNull() ?.let(block) + +public inline fun ChatEvent.giftSentOrReceivedEventUniqueGiftReceivedInBusinessAccountOrNull(): GiftSentOrReceivedEvent.UniqueGift.ReceivedInBusinessAccount? = this as? dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.UniqueGift.ReceivedInBusinessAccount + +public inline fun ChatEvent.giftSentOrReceivedEventUniqueGiftReceivedInBusinessAccountOrThrow(): GiftSentOrReceivedEvent.UniqueGift.ReceivedInBusinessAccount = this as dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent.UniqueGift.ReceivedInBusinessAccount + +public inline fun ChatEvent.ifGiftSentOrReceivedEventUniqueGiftReceivedInBusinessAccount(block: (GiftSentOrReceivedEvent.UniqueGift.ReceivedInBusinessAccount) -> T): T? = giftSentOrReceivedEventUniqueGiftReceivedInBusinessAccountOrNull() ?.let(block) + +public inline fun ChatEvent.successfulPaymentEventOrNull(): SuccessfulPaymentEvent? = this as? dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent + +public inline fun ChatEvent.successfulPaymentEventOrThrow(): SuccessfulPaymentEvent = this as dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent + +public inline fun ChatEvent.ifSuccessfulPaymentEvent(block: (SuccessfulPaymentEvent) -> T): T? = successfulPaymentEventOrNull() ?.let(block) + +public inline fun ChatEvent.refundedPaymentEventOrNull(): RefundedPaymentEvent? = this as? dev.inmo.tgbotapi.types.message.payments.RefundedPaymentEvent + +public inline fun ChatEvent.refundedPaymentEventOrThrow(): RefundedPaymentEvent = this as dev.inmo.tgbotapi.types.message.payments.RefundedPaymentEvent + +public inline fun ChatEvent.ifRefundedPaymentEvent(block: (RefundedPaymentEvent) -> T): T? = refundedPaymentEventOrNull() ?.let(block) + +public inline fun ChatEvent.suggestedPostApprovedOrNull(): SuggestedPostApproved? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved + +public inline fun ChatEvent.suggestedPostApprovedOrThrow(): SuggestedPostApproved = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved + +public inline fun ChatEvent.ifSuggestedPostApproved(block: (SuggestedPostApproved) -> T): T? = suggestedPostApprovedOrNull() ?.let(block) + +public inline fun ChatEvent.suggestedPostApprovalFailedOrNull(): SuggestedPostApprovalFailed? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed + +public inline fun ChatEvent.suggestedPostApprovalFailedOrThrow(): SuggestedPostApprovalFailed = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed + +public inline fun ChatEvent.ifSuggestedPostApprovalFailed(block: (SuggestedPostApprovalFailed) -> T): T? = suggestedPostApprovalFailedOrNull() ?.let(block) + +public inline fun ChatEvent.suggestedPostDeclinedOrNull(): SuggestedPostDeclined? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined + +public inline fun ChatEvent.suggestedPostDeclinedOrThrow(): SuggestedPostDeclined = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined + +public inline fun ChatEvent.ifSuggestedPostDeclined(block: (SuggestedPostDeclined) -> T): T? = suggestedPostDeclinedOrNull() ?.let(block) + +public inline fun ChatEvent.suggestedPostPaidOrNull(): SuggestedPostPaid? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid + +public inline fun ChatEvent.suggestedPostPaidOrThrow(): SuggestedPostPaid = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid + +public inline fun ChatEvent.ifSuggestedPostPaid(block: (SuggestedPostPaid) -> T): T? = suggestedPostPaidOrNull() ?.let(block) + +public inline fun ChatEvent.suggestedPostPaidXTROrNull(): SuggestedPostPaid.XTR? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid.XTR + +public inline fun ChatEvent.suggestedPostPaidXTROrThrow(): SuggestedPostPaid.XTR = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid.XTR + +public inline fun ChatEvent.ifSuggestedPostPaidXTR(block: (SuggestedPostPaid.XTR) -> T): T? = suggestedPostPaidXTROrNull() ?.let(block) + +public inline fun ChatEvent.suggestedPostPaidTONOrNull(): SuggestedPostPaid.TON? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid.TON + +public inline fun ChatEvent.suggestedPostPaidTONOrThrow(): SuggestedPostPaid.TON = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid.TON + +public inline fun ChatEvent.ifSuggestedPostPaidTON(block: (SuggestedPostPaid.TON) -> T): T? = suggestedPostPaidTONOrNull() ?.let(block) + +public inline fun ChatEvent.suggestedPostPaidOtherOrNull(): SuggestedPostPaid.Other? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid.Other + +public inline fun ChatEvent.suggestedPostPaidOtherOrThrow(): SuggestedPostPaid.Other = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid.Other + +public inline fun ChatEvent.ifSuggestedPostPaidOther(block: (SuggestedPostPaid.Other) -> T): T? = suggestedPostPaidOtherOrNull() ?.let(block) + +public inline fun ChatEvent.suggestedPostRefundedOrNull(): SuggestedPostRefunded? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded + +public inline fun ChatEvent.suggestedPostRefundedOrThrow(): SuggestedPostRefunded = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded + +public inline fun ChatEvent.ifSuggestedPostRefunded(block: (SuggestedPostRefunded) -> T): T? = suggestedPostRefundedOrNull() ?.let(block) + +public inline fun ChatEvent.forumEventOrNull(): ForumEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ForumEvent + +public inline fun ChatEvent.forumEventOrThrow(): ForumEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ForumEvent + +public inline fun ChatEvent.ifForumEvent(block: (ForumEvent) -> T): T? = forumEventOrNull() ?.let(block) + +public inline fun ChatEvent.privateEventOrNull(): PrivateEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateEvent + +public inline fun ChatEvent.privateEventOrThrow(): PrivateEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateEvent + +public inline fun ChatEvent.ifPrivateEvent(block: (PrivateEvent) -> T): T? = privateEventOrNull() ?.let(block) + +public inline fun ChatEvent.videoChatEventOrNull(): VideoChatEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.VideoChatEvent + +public inline fun ChatEvent.videoChatEventOrThrow(): VideoChatEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.VideoChatEvent + +public inline fun ChatEvent.ifVideoChatEvent(block: (VideoChatEvent) -> T): T? = videoChatEventOrNull() ?.let(block) + +public inline fun ChatEvent.publicChatEventOrNull(): PublicChatEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PublicChatEvent + +public inline fun ChatEvent.publicChatEventOrThrow(): PublicChatEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PublicChatEvent + +public inline fun ChatEvent.ifPublicChatEvent(block: (PublicChatEvent) -> T): T? = publicChatEventOrNull() ?.let(block) + +public inline fun ChatEvent.groupEventOrNull(): GroupEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.GroupEvent + +public inline fun ChatEvent.groupEventOrThrow(): GroupEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.GroupEvent + +public inline fun ChatEvent.ifGroupEvent(block: (GroupEvent) -> T): T? = groupEventOrNull() ?.let(block) + +public inline fun ChatEvent.privateForumEventOrNull(): PrivateForumEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateForumEvent + +public inline fun ChatEvent.privateForumEventOrThrow(): PrivateForumEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateForumEvent + +public inline fun ChatEvent.ifPrivateForumEvent(block: (PrivateForumEvent) -> T): T? = privateForumEventOrNull() ?.let(block) + +public inline fun ChatEvent.channelEventOrNull(): ChannelEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelEvent + +public inline fun ChatEvent.channelEventOrThrow(): ChannelEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelEvent + +public inline fun ChatEvent.ifChannelEvent(block: (ChannelEvent) -> T): T? = channelEventOrNull() ?.let(block) + +public inline fun ChatEvent.commonEventOrNull(): CommonEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent + +public inline fun ChatEvent.commonEventOrThrow(): CommonEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent + +public inline fun ChatEvent.ifCommonEvent(block: (CommonEvent) -> T): T? = commonEventOrNull() ?.let(block) + +public inline fun ChatEvent.channelDirectMessagesEventOrNull(): ChannelDirectMessagesEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent + +public inline fun ChatEvent.channelDirectMessagesEventOrThrow(): ChannelDirectMessagesEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent + +public inline fun ChatEvent.ifChannelDirectMessagesEvent(block: (ChannelDirectMessagesEvent) -> T): T? = channelDirectMessagesEventOrNull() ?.let(block) + +public inline fun ChatEvent.supergroupEventOrNull(): SupergroupEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.SupergroupEvent + +public inline fun ChatEvent.supergroupEventOrThrow(): SupergroupEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.SupergroupEvent + +public inline fun ChatEvent.ifSupergroupEvent(block: (SupergroupEvent) -> T): T? = supergroupEventOrNull() ?.let(block) + +public inline fun ChatEvent.chatOwnerLeftOrNull(): ChatOwnerLeft? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.ChatOwnerLeft + +public inline fun ChatEvent.chatOwnerLeftOrThrow(): ChatOwnerLeft = this as dev.inmo.tgbotapi.types.message.ChatEvents.ChatOwnerLeft + +public inline fun ChatEvent.ifChatOwnerLeft(block: (ChatOwnerLeft) -> T): T? = chatOwnerLeftOrNull() ?.let(block) + +public inline fun ChatEvent.groupChatCreatedOrNull(): GroupChatCreated? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.GroupChatCreated + +public inline fun ChatEvent.groupChatCreatedOrThrow(): GroupChatCreated = this as dev.inmo.tgbotapi.types.message.ChatEvents.GroupChatCreated + +public inline fun ChatEvent.ifGroupChatCreated(block: (GroupChatCreated) -> T): T? = groupChatCreatedOrNull() ?.let(block) + +public inline fun ChatEvent.chatBoostAddedOrNull(): ChatBoostAdded? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.ChatBoostAdded + +public inline fun ChatEvent.chatBoostAddedOrThrow(): ChatBoostAdded = this as dev.inmo.tgbotapi.types.message.ChatEvents.ChatBoostAdded + +public inline fun ChatEvent.ifChatBoostAdded(block: (ChatBoostAdded) -> T): T? = chatBoostAddedOrNull() ?.let(block) + +public inline fun ChatEvent.proximityAlertTriggeredOrNull(): ProximityAlertTriggered? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.ProximityAlertTriggered + +public inline fun ChatEvent.proximityAlertTriggeredOrThrow(): ProximityAlertTriggered = this as dev.inmo.tgbotapi.types.message.ChatEvents.ProximityAlertTriggered + +public inline fun ChatEvent.ifProximityAlertTriggered(block: (ProximityAlertTriggered) -> T): T? = proximityAlertTriggeredOrNull() ?.let(block) + +public inline fun ChatEvent.channelChatCreatedOrNull(): ChannelChatCreated? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.ChannelChatCreated + +public inline fun ChatEvent.channelChatCreatedOrThrow(): ChannelChatCreated = this as dev.inmo.tgbotapi.types.message.ChatEvents.ChannelChatCreated + +public inline fun ChatEvent.ifChannelChatCreated(block: (ChannelChatCreated) -> T): T? = channelChatCreatedOrNull() ?.let(block) + +public inline fun ChatEvent.newChatMembersOrNull(): NewChatMembers? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.NewChatMembers + +public inline fun ChatEvent.newChatMembersOrThrow(): NewChatMembers = this as dev.inmo.tgbotapi.types.message.ChatEvents.NewChatMembers + +public inline fun ChatEvent.ifNewChatMembers(block: (NewChatMembers) -> T): T? = newChatMembersOrNull() ?.let(block) + +public inline fun ChatEvent.migratedToSupergroupOrNull(): MigratedToSupergroup? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.MigratedToSupergroup + +public inline fun ChatEvent.migratedToSupergroupOrThrow(): MigratedToSupergroup = this as dev.inmo.tgbotapi.types.message.ChatEvents.MigratedToSupergroup + +public inline fun ChatEvent.ifMigratedToSupergroup(block: (MigratedToSupergroup) -> T): T? = migratedToSupergroupOrNull() ?.let(block) + +public inline fun ChatEvent.chatOwnerChangedOrNull(): ChatOwnerChanged? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.ChatOwnerChanged + +public inline fun ChatEvent.chatOwnerChangedOrThrow(): ChatOwnerChanged = this as dev.inmo.tgbotapi.types.message.ChatEvents.ChatOwnerChanged + +public inline fun ChatEvent.ifChatOwnerChanged(block: (ChatOwnerChanged) -> T): T? = chatOwnerChangedOrNull() ?.let(block) + +public inline fun ChatEvent.leftChatMemberEventOrNull(): LeftChatMemberEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent + +public inline fun ChatEvent.leftChatMemberEventOrThrow(): LeftChatMemberEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent + +public inline fun ChatEvent.ifLeftChatMemberEvent(block: (LeftChatMemberEvent) -> T): T? = leftChatMemberEventOrNull() ?.let(block) + +public inline fun ChatEvent.webAppDataOrNull(): WebAppData? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.WebAppData + +public inline fun ChatEvent.webAppDataOrThrow(): WebAppData = this as dev.inmo.tgbotapi.types.message.ChatEvents.WebAppData + +public inline fun ChatEvent.ifWebAppData(block: (WebAppData) -> T): T? = webAppDataOrNull() ?.let(block) + +public inline fun ChatEvent.writeAccessAllowedOrNull(): WriteAccessAllowed? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed + +public inline fun ChatEvent.writeAccessAllowedOrThrow(): WriteAccessAllowed = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed + +public inline fun ChatEvent.ifWriteAccessAllowed(block: (WriteAccessAllowed) -> T): T? = writeAccessAllowedOrNull() ?.let(block) + +public inline fun ChatEvent.writeAccessAllowedOtherOrNull(): WriteAccessAllowed.Other? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed.Other + +public inline fun ChatEvent.writeAccessAllowedOtherOrThrow(): WriteAccessAllowed.Other = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed.Other + +public inline fun ChatEvent.ifWriteAccessAllowedOther(block: (WriteAccessAllowed.Other) -> T): T? = writeAccessAllowedOtherOrNull() ?.let(block) + +public inline fun ChatEvent.writeAccessAllowedFromWebAppLinkOrNull(): WriteAccessAllowed.FromWebAppLink? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed.FromWebAppLink + +public inline fun ChatEvent.writeAccessAllowedFromWebAppLinkOrThrow(): WriteAccessAllowed.FromWebAppLink = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed.FromWebAppLink + +public inline fun ChatEvent.ifWriteAccessAllowedFromWebAppLink(block: (WriteAccessAllowed.FromWebAppLink) -> T): T? = writeAccessAllowedFromWebAppLinkOrNull() ?.let(block) + +public inline fun ChatEvent.writeAccessAllowedFromRequestOrNull(): WriteAccessAllowed.FromRequest? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed.FromRequest + +public inline fun ChatEvent.writeAccessAllowedFromRequestOrThrow(): WriteAccessAllowed.FromRequest = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed.FromRequest + +public inline fun ChatEvent.ifWriteAccessAllowedFromRequest(block: (WriteAccessAllowed.FromRequest) -> T): T? = writeAccessAllowedFromRequestOrNull() ?.let(block) + +public inline fun ChatEvent.writeAccessAllowedFromAttachmentMenuOrNull(): WriteAccessAllowed.FromAttachmentMenu? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed.FromAttachmentMenu + +public inline fun ChatEvent.writeAccessAllowedFromAttachmentMenuOrThrow(): WriteAccessAllowed.FromAttachmentMenu = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed.FromAttachmentMenu + +public inline fun ChatEvent.ifWriteAccessAllowedFromAttachmentMenu(block: (WriteAccessAllowed.FromAttachmentMenu) -> T): T? = writeAccessAllowedFromAttachmentMenuOrNull() ?.let(block) + +public inline fun ChatEvent.forumTopicCreatedOrNull(): ForumTopicCreated? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicCreated + +public inline fun ChatEvent.forumTopicCreatedOrThrow(): ForumTopicCreated = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicCreated + +public inline fun ChatEvent.ifForumTopicCreated(block: (ForumTopicCreated) -> T): T? = forumTopicCreatedOrNull() ?.let(block) + +public inline fun ChatEvent.forumTopicReopenedOrNull(): ForumTopicReopened? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened + +public inline fun ChatEvent.forumTopicReopenedOrThrow(): ForumTopicReopened = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened + +public inline fun ChatEvent.ifForumTopicReopened(block: (ForumTopicReopened) -> T): T? = forumTopicReopenedOrNull() ?.let(block) + +public inline fun ChatEvent.forumTopicClosedOrNull(): ForumTopicClosed? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed + +public inline fun ChatEvent.forumTopicClosedOrThrow(): ForumTopicClosed = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed + +public inline fun ChatEvent.ifForumTopicClosed(block: (ForumTopicClosed) -> T): T? = forumTopicClosedOrNull() ?.let(block) + +public inline fun ChatEvent.forumTopicEditedOrNull(): ForumTopicEdited? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicEdited + +public inline fun ChatEvent.forumTopicEditedOrThrow(): ForumTopicEdited = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicEdited + +public inline fun ChatEvent.ifForumTopicEdited(block: (ForumTopicEdited) -> T): T? = forumTopicEditedOrNull() ?.let(block) + +public inline fun ChatEvent.generalForumTopicHiddenOrNull(): GeneralForumTopicHidden? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden + +public inline fun ChatEvent.generalForumTopicHiddenOrThrow(): GeneralForumTopicHidden = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden + +public inline fun ChatEvent.ifGeneralForumTopicHidden(block: (GeneralForumTopicHidden) -> T): T? = generalForumTopicHiddenOrNull() ?.let(block) + +public inline fun ChatEvent.generalForumTopicUnhiddenOrNull(): GeneralForumTopicUnhidden? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden + +public inline fun ChatEvent.generalForumTopicUnhiddenOrThrow(): GeneralForumTopicUnhidden = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden + +public inline fun ChatEvent.ifGeneralForumTopicUnhidden(block: (GeneralForumTopicUnhidden) -> T): T? = generalForumTopicUnhiddenOrNull() ?.let(block) + +public inline fun ChatEvent.messageAutoDeleteTimerChangedOrNull(): MessageAutoDeleteTimerChanged? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.MessageAutoDeleteTimerChanged + +public inline fun ChatEvent.messageAutoDeleteTimerChangedOrThrow(): MessageAutoDeleteTimerChanged = this as dev.inmo.tgbotapi.types.message.ChatEvents.MessageAutoDeleteTimerChanged + +public inline fun ChatEvent.ifMessageAutoDeleteTimerChanged(block: (MessageAutoDeleteTimerChanged) -> T): T? = messageAutoDeleteTimerChangedOrNull() ?.let(block) + +public inline fun ChatEvent.pinnedMessageOrNull(): PinnedMessage? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.PinnedMessage + +public inline fun ChatEvent.pinnedMessageOrThrow(): PinnedMessage = this as dev.inmo.tgbotapi.types.message.ChatEvents.PinnedMessage + +public inline fun ChatEvent.ifPinnedMessage(block: (PinnedMessage) -> T): T? = pinnedMessageOrNull() ?.let(block) + +public inline fun ChatEvent.deleteChatPhotoOrNull(): DeleteChatPhoto? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.DeleteChatPhoto + +public inline fun ChatEvent.deleteChatPhotoOrThrow(): DeleteChatPhoto = this as dev.inmo.tgbotapi.types.message.ChatEvents.DeleteChatPhoto + +public inline fun ChatEvent.ifDeleteChatPhoto(block: (DeleteChatPhoto) -> T): T? = deleteChatPhotoOrNull() ?.let(block) + +public inline fun ChatEvent.videoChatStartedOrNull(): VideoChatStarted? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatStarted + +public inline fun ChatEvent.videoChatStartedOrThrow(): VideoChatStarted = this as dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatStarted + +public inline fun ChatEvent.ifVideoChatStarted(block: (VideoChatStarted) -> T): T? = videoChatStartedOrNull() ?.let(block) + +public inline fun ChatEvent.videoChatScheduledOrNull(): VideoChatScheduled? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatScheduled + +public inline fun ChatEvent.videoChatScheduledOrThrow(): VideoChatScheduled = this as dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatScheduled + +public inline fun ChatEvent.ifVideoChatScheduled(block: (VideoChatScheduled) -> T): T? = videoChatScheduledOrNull() ?.let(block) + +public inline fun ChatEvent.videoChatEndedOrNull(): VideoChatEnded? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatEnded + +public inline fun ChatEvent.videoChatEndedOrThrow(): VideoChatEnded = this as dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatEnded + +public inline fun ChatEvent.ifVideoChatEnded(block: (VideoChatEnded) -> T): T? = videoChatEndedOrNull() ?.let(block) + +public inline fun ChatEvent.videoChatParticipantsInvitedOrNull(): VideoChatParticipantsInvited? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatParticipantsInvited + +public inline fun ChatEvent.videoChatParticipantsInvitedOrThrow(): VideoChatParticipantsInvited = this as dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatParticipantsInvited + +public inline fun ChatEvent.ifVideoChatParticipantsInvited(block: (VideoChatParticipantsInvited) -> T): T? = videoChatParticipantsInvitedOrNull() ?.let(block) + +public inline fun ChatEvent.newChatTitleOrNull(): NewChatTitle? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.NewChatTitle + +public inline fun ChatEvent.newChatTitleOrThrow(): NewChatTitle = this as dev.inmo.tgbotapi.types.message.ChatEvents.NewChatTitle + +public inline fun ChatEvent.ifNewChatTitle(block: (NewChatTitle) -> T): T? = newChatTitleOrNull() ?.let(block) + +public inline fun ChatEvent.supergroupChatCreatedOrNull(): SupergroupChatCreated? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.SupergroupChatCreated + +public inline fun ChatEvent.supergroupChatCreatedOrThrow(): SupergroupChatCreated = this as dev.inmo.tgbotapi.types.message.ChatEvents.SupergroupChatCreated + +public inline fun ChatEvent.ifSupergroupChatCreated(block: (SupergroupChatCreated) -> T): T? = supergroupChatCreatedOrNull() ?.let(block) + +public inline fun ChatEvent.userLoggedInOrNull(): UserLoggedIn? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.UserLoggedIn + +public inline fun ChatEvent.userLoggedInOrThrow(): UserLoggedIn = this as dev.inmo.tgbotapi.types.message.ChatEvents.UserLoggedIn + +public inline fun ChatEvent.ifUserLoggedIn(block: (UserLoggedIn) -> T): T? = userLoggedInOrNull() ?.let(block) + +public inline fun ChatEvent.newChatPhotoOrNull(): NewChatPhoto? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.NewChatPhoto + +public inline fun ChatEvent.newChatPhotoOrThrow(): NewChatPhoto = this as dev.inmo.tgbotapi.types.message.ChatEvents.NewChatPhoto + +public inline fun ChatEvent.ifNewChatPhoto(block: (NewChatPhoto) -> T): T? = newChatPhotoOrNull() ?.let(block) + +public inline fun ChatEvent.giveawayPrivateResultsOrNull(): GiveawayPrivateResults? = this as? dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults + +public inline fun ChatEvent.giveawayPrivateResultsOrThrow(): GiveawayPrivateResults = this as dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults + +public inline fun ChatEvent.ifGiveawayPrivateResults(block: (GiveawayPrivateResults) -> T): T? = giveawayPrivateResultsOrNull() ?.let(block) + +public inline fun ChatEvent.giveawayCreatedOrNull(): GiveawayCreated? = this as? dev.inmo.tgbotapi.types.giveaway.GiveawayCreated + +public inline fun ChatEvent.giveawayCreatedOrThrow(): GiveawayCreated = this as dev.inmo.tgbotapi.types.giveaway.GiveawayCreated + +public inline fun ChatEvent.ifGiveawayCreated(block: (GiveawayCreated) -> T): T? = giveawayCreatedOrNull() ?.let(block) + +public inline fun ChatEvent.giveawayCreatedStarsOrNull(): GiveawayCreated.Stars? = this as? dev.inmo.tgbotapi.types.giveaway.GiveawayCreated.Stars + +public inline fun ChatEvent.giveawayCreatedStarsOrThrow(): GiveawayCreated.Stars = this as dev.inmo.tgbotapi.types.giveaway.GiveawayCreated.Stars + +public inline fun ChatEvent.ifGiveawayCreatedStars(block: (GiveawayCreated.Stars) -> T): T? = giveawayCreatedStarsOrNull() ?.let(block) + +public inline fun ChatEvent.giveawayCreatedCompanionOrNull(): GiveawayCreated.Companion? = this as? dev.inmo.tgbotapi.types.giveaway.GiveawayCreated.Companion + +public inline fun ChatEvent.giveawayCreatedCompanionOrThrow(): GiveawayCreated.Companion = this as dev.inmo.tgbotapi.types.giveaway.GiveawayCreated.Companion + +public inline fun ChatEvent.ifGiveawayCreatedCompanion(block: (GiveawayCreated.Companion) -> T): T? = giveawayCreatedCompanionOrNull() ?.let(block) + +public inline fun ChatEvent.directMessagesConfigurationChangedOrNull(): DirectMessagesConfigurationChanged? = this as? dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged + +public inline fun ChatEvent.directMessagesConfigurationChangedOrThrow(): DirectMessagesConfigurationChanged = this as dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged + +public inline fun ChatEvent.ifDirectMessagesConfigurationChanged(block: (DirectMessagesConfigurationChanged) -> T): T? = directMessagesConfigurationChangedOrNull() ?.let(block) + +public inline fun ChatEvent.directMessagesConfigurationChangedDisabledOrNull(): DirectMessagesConfigurationChanged.Disabled? = this as? dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Disabled + +public inline fun ChatEvent.directMessagesConfigurationChangedDisabledOrThrow(): DirectMessagesConfigurationChanged.Disabled = this as dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Disabled + +public inline fun ChatEvent.ifDirectMessagesConfigurationChangedDisabled(block: (DirectMessagesConfigurationChanged.Disabled) -> T): T? = directMessagesConfigurationChangedDisabledOrNull() ?.let(block) + +public inline fun ChatEvent.directMessagesConfigurationChangedFreeOrNull(): DirectMessagesConfigurationChanged.Free? = this as? dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Free + +public inline fun ChatEvent.directMessagesConfigurationChangedFreeOrThrow(): DirectMessagesConfigurationChanged.Free = this as dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Free + +public inline fun ChatEvent.ifDirectMessagesConfigurationChangedFree(block: (DirectMessagesConfigurationChanged.Free) -> T): T? = directMessagesConfigurationChangedFreeOrNull() ?.let(block) + +public inline fun ChatEvent.directMessagesConfigurationChangedPaidOrNull(): DirectMessagesConfigurationChanged.Paid? = this as? dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Paid + +public inline fun ChatEvent.directMessagesConfigurationChangedPaidOrThrow(): DirectMessagesConfigurationChanged.Paid = this as dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Paid + +public inline fun ChatEvent.ifDirectMessagesConfigurationChangedPaid(block: (DirectMessagesConfigurationChanged.Paid) -> T): T? = directMessagesConfigurationChangedPaidOrNull() ?.let(block) + public inline fun TextSource.mentionTextSourceOrNull(): MentionTextSource? = this as? dev.inmo.tgbotapi.types.message.textsources.MentionTextSource public inline fun TextSource.mentionTextSourceOrThrow(): MentionTextSource = this as dev.inmo.tgbotapi.types.message.textsources.MentionTextSource @@ -2655,6 +3171,120 @@ public inline fun ChatIdentifier.usernameOrThrow(): Username = this as dev.inmo. public inline fun ChatIdentifier.ifUsername(block: (Username) -> T): T? = usernameOrNull() ?.let(block) +public inline fun SecureValue.secureValueWithReverseSideOrNull(): SecureValueWithReverseSide? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithReverseSide + +public inline fun SecureValue.secureValueWithReverseSideOrThrow(): SecureValueWithReverseSide = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithReverseSide + +public inline fun SecureValue.ifSecureValueWithReverseSide(block: (SecureValueWithReverseSide) -> T): T? = secureValueWithReverseSideOrNull() ?.let(block) + +public inline fun SecureValue.secureValueWithDataOrNull(): SecureValueWithData? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithData + +public inline fun SecureValue.secureValueWithDataOrThrow(): SecureValueWithData = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithData + +public inline fun SecureValue.ifSecureValueWithData(block: (SecureValueWithData) -> T): T? = secureValueWithDataOrNull() ?.let(block) + +public inline fun SecureValue.secureValueIdentityOrNull(): SecureValueIdentity? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueIdentity + +public inline fun SecureValue.secureValueIdentityOrThrow(): SecureValueIdentity = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueIdentity + +public inline fun SecureValue.ifSecureValueIdentity(block: (SecureValueIdentity) -> T): T? = secureValueIdentityOrNull() ?.let(block) + +public inline fun SecureValue.secureValueWithTranslationsOrNull(): SecureValueWithTranslations? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithTranslations + +public inline fun SecureValue.secureValueWithTranslationsOrThrow(): SecureValueWithTranslations = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithTranslations + +public inline fun SecureValue.ifSecureValueWithTranslations(block: (SecureValueWithTranslations) -> T): T? = secureValueWithTranslationsOrNull() ?.let(block) + +public inline fun SecureValue.secureValueWithFilesOrNull(): SecureValueWithFiles? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithFiles + +public inline fun SecureValue.secureValueWithFilesOrThrow(): SecureValueWithFiles = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithFiles + +public inline fun SecureValue.ifSecureValueWithFiles(block: (SecureValueWithFiles) -> T): T? = secureValueWithFilesOrNull() ?.let(block) + +public inline fun SecureValue.personalDetailsSecureValueOrNull(): PersonalDetailsSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.PersonalDetailsSecureValue + +public inline fun SecureValue.personalDetailsSecureValueOrThrow(): PersonalDetailsSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.PersonalDetailsSecureValue + +public inline fun SecureValue.ifPersonalDetailsSecureValue(block: (PersonalDetailsSecureValue) -> T): T? = personalDetailsSecureValueOrNull() ?.let(block) + +public inline fun SecureValue.passportSecureValueOrNull(): PassportSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.PassportSecureValue + +public inline fun SecureValue.passportSecureValueOrThrow(): PassportSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.PassportSecureValue + +public inline fun SecureValue.ifPassportSecureValue(block: (PassportSecureValue) -> T): T? = passportSecureValueOrNull() ?.let(block) + +public inline fun SecureValue.commonPassportSecureValueOrNull(): CommonPassportSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.CommonPassportSecureValue + +public inline fun SecureValue.commonPassportSecureValueOrThrow(): CommonPassportSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.CommonPassportSecureValue + +public inline fun SecureValue.ifCommonPassportSecureValue(block: (CommonPassportSecureValue) -> T): T? = commonPassportSecureValueOrNull() ?.let(block) + +public inline fun SecureValue.internalPassportSecureValueOrNull(): InternalPassportSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.InternalPassportSecureValue + +public inline fun SecureValue.internalPassportSecureValueOrThrow(): InternalPassportSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.InternalPassportSecureValue + +public inline fun SecureValue.ifInternalPassportSecureValue(block: (InternalPassportSecureValue) -> T): T? = internalPassportSecureValueOrNull() ?.let(block) + +public inline fun SecureValue.otherDocumentsSecureValueOrNull(): OtherDocumentsSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.OtherDocumentsSecureValue + +public inline fun SecureValue.otherDocumentsSecureValueOrThrow(): OtherDocumentsSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.OtherDocumentsSecureValue + +public inline fun SecureValue.ifOtherDocumentsSecureValue(block: (OtherDocumentsSecureValue) -> T): T? = otherDocumentsSecureValueOrNull() ?.let(block) + +public inline fun SecureValue.utilityBillSecureValueOrNull(): UtilityBillSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.UtilityBillSecureValue + +public inline fun SecureValue.utilityBillSecureValueOrThrow(): UtilityBillSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.UtilityBillSecureValue + +public inline fun SecureValue.ifUtilityBillSecureValue(block: (UtilityBillSecureValue) -> T): T? = utilityBillSecureValueOrNull() ?.let(block) + +public inline fun SecureValue.bankStatementSecureValueOrNull(): BankStatementSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.BankStatementSecureValue + +public inline fun SecureValue.bankStatementSecureValueOrThrow(): BankStatementSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.BankStatementSecureValue + +public inline fun SecureValue.ifBankStatementSecureValue(block: (BankStatementSecureValue) -> T): T? = bankStatementSecureValueOrNull() ?.let(block) + +public inline fun SecureValue.rentalAgreementSecureValueOrNull(): RentalAgreementSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.RentalAgreementSecureValue + +public inline fun SecureValue.rentalAgreementSecureValueOrThrow(): RentalAgreementSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.RentalAgreementSecureValue + +public inline fun SecureValue.ifRentalAgreementSecureValue(block: (RentalAgreementSecureValue) -> T): T? = rentalAgreementSecureValueOrNull() ?.let(block) + +public inline fun SecureValue.passportRegistrationSecureValueOrNull(): PassportRegistrationSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.PassportRegistrationSecureValue + +public inline fun SecureValue.passportRegistrationSecureValueOrThrow(): PassportRegistrationSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.PassportRegistrationSecureValue + +public inline fun SecureValue.ifPassportRegistrationSecureValue(block: (PassportRegistrationSecureValue) -> T): T? = passportRegistrationSecureValueOrNull() ?.let(block) + +public inline fun SecureValue.temporalRegistrationSecureValueOrNull(): TemporalRegistrationSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.TemporalRegistrationSecureValue + +public inline fun SecureValue.temporalRegistrationSecureValueOrThrow(): TemporalRegistrationSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.TemporalRegistrationSecureValue + +public inline fun SecureValue.ifTemporalRegistrationSecureValue(block: (TemporalRegistrationSecureValue) -> T): T? = temporalRegistrationSecureValueOrNull() ?.let(block) + +public inline fun SecureValue.addressSecureValueOrNull(): AddressSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.AddressSecureValue + +public inline fun SecureValue.addressSecureValueOrThrow(): AddressSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.AddressSecureValue + +public inline fun SecureValue.ifAddressSecureValue(block: (AddressSecureValue) -> T): T? = addressSecureValueOrNull() ?.let(block) + +public inline fun SecureValue.identityWithReverseSideSecureValueOrNull(): IdentityWithReverseSideSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.IdentityWithReverseSideSecureValue + +public inline fun SecureValue.identityWithReverseSideSecureValueOrThrow(): IdentityWithReverseSideSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.IdentityWithReverseSideSecureValue + +public inline fun SecureValue.ifIdentityWithReverseSideSecureValue(block: (IdentityWithReverseSideSecureValue) -> T): T? = identityWithReverseSideSecureValueOrNull() ?.let(block) + +public inline fun SecureValue.driverLicenseSecureValueOrNull(): DriverLicenseSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.DriverLicenseSecureValue + +public inline fun SecureValue.driverLicenseSecureValueOrThrow(): DriverLicenseSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.DriverLicenseSecureValue + +public inline fun SecureValue.ifDriverLicenseSecureValue(block: (DriverLicenseSecureValue) -> T): T? = driverLicenseSecureValueOrNull() ?.let(block) + +public inline fun SecureValue.identityCardSecureValueOrNull(): IdentityCardSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.IdentityCardSecureValue + +public inline fun SecureValue.identityCardSecureValueOrThrow(): IdentityCardSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.IdentityCardSecureValue + +public inline fun SecureValue.ifIdentityCardSecureValue(block: (IdentityCardSecureValue) -> T): T? = identityCardSecureValueOrNull() ?.let(block) + public inline fun PassportElementError.unknownPassportElementErrorOrNull(): UnknownPassportElementError? = this as? dev.inmo.tgbotapi.types.passport.UnknownPassportElementError public inline fun PassportElementError.unknownPassportElementErrorOrThrow(): UnknownPassportElementError = this as dev.inmo.tgbotapi.types.passport.UnknownPassportElementError