From 9d893ffa48777692e408d7f4ef407a48dd2cb23e Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 4 Aug 2022 17:12:34 +0600 Subject: [PATCH 01/17] start 3.0.0 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59783cda06..cca4e68fe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # TelegramBotAPI changelog +## 3.0.0 + ## 2.2.2 * `Utils`: diff --git a/gradle.properties b/gradle.properties index 6271ea497e..f56050c6a2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=2.2.2 +library_version=3.0.0 From c994332cb9a2e98b9a109dfec1557ff9bd8a10cb Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 4 Aug 2022 17:18:05 +0600 Subject: [PATCH 02/17] update dependencies --- gradle/libs.versions.toml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b2776fb4d2..6d1daad581 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,17 +1,16 @@ [versions] -kotlin = "1.6.21" -kotlin-serialization = "1.3.3" +kotlin = "1.7.10" +kotlin-serialization = "1.3.4-RC" kotlin-coroutines = "1.6.4" -kotlin-gradle-plugin = "7.0.4" javax-activation = "1.1.1" -korlibs = "2.7.0" -uuid = "0.4.1" +korlibs = "3.0.0" +uuid = "0.5.0" ktor = "2.0.3" -microutils = "0.11.13" +microutils = "0.12.0" github-release-plugin = "2.4.1" From ea614b790b0318baf7214dfc404b475d1ecd0810 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 4 Aug 2022 17:45:35 +0600 Subject: [PATCH 03/17] update serialization --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6d1daad581..ddaa75685b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] kotlin = "1.7.10" -kotlin-serialization = "1.3.4-RC" +kotlin-serialization = "1.4.0-RC" kotlin-coroutines = "1.6.4" javax-activation = "1.1.1" From 86937cc096a8af7c47b9e1346029864bf6bcd407 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 4 Aug 2022 18:01:35 +0600 Subject: [PATCH 04/17] remove deprecations --- .../behaviour_builder/BehaviourContext.kt | 52 +------------------ .../dev/inmo/tgbotapi/types/ChatIdentifier.kt | 13 ----- .../inmo/tgbotapi/types/buttons/ReplyForce.kt | 9 ---- .../types/chat/member/OwnerChatMember.kt | 3 -- .../abstracts/InputFileFromJavaFile.kt | 6 --- .../tgbotapi/extensions/utils/ClassCasts.kt | 12 ----- .../extensions/utils/FlowsAggregation.kt | 3 -- 7 files changed, 1 insertion(+), 97 deletions(-) delete mode 100644 tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFileFromJavaFile.kt diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt index 9885da3d5a..fbbd954d1b 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt @@ -57,20 +57,6 @@ interface BehaviourContext : FlowsUpdatesFilter, TelegramBot, CoroutineScope { upstreamUpdatesFlow: Flow? = null, triggersHolder: TriggersHolder = TriggersHolder() ): BehaviourContext - - /** - * @param updatesFilter unused - */ - @Deprecated("Do not use this method") - fun copy( - bot: TelegramBot = this.bot, - scope: CoroutineScope = this.scope, - broadcastChannelsSize: Int = 100, - onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND, - upstreamUpdatesFlow: Flow? = null, - triggersHolder: TriggersHolder = TriggersHolder(), - updatesFilter: BehaviourContextAndTypeReceiver? = null - ): BehaviourContext = copy(bot, scope, broadcastChannelsSize, onBufferOverflow, upstreamUpdatesFlow, triggersHolder) } class DefaultBehaviourContext( @@ -79,9 +65,7 @@ class DefaultBehaviourContext( broadcastChannelsSize: Int = 100, onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND, private val upstreamUpdatesFlow: Flow? = null, - override val triggersHolder: TriggersHolder = TriggersHolder(), - @Deprecated("This parameter is not used anymore") - private val updatesFilter: BehaviourContextAndTypeReceiver? = null + override val triggersHolder: TriggersHolder = TriggersHolder() ) : AbstractFlowsUpdatesFilter(), TelegramBot by bot, CoroutineScope by scope, BehaviourContext { private val additionalUpdatesSharedFlow = MutableSharedFlow(0, broadcastChannelsSize, onBufferOverflow) @@ -137,19 +121,6 @@ fun BC.createSubContext( triggersHolder = triggersHolder ) as BC -/** - * Creates new [BehaviourContext] using its [BehaviourContext.copy] method - * - * @param updatesFilter This param will not be used anymore - */ -@Deprecated("It is not recommended to use updates filter anymore") -fun BC.createSubContext( - scope: CoroutineScope = LinkedSupervisorScope(), - triggersHolder: TriggersHolder = this.triggersHolder, - updatesUpstreamFlow: Flow = allUpdatesFlow, - updatesFilter: CustomBehaviourContextAndTypeReceiver?, -) = createSubContext(scope, triggersHolder, updatesUpstreamFlow) - /** * Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext] * @@ -187,27 +158,6 @@ suspend fun BC.createSubContextAndDoWithUpdatesFilter ) } -/** - * Creates new one [BehaviourContext] using [createSubContext] and launches [behaviourContextReceiver] in a new context - * using [doInContext] - * - * @param stopOnCompletion ___TRUE BY DEFAULT___ - * @param updatesFilter Is not used anymore - */ -@Deprecated("It is not recommended to use updates filter anymore") -suspend fun BC.createSubContextAndDoWithUpdatesFilter( - scope: CoroutineScope = LinkedSupervisorScope(), - triggersHolder: TriggersHolder = this.triggersHolder, - updatesUpstreamFlow: Flow = allUpdatesFlow, - updatesFilter: CustomBehaviourContextAndTypeReceiver?, - stopOnCompletion: Boolean = true, - behaviourContextReceiver: CustomBehaviourContextReceiver -): T { - return createSubContextAndDoWithUpdatesFilter( - scope, triggersHolder, updatesUpstreamFlow, stopOnCompletion, behaviourContextReceiver - ) -} - /** * This method will cancel ALL subsequent contexts, expectations and waiters */ diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt index 69044c875b..fd748e46e8 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt @@ -39,19 +39,6 @@ val UserId.userLink: String val User.link: String get() = id.userLink -/** - * https://core.telegram.org/bots/api#formatting-options - */ -@Deprecated("Renamed", ReplaceWith("userLink", "dev.inmo.tgbotapi.types.userLink")) -val Identifier.link: String - get() = "tg://user?id=$this" -/** - * https://core.telegram.org/bots/api#formatting-options - */ -@Deprecated("Renamed", ReplaceWith("userLink", "dev.inmo.tgbotapi.types.userLink")) -val ChatId.link: String - get() = chatId.link - typealias UserId = ChatId fun Identifier.toChatId(): ChatId = ChatId(this) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/ReplyForce.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/ReplyForce.kt index 24a2ee2443..51368f2594 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/ReplyForce.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/ReplyForce.kt @@ -19,15 +19,6 @@ data class ReplyForce( val Selective = Selective() val NonSelective = NonSelective() val Default = ReplyForce() - - @Deprecated("Renamed", ReplaceWith("ReplyForce.Selective")) - inline val ReplyForceSelective - get() = Selective - @Deprecated("Renamed", ReplaceWith("ReplyForce.NonSelective")) - inline val ReplyForceNonSelective - get() = NonSelective - @Deprecated("Renamed", ReplaceWith("ReplyForce.Default")) - val ReplyForceDefault = ReplyForce() } init { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/OwnerChatMember.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/OwnerChatMember.kt index 9f58ee3ef2..ef730c86ec 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/OwnerChatMember.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/OwnerChatMember.kt @@ -38,6 +38,3 @@ data class OwnerChatMember( @Required private val type: String = "creator" } - -@Deprecated("Renamed", ReplaceWith("OwnerChatMember", "dev.inmo.tgbotapi.types.chat.member.OwnerChatMember")) -typealias CreatorChatMember = OwnerChatMember diff --git a/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFileFromJavaFile.kt b/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFileFromJavaFile.kt deleted file mode 100644 index c4f2a3ac47..0000000000 --- a/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFileFromJavaFile.kt +++ /dev/null @@ -1,6 +0,0 @@ -package dev.inmo.tgbotapi.requests.abstracts - -import java.io.File - -@Deprecated("Duplacation of asMultipartFile", ReplaceWith("asMultipartFile", "dev.inmo.tgbotapi.requests.abstracts.asMultipartFile")) -fun File.toInputFile() = asMultipartFile() diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt index 2f3194d072..c2d592fe5e 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt @@ -1828,18 +1828,6 @@ inline fun InlineQueryResult.asInlineQueryResultVoiceCommon(): InlineQueryResult inline fun InlineQueryResult.requireInlineQueryResultVoiceCommon(): InlineQueryResultVoiceCommon = this as InlineQueryResultVoiceCommon -@PreviewFeature -@Deprecated("Renamed", ReplaceWith("whenOwnerChatMember", "dev.inmo.tgbotapi.extensions.utils.whenOwnerChatMember")) -inline fun ChatMember.whenCreatorChatMember(block: (CreatorChatMember) -> T) = asCreatorChatMember() ?.let(block) - -@PreviewFeature -@Deprecated("Renamed", ReplaceWith("asOwnerChatMember", "dev.inmo.tgbotapi.extensions.utils.asOwnerChatMember")) -inline fun ChatMember.asCreatorChatMember(): CreatorChatMember? = this as? CreatorChatMember - -@PreviewFeature -@Deprecated("Renamed", ReplaceWith("requireOwnerChatMember", "dev.inmo.tgbotapi.extensions.utils.requireOwnerChatMember")) -inline fun ChatMember.requireCreatorChatMember(): CreatorChatMember = this as CreatorChatMember - @PreviewFeature inline fun ChatMember.whenOwnerChatMember(block: (OwnerChatMember) -> T) = asOwnerChatMember() ?.let(block) diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/FlowsAggregation.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/FlowsAggregation.kt index 532aec780e..82cd9cb9b2 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/FlowsAggregation.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/FlowsAggregation.kt @@ -30,9 +30,6 @@ fun Flow>.flatten(): Flow = flow { } } -@Deprecated("Renamed", ReplaceWith("flatten", "dev.inmo.tgbotapi.extensions.utils.flatten")) -fun Flow>.flatMap(): Flow = flatten() - fun Flow.flatMap(mapper: (T) -> Iterable): Flow = flow { collect { mapper(it).forEach { From 92407c9010ad468c87745c54cb4d107bea7928fd Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 4 Aug 2022 18:09:25 +0600 Subject: [PATCH 05/17] remove deprecations from copyMessage --- .../extensions/api/send/CopyMessage.kt | 221 ++++++++++++++++++ .../extensions/api/send/OldCopyMessage.kt | 180 -------------- .../tgbotapi/extensions/api/send/Replies.kt | 13 +- .../tgbotapi/requests/send/CopyMessage.kt | 6 +- 4 files changed, 235 insertions(+), 185 deletions(-) delete mode 100644 tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/OldCopyMessage.kt diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessage.kt index 3ddc68161e..5cb4239dd1 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessage.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/CopyMessage.kt @@ -229,3 +229,224 @@ suspend inline fun TelegramBot.copyMessage( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null ) = copyMessage(message.chat, message.messageId, toChat, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend inline fun TelegramBot.copyMessage( + toChatId: ChatIdentifier, + fromChatId: ChatIdentifier, + messageId: MessageIdentifier, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + CopyMessage( + fromChatId, + messageId, + toChatId, + text, + parseMode, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup + ) +) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend inline fun TelegramBot.copyMessage( + toChatId: ChatIdentifier, + fromChat: Chat, + messageId: MessageIdentifier, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = copyMessage( + toChatId, + fromChat.id, + messageId, + text, + parseMode, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup +) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend inline fun TelegramBot.copyMessage( + toChat: Chat, + fromChatId: ChatIdentifier, + messageId: MessageIdentifier, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = copyMessage( + toChat.id, + fromChatId, + messageId, + text, + parseMode, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup +) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend inline fun TelegramBot.copyMessage( + toChat: Chat, + fromChat: Chat, + messageId: MessageIdentifier, + text: String? = null, + parseMode: ParseMode? = null, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = copyMessage( + toChat.id, + fromChat.id, + messageId, + text, + parseMode, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup +) + + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend inline fun TelegramBot.copyMessage( + toChatId: ChatIdentifier, + fromChatId: ChatIdentifier, + messageId: MessageIdentifier, + entities: TextSourcesList, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + CopyMessage( + fromChatId, + messageId, + toChatId, + entities, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup + ) +) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend inline fun TelegramBot.copyMessage( + toChatId: ChatIdentifier, + fromChat: Chat, + messageId: MessageIdentifier, + entities: TextSourcesList, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = copyMessage( + toChatId, + fromChat.id, + messageId, + entities, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup +) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend inline fun TelegramBot.copyMessage( + toChat: Chat, + fromChatId: ChatIdentifier, + messageId: MessageIdentifier, + entities: TextSourcesList, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = copyMessage( + toChat.id, + fromChatId, + messageId, + entities, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup +) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend inline fun TelegramBot.copyMessage( + toChat: Chat, + fromChat: Chat, + messageId: MessageIdentifier, + entities: TextSourcesList, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = copyMessage( + toChat.id, + fromChat.id, + messageId, + entities, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup +) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/OldCopyMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/OldCopyMessage.kt deleted file mode 100644 index f546a93451..0000000000 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/OldCopyMessage.kt +++ /dev/null @@ -1,180 +0,0 @@ -package dev.inmo.tgbotapi.extensions.api.send - -import dev.inmo.tgbotapi.bot.TelegramBot -import dev.inmo.tgbotapi.requests.send.CopyMessage -import dev.inmo.tgbotapi.requests.send.OrderChangingDeprecationWarn -import dev.inmo.tgbotapi.types.ChatIdentifier -import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageIdentifier -import dev.inmo.tgbotapi.types.message.ParseMode -import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup -import dev.inmo.tgbotapi.types.chat.Chat -import dev.inmo.tgbotapi.types.message.abstracts.Message - -// TODO:: Swap fromChatId and toChatId for more correct order of parameters - -/** - * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or - * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param - */ -@Deprecated(OrderChangingDeprecationWarn) -suspend inline fun TelegramBot.copyMessage( - fromChatId: ChatIdentifier, - toChatId: ChatIdentifier, - messageId: MessageIdentifier, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - protectContent: Boolean = false, - replyToMessageId: MessageIdentifier? = null, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = execute( - CopyMessage( - fromChatId, - messageId, - toChatId, - text, - parseMode, - disableNotification, - protectContent, - replyToMessageId, - allowSendingWithoutReply, - replyMarkup - ) -) - -/** - * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or - * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param - */ -@Deprecated(OrderChangingDeprecationWarn) -suspend inline fun TelegramBot.copyMessage( - fromChat: Chat, - toChatId: ChatIdentifier, - messageId: MessageIdentifier, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - protectContent: Boolean = false, - replyToMessageId: MessageIdentifier? = null, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChat.id, toChatId, messageId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) - -/** - * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or - * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param - */ -@Deprecated(OrderChangingDeprecationWarn) -suspend inline fun TelegramBot.copyMessage( - fromChatId: ChatIdentifier, - toChat: Chat, - messageId: MessageIdentifier, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - protectContent: Boolean = false, - replyToMessageId: MessageIdentifier? = null, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChatId, toChat.id, messageId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) - -/** - * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or - * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param - */ -@Deprecated(OrderChangingDeprecationWarn) -suspend inline fun TelegramBot.copyMessage( - fromChat: Chat, - toChat: Chat, - messageId: MessageIdentifier, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - protectContent: Boolean = false, - replyToMessageId: MessageIdentifier? = null, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChat.id, toChat.id, messageId, text, parseMode, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) - - -/** - * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or - * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param - */ -@Deprecated(OrderChangingDeprecationWarn) -suspend inline fun TelegramBot.copyMessage( - fromChatId: ChatIdentifier, - toChatId: ChatIdentifier, - messageId: MessageIdentifier, - entities: TextSourcesList, - disableNotification: Boolean = false, - protectContent: Boolean = false, - replyToMessageId: MessageIdentifier? = null, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = execute( - CopyMessage( - fromChatId, - messageId, - toChatId, - entities, - disableNotification, - protectContent, - replyToMessageId, - allowSendingWithoutReply, - replyMarkup - ) -) - -/** - * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or - * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param - */ -@Deprecated(OrderChangingDeprecationWarn) -suspend inline fun TelegramBot.copyMessage( - fromChat: Chat, - toChatId: ChatIdentifier, - messageId: MessageIdentifier, - entities: TextSourcesList, - disableNotification: Boolean = false, - protectContent: Boolean = false, - replyToMessageId: MessageIdentifier? = null, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChat.id, toChatId, messageId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) - -/** - * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or - * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param - */ -@Deprecated(OrderChangingDeprecationWarn) -suspend inline fun TelegramBot.copyMessage( - fromChatId: ChatIdentifier, - toChat: Chat, - messageId: MessageIdentifier, - entities: TextSourcesList, - disableNotification: Boolean = false, - protectContent: Boolean = false, - replyToMessageId: MessageIdentifier? = null, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChatId, toChat.id, messageId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) - -/** - * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or - * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param - */ -@Deprecated(OrderChangingDeprecationWarn) -suspend inline fun TelegramBot.copyMessage( - fromChat: Chat, - toChat: Chat, - messageId: MessageIdentifier, - entities: TextSourcesList, - disableNotification: Boolean = false, - protectContent: Boolean = false, - replyToMessageId: MessageIdentifier? = null, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChat.id, toChat.id, messageId, entities, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt index a857405cf6..0bd006aeec 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt @@ -950,7 +950,18 @@ suspend inline fun TelegramBot.reply( protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null -) = copyMessage(fromChatId, to.chat.id, messageId, text, parseMode, disableNotification, protectContent, to.messageId, allowSendingWithoutReply, replyMarkup) +) = copyMessage( + to.chat.id, + fromChatId, + messageId, + text, + parseMode, + disableNotification, + protectContent, + to.messageId, + allowSendingWithoutReply, + replyMarkup +) suspend inline fun TelegramBot.reply( to: Message, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/CopyMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/CopyMessage.kt index c079f297a7..a2bb4ad842 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/CopyMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/CopyMessage.kt @@ -20,10 +20,9 @@ import kotlinx.serialization.* const val OrderChangingDeprecationWarn = "The order of parameters in this factory will be changed soon. To avoid unexpected behaviour, swap message id and target chat id parameters" -@Deprecated(OrderChangingDeprecationWarn) fun CopyMessage( - fromChatId: ChatIdentifier, toChatId: ChatIdentifier, + fromChatId: ChatIdentifier, messageId: MessageIdentifier, text: String? = null, parseMode: ParseMode? = null, @@ -46,10 +45,9 @@ fun CopyMessage( replyMarkup ) -@Deprecated(OrderChangingDeprecationWarn) fun CopyMessage( - fromChatId: ChatIdentifier, toChatId: ChatIdentifier, + fromChatId: ChatIdentifier, messageId: MessageIdentifier, entities: List, disableNotification: Boolean = false, From 48c4a3156b2b915fb8107e678a0dd3c1d7a5f52c Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 4 Aug 2022 18:15:51 +0600 Subject: [PATCH 06/17] fix of build --- .../utils/internal/MultilevelTextSourceFormatting.kt | 7 +++---- .../dev/inmo/tgbotapi/utils/internal/StringFormatting.kt | 5 ++--- .../extensions/utils/formatting/LinksFormatting.kt | 2 +- .../extensions/utils/formatting/StringFormatting.kt | 6 +++--- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/MultilevelTextSourceFormatting.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/MultilevelTextSourceFormatting.kt index 56ffef940a..54338b3a7a 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/MultilevelTextSourceFormatting.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/MultilevelTextSourceFormatting.kt @@ -1,8 +1,7 @@ package dev.inmo.tgbotapi.utils.internal +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.textsources.MultilevelTextSource -import dev.inmo.tgbotapi.types.UserId -import dev.inmo.tgbotapi.types.link import dev.inmo.tgbotapi.utils.extensions.* internal fun MultilevelTextSource.markdownV2Default( @@ -61,8 +60,8 @@ internal fun MultilevelTextSource.underlineMarkdownV2(): String = markdownV2Defa internal fun MultilevelTextSource.underlineHTML(): String = htmlDefault(htmlUnderlineControl) -internal fun MultilevelTextSource.textMentionMarkdownV2(userId: UserId): String = linkMarkdownV2(userId.link) -internal fun MultilevelTextSource.textMentionHTML(userId: UserId): String = linkHTML(userId.link) +internal fun MultilevelTextSource.textMentionMarkdownV2(userId: UserId): String = linkMarkdownV2(userId.userLink) +internal fun MultilevelTextSource.textMentionHTML(userId: UserId): String = linkHTML(userId.userLink) internal fun MultilevelTextSource.mentionMarkdownV2(): String = optionalPrefix("@") + subsources.makeMarkdownV2String() internal fun MultilevelTextSource.mentionHTML(): String = optionalPrefix("@") + subsources.makeHtmlString() diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/StringFormatting.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/StringFormatting.kt index a43471b317..b7640743e0 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/StringFormatting.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/StringFormatting.kt @@ -1,7 +1,6 @@ package dev.inmo.tgbotapi.utils.internal -import dev.inmo.tgbotapi.types.UserId -import dev.inmo.tgbotapi.types.link +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.* import dev.inmo.tgbotapi.utils.extensions.* @@ -102,7 +101,7 @@ private inline fun String.hashTag(adapt: String.() -> String): String = if (star "#${adapt()}" } -internal fun String.textMentionMarkdown(userId: UserId): String = linkMarkdown(userId.link) +internal fun String.textMentionMarkdown(userId: UserId): String = linkMarkdown(userId.userLink) internal fun String.mentionMarkdown(): String = mention(String::toMarkdown) diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt index 284900af4e..ad8969379a 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt @@ -77,7 +77,7 @@ val Chat.link: String? inviteLink ?.let { return it } } if (this is PrivateChat) { - return id.link + return id.userLink } return null } diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/StringFormatting.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/StringFormatting.kt index 75b491260b..a86f1c8a41 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/StringFormatting.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/StringFormatting.kt @@ -109,9 +109,9 @@ private inline fun String.hashTag(adapt: String.() -> String): String = if (star } -fun String.textMentionMarkdown(userId: UserId): String = linkMarkdown(userId.link) -fun String.textMentionMarkdownV2(userId: UserId): String = linkMarkdownV2(userId.link) -fun String.textMentionHTML(userId: UserId): String = linkHTML(userId.link) +fun String.textMentionMarkdown(userId: UserId): String = linkMarkdown(userId.userLink) +fun String.textMentionMarkdownV2(userId: UserId): String = linkMarkdownV2(userId.userLink) +fun String.textMentionHTML(userId: UserId): String = linkHTML(userId.userLink) fun String.mentionMarkdown(): String = mention(String::toMarkdown) From 8c51ca9d7262c09e137824bb6a6cee26ec630000 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 4 Aug 2022 22:13:02 +0600 Subject: [PATCH 07/17] fixes in forward from public chat info --- .../tgbotapi/types/message/ForwardInfo.kt | 63 ++++++++++++------- .../inmo/tgbotapi/types/message/RawMessage.kt | 22 ++++--- .../extensions/utils/ClassCastsNew.kt | 21 +++++-- 3 files changed, 72 insertions(+), 34 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt index 225bd1e3c1..4466d95500 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt @@ -5,38 +5,59 @@ import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.chat.* import dev.inmo.tgbotapi.types.chat.User -sealed class ForwardInfo { +sealed interface ForwardInfo { abstract val dateOfOriginal: TelegramDate } data class AnonymousForwardInfo( override val dateOfOriginal: TelegramDate, val senderName: String -) : ForwardInfo() +) : ForwardInfo data class UserForwardInfo( override val dateOfOriginal: TelegramDate, override val from: User -) : ForwardInfo(), FromUser +) : ForwardInfo, FromUser -sealed class ForwardFromPublicChatInfo : ForwardInfo() { - abstract val chat: PublicChat +sealed interface ForwardFromPublicChatInfo : ForwardInfo { + val chat: PublicChat + + /** + * Represent forward info for the message sent by [channelChat] into some group + */ + data class SentByChannel( + override val dateOfOriginal: TelegramDate, + val channelChat: ChannelChat, + val signature: String? = null + ) : ForwardFromPublicChatInfo { + override val chat: PublicChat + get() = channelChat + } + + /** + * Represent forward info for the message sent by [channelChat] into that channel + */ + data class FromChannel( + override val dateOfOriginal: TelegramDate, + val messageId: MessageIdentifier, + val channelChat: ChannelChat, + val signature: String? = null + ) : ForwardFromPublicChatInfo { + override val chat: PublicChat + get() = channelChat + } + + data class FromSupergroup( + override val dateOfOriginal: TelegramDate, + val group: SupergroupChat + ) : ForwardFromPublicChatInfo { + override val chat: PublicChat + get() = group + } } -data class ForwardFromChannelInfo( - override val dateOfOriginal: TelegramDate, - val messageId: MessageIdentifier, - val channelChat: ChannelChat, - val signature: String? = null -) : ForwardFromPublicChatInfo() { - override val chat: PublicChat - get() = channelChat -} +@Deprecated("Replaced", ReplaceWith("ForwardFromPublicChatInfo.FromChannel", "dev.inmo.tgbotapi.types.message.FromChannel")) +typealias ForwardFromChannelInfo = ForwardFromPublicChatInfo.FromChannel -data class ForwardFromSupergroupInfo( - override val dateOfOriginal: TelegramDate, - val group: SupergroupChat -) : ForwardFromPublicChatInfo() { - override val chat: PublicChat - get() = group -} +@Deprecated("Replaced", ReplaceWith("ForwardFromPublicChatInfo.FromSupergroup", "dev.inmo.tgbotapi.types.message.ForwardFromPublicChatInfo")) +typealias ForwardFromSupergroupInfo = ForwardFromPublicChatInfo.FromSupergroup 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 1262958af1..49960119e8 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 @@ -162,13 +162,21 @@ internal data class RawMessage( forward_date, forward_sender_name ) - forward_from_chat is ChannelChat -> ForwardFromChannelInfo( - forward_date, - forward_from_message_id ?: error("Channel forwarded message must contain message id, but was not"), - forward_from_chat, - forward_signature - ) - forward_from_chat is SupergroupChat -> ForwardFromSupergroupInfo( + forward_from_chat is ChannelChat -> if (forward_from_message_id == null) { + ForwardFromPublicChatInfo.SentByChannel( + forward_date, + forward_from_chat, + forward_signature + ) + } else { + ForwardFromPublicChatInfo.FromChannel( + forward_date, + forward_from_message_id, + forward_from_chat, + forward_signature + ) + } + forward_from_chat is SupergroupChat -> ForwardFromPublicChatInfo.FromSupergroup( forward_date, forward_from_chat ) 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 125b1da116..2f5d0b7f28 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 @@ -3415,22 +3415,31 @@ inline fun ForwardInfo.forwardFromPublicChatInfoOrNull(): ForwardFromPublicChatI inline fun ForwardInfo.forwardFromPublicChatInfoOrThrow(): ForwardFromPublicChatInfo = this as ForwardFromPublicChatInfo @PreviewFeature -inline fun ForwardInfo.ifForwardFromChannelInfo(block: (ForwardFromChannelInfo) -> T) = forwardFromChannelInfoOrNull() ?.let(block) +inline fun ForwardInfo.ifForwardFromChannelInfo(block: (ForwardFromPublicChatInfo.FromChannel) -> T) = forwardFromChannelInfoOrNull() ?.let(block) @PreviewFeature -inline fun ForwardInfo.forwardFromChannelInfoOrNull(): ForwardFromChannelInfo? = this as? ForwardFromChannelInfo +inline fun ForwardInfo.forwardFromChannelInfoOrNull(): ForwardFromPublicChatInfo.FromChannel? = this as? ForwardFromPublicChatInfo.FromChannel @PreviewFeature -inline fun ForwardInfo.forwardFromChannelInfoOrThrow(): ForwardFromChannelInfo = this as ForwardFromChannelInfo +inline fun ForwardInfo.forwardFromChannelInfoOrThrow(): ForwardFromPublicChatInfo.FromChannel = this as ForwardFromPublicChatInfo.FromChannel @PreviewFeature -inline fun ForwardInfo.ifForwardFromSupergroupInfo(block: (ForwardFromSupergroupInfo) -> T) = forwardFromSupergroupInfoOrNull() ?.let(block) +inline fun ForwardInfo.ifForwardSentByChannelInfo(block: (ForwardFromPublicChatInfo.SentByChannel) -> T) = forwardSentByChannelInfoOrNull() ?.let(block) @PreviewFeature -inline fun ForwardInfo.forwardFromSupergroupInfoOrNull(): ForwardFromSupergroupInfo? = this as? ForwardFromSupergroupInfo +inline fun ForwardInfo.forwardSentByChannelInfoOrNull(): ForwardFromPublicChatInfo.SentByChannel? = this as? ForwardFromPublicChatInfo.SentByChannel @PreviewFeature -inline fun ForwardInfo.forwardFromSupergroupInfoOrThrow(): ForwardFromSupergroupInfo = this as ForwardFromSupergroupInfo +inline fun ForwardInfo.forwardSentByChannelInfoOrThrow(): ForwardFromPublicChatInfo.SentByChannel = this as ForwardFromPublicChatInfo.SentByChannel + +@PreviewFeature +inline fun ForwardInfo.ifForwardFromSupergroupInfo(block: (ForwardFromPublicChatInfo.FromSupergroup) -> T) = forwardFromSupergroupInfoOrNull() ?.let(block) + +@PreviewFeature +inline fun ForwardInfo.forwardFromSupergroupInfoOrNull(): ForwardFromPublicChatInfo.FromSupergroup? = this as? ForwardFromPublicChatInfo.FromSupergroup + +@PreviewFeature +inline fun ForwardInfo.forwardFromSupergroupInfoOrThrow(): ForwardFromPublicChatInfo.FromSupergroup = this as ForwardFromPublicChatInfo.FromSupergroup @PreviewFeature inline fun MessageContent.ifTextedInput(block: (TextedInput) -> T) = textedInputOrNull() ?.let(block) From 69f658e4a842b02e66db2b68e40f998d02d22109 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 4 Aug 2022 22:45:26 +0600 Subject: [PATCH 08/17] rewrite hierarchy of forward info classes --- .../tgbotapi/types/message/ForwardInfo.kt | 99 +- .../inmo/tgbotapi/types/message/RawMessage.kt | 17 +- .../tgbotapi/extensions/utils/ClassCasts.kt | 982 +++++++++------ .../extensions/utils/ClassCastsNew.kt | 1069 +++++++++++------ 4 files changed, 1342 insertions(+), 825 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt index 4466d95500..b96f35336b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt @@ -7,57 +7,66 @@ import dev.inmo.tgbotapi.types.chat.User sealed interface ForwardInfo { abstract val dateOfOriginal: TelegramDate -} -data class AnonymousForwardInfo( - override val dateOfOriginal: TelegramDate, - val senderName: String -) : ForwardInfo - -data class UserForwardInfo( - override val dateOfOriginal: TelegramDate, - override val from: User -) : ForwardInfo, FromUser - -sealed interface ForwardFromPublicChatInfo : ForwardInfo { - val chat: PublicChat - - /** - * Represent forward info for the message sent by [channelChat] into some group - */ - data class SentByChannel( + data class ByAnonymous( override val dateOfOriginal: TelegramDate, - val channelChat: ChannelChat, - val signature: String? = null - ) : ForwardFromPublicChatInfo { - override val chat: PublicChat - get() = channelChat - } + val senderName: String + ) : ForwardInfo - /** - * Represent forward info for the message sent by [channelChat] into that channel - */ - data class FromChannel( + data class ByUser( override val dateOfOriginal: TelegramDate, - val messageId: MessageIdentifier, - val channelChat: ChannelChat, - val signature: String? = null - ) : ForwardFromPublicChatInfo { - override val chat: PublicChat - get() = channelChat - } + override val from: User + ) : ForwardInfo, FromUser - data class FromSupergroup( - override val dateOfOriginal: TelegramDate, - val group: SupergroupChat - ) : ForwardFromPublicChatInfo { - override val chat: PublicChat - get() = group + sealed interface PublicChat : ForwardInfo { + val chat: dev.inmo.tgbotapi.types.chat.PublicChat + + /** + * Represent forward info for the message sent by [channelChat] into some group + */ + data class SentByChannel( + override val dateOfOriginal: TelegramDate, + val channelChat: ChannelChat, + val signature: String? = null + ) : PublicChat { + override val chat: dev.inmo.tgbotapi.types.chat.PublicChat + get() = channelChat + } + + /** + * Represent forward info for the message sent by [channelChat] into that channel + */ + data class FromChannel( + override val dateOfOriginal: TelegramDate, + val messageId: MessageIdentifier, + val channelChat: ChannelChat, + val signature: String? = null + ) : PublicChat { + override val chat: dev.inmo.tgbotapi.types.chat.PublicChat + get() = channelChat + } + + data class FromSupergroup( + override val dateOfOriginal: TelegramDate, + val group: SupergroupChat + ) : PublicChat { + override val chat: dev.inmo.tgbotapi.types.chat.PublicChat + get() = group + } } } -@Deprecated("Replaced", ReplaceWith("ForwardFromPublicChatInfo.FromChannel", "dev.inmo.tgbotapi.types.message.FromChannel")) -typealias ForwardFromChannelInfo = ForwardFromPublicChatInfo.FromChannel +@Deprecated("Replaced", ReplaceWith("ForwardInfo.ByAnonymous", "dev.inmo.tgbotapi.types.message.ForwardInfo")) +typealias AnonymousForwardInfo = ForwardInfo.ByAnonymous -@Deprecated("Replaced", ReplaceWith("ForwardFromPublicChatInfo.FromSupergroup", "dev.inmo.tgbotapi.types.message.ForwardFromPublicChatInfo")) -typealias ForwardFromSupergroupInfo = ForwardFromPublicChatInfo.FromSupergroup +@Deprecated("Replaced", ReplaceWith("ForwardInfo.ByUser", "dev.inmo.tgbotapi.types.message.ForwardInfo")) +typealias UserForwardInfo = ForwardInfo.ByUser + +@Deprecated("Replaced", ReplaceWith("ForwardInfo.PublicChat", "dev.inmo.tgbotapi.types.message.ForwardInfo")) +typealias ForwardFromPublicChatInfo = ForwardInfo.PublicChat + +@Deprecated("Replaced", ReplaceWith("ForwardInfo.PublicChat.FromChannel", "dev.inmo.tgbotapi.types.message.ForwardInfo")) +typealias ForwardFromChannelInfo = ForwardInfo.PublicChat.FromChannel + +@Deprecated("Replaced", ReplaceWith("ForwardInfo.PublicChat.FromSupergroup", "dev.inmo.tgbotapi.types.message.ForwardInfo")) +typealias ForwardFromSupergroupInfo = ForwardInfo.PublicChat.FromSupergroup 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 49960119e8..2af80360d3 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 @@ -156,34 +156,39 @@ internal data class RawMessage( } private val forwarded: ForwardInfo? by lazy { - forward_date ?: return@lazy null // According to the documentation, now any forwarded message contains this field + forward_date + ?: return@lazy null // According to the documentation, now any forwarded message contains this field when { - forward_sender_name != null -> AnonymousForwardInfo( + forward_sender_name != null -> ForwardInfo.ByAnonymous( forward_date, forward_sender_name ) + forward_from_chat is ChannelChat -> if (forward_from_message_id == null) { - ForwardFromPublicChatInfo.SentByChannel( + ForwardInfo.PublicChat.SentByChannel( forward_date, forward_from_chat, forward_signature ) } else { - ForwardFromPublicChatInfo.FromChannel( + ForwardInfo.PublicChat.FromChannel( forward_date, forward_from_message_id, forward_from_chat, forward_signature ) } - forward_from_chat is SupergroupChat -> ForwardFromPublicChatInfo.FromSupergroup( + + forward_from_chat is SupergroupChat -> ForwardInfo.PublicChat.FromSupergroup( forward_date, forward_from_chat ) - forward_from != null -> UserForwardInfo( + + forward_from != null -> ForwardInfo.ByUser( forward_date, forward_from ) + else -> null } } diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt index c2d592fe5e..a5cf160d65 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt @@ -67,7 +67,7 @@ import dev.inmo.tgbotapi.types.update.media_group.* import dev.inmo.tgbotapi.utils.PreviewFeature @PreviewFeature -inline fun Chat.whenBot(block: (Bot) -> T) = asBot() ?.let(block) +inline fun Chat.whenBot(block: (Bot) -> T) = asBot()?.let(block) @PreviewFeature inline fun Chat.asBot(): Bot? = this as? Bot @@ -76,7 +76,7 @@ inline fun Chat.asBot(): Bot? = this as? Bot inline fun Chat.requireBot(): Bot = this as Bot @PreviewFeature -inline fun Chat.whenCommonBot(block: (CommonBot) -> T) = asCommonBot() ?.let(block) +inline fun Chat.whenCommonBot(block: (CommonBot) -> T) = asCommonBot()?.let(block) @PreviewFeature inline fun Chat.asCommonBot(): CommonBot? = this as? CommonBot @@ -85,7 +85,7 @@ inline fun Chat.asCommonBot(): CommonBot? = this as? CommonBot inline fun Chat.requireCommonBot(): CommonBot = this as CommonBot @PreviewFeature -inline fun Chat.whenCommonUser(block: (CommonUser) -> T) = asCommonUser() ?.let(block) +inline fun Chat.whenCommonUser(block: (CommonUser) -> T) = asCommonUser()?.let(block) @PreviewFeature inline fun Chat.asCommonUser(): CommonUser? = this as? CommonUser @@ -94,7 +94,7 @@ inline fun Chat.asCommonUser(): CommonUser? = this as? CommonUser inline fun Chat.requireCommonUser(): CommonUser = this as CommonUser @PreviewFeature -inline fun Chat.whenExtendedBot(block: (ExtendedBot) -> T) = asExtendedBot() ?.let(block) +inline fun Chat.whenExtendedBot(block: (ExtendedBot) -> T) = asExtendedBot()?.let(block) @PreviewFeature inline fun Chat.asExtendedBot(): ExtendedBot? = this as? ExtendedBot @@ -103,7 +103,7 @@ inline fun Chat.asExtendedBot(): ExtendedBot? = this as? ExtendedBot inline fun Chat.requireExtendedBot(): ExtendedBot = this as ExtendedBot @PreviewFeature -inline fun Chat.whenUser(block: (User) -> T) = asUser() ?.let(block) +inline fun Chat.whenUser(block: (User) -> T) = asUser()?.let(block) @PreviewFeature inline fun Chat.asUser(): User? = this as? User @@ -112,7 +112,7 @@ inline fun Chat.asUser(): User? = this as? User inline fun Chat.requireUser(): User = this as User @PreviewFeature -inline fun Chat.whenChannelChat(block: (ChannelChat) -> T) = asChannelChat() ?.let(block) +inline fun Chat.whenChannelChat(block: (ChannelChat) -> T) = asChannelChat()?.let(block) @PreviewFeature inline fun Chat.asChannelChat(): ChannelChat? = this as? ChannelChat @@ -121,7 +121,7 @@ inline fun Chat.asChannelChat(): ChannelChat? = this as? ChannelChat inline fun Chat.requireChannelChat(): ChannelChat = this as ChannelChat @PreviewFeature -inline fun Chat.whenGroupChat(block: (GroupChat) -> T) = asGroupChat() ?.let(block) +inline fun Chat.whenGroupChat(block: (GroupChat) -> T) = asGroupChat()?.let(block) @PreviewFeature inline fun Chat.asGroupChat(): GroupChat? = this as? GroupChat @@ -130,7 +130,7 @@ inline fun Chat.asGroupChat(): GroupChat? = this as? GroupChat inline fun Chat.requireGroupChat(): GroupChat = this as GroupChat @PreviewFeature -inline fun Chat.whenPrivateChat(block: (PrivateChat) -> T) = asPrivateChat() ?.let(block) +inline fun Chat.whenPrivateChat(block: (PrivateChat) -> T) = asPrivateChat()?.let(block) @PreviewFeature inline fun Chat.asPrivateChat(): PrivateChat? = this as? PrivateChat @@ -139,7 +139,7 @@ inline fun Chat.asPrivateChat(): PrivateChat? = this as? PrivateChat inline fun Chat.requirePrivateChat(): PrivateChat = this as PrivateChat @PreviewFeature -inline fun Chat.whenPublicChat(block: (PublicChat) -> T) = asPublicChat() ?.let(block) +inline fun Chat.whenPublicChat(block: (PublicChat) -> T) = asPublicChat()?.let(block) @PreviewFeature inline fun Chat.asPublicChat(): PublicChat? = this as? PublicChat @@ -148,7 +148,7 @@ inline fun Chat.asPublicChat(): PublicChat? = this as? PublicChat inline fun Chat.requirePublicChat(): PublicChat = this as PublicChat @PreviewFeature -inline fun Chat.whenSuperPublicChat(block: (SuperPublicChat) -> T) = asSuperPublicChat() ?.let(block) +inline fun Chat.whenSuperPublicChat(block: (SuperPublicChat) -> T) = asSuperPublicChat()?.let(block) @PreviewFeature inline fun Chat.asSuperPublicChat(): SuperPublicChat? = this as? SuperPublicChat @@ -157,7 +157,7 @@ inline fun Chat.asSuperPublicChat(): SuperPublicChat? = this as? SuperPublicChat inline fun Chat.requireSuperPublicChat(): SuperPublicChat = this as SuperPublicChat @PreviewFeature -inline fun Chat.whenSupergroupChat(block: (SupergroupChat) -> T) = asSupergroupChat() ?.let(block) +inline fun Chat.whenSupergroupChat(block: (SupergroupChat) -> T) = asSupergroupChat()?.let(block) @PreviewFeature inline fun Chat.asSupergroupChat(): SupergroupChat? = this as? SupergroupChat @@ -166,7 +166,7 @@ inline fun Chat.asSupergroupChat(): SupergroupChat? = this as? SupergroupChat inline fun Chat.requireSupergroupChat(): SupergroupChat = this as SupergroupChat @PreviewFeature -inline fun Chat.whenUnknownChatType(block: (UnknownChatType) -> T) = asUnknownChatType() ?.let(block) +inline fun Chat.whenUnknownChatType(block: (UnknownChatType) -> T) = asUnknownChatType()?.let(block) @PreviewFeature inline fun Chat.asUnknownChatType(): UnknownChatType? = this as? UnknownChatType @@ -175,7 +175,7 @@ inline fun Chat.asUnknownChatType(): UnknownChatType? = this as? UnknownChatType inline fun Chat.requireUnknownChatType(): UnknownChatType = this as UnknownChatType @PreviewFeature -inline fun Chat.whenUsernameChat(block: (UsernameChat) -> T) = asUsernameChat() ?.let(block) +inline fun Chat.whenUsernameChat(block: (UsernameChat) -> T) = asUsernameChat()?.let(block) @PreviewFeature inline fun Chat.asUsernameChat(): UsernameChat? = this as? UsernameChat @@ -184,7 +184,7 @@ inline fun Chat.asUsernameChat(): UsernameChat? = this as? UsernameChat inline fun Chat.requireUsernameChat(): UsernameChat = this as UsernameChat @PreviewFeature -inline fun Chat.whenExtendedChannelChat(block: (ExtendedChannelChat) -> T) = asExtendedChannelChat() ?.let(block) +inline fun Chat.whenExtendedChannelChat(block: (ExtendedChannelChat) -> T) = asExtendedChannelChat()?.let(block) @PreviewFeature inline fun Chat.asExtendedChannelChat(): ExtendedChannelChat? = this as? ExtendedChannelChat @@ -193,7 +193,7 @@ inline fun Chat.asExtendedChannelChat(): ExtendedChannelChat? = this as? Extende inline fun Chat.requireExtendedChannelChat(): ExtendedChannelChat = this as ExtendedChannelChat @PreviewFeature -inline fun Chat.whenExtendedChat(block: (ExtendedChat) -> T) = asExtendedChat() ?.let(block) +inline fun Chat.whenExtendedChat(block: (ExtendedChat) -> T) = asExtendedChat()?.let(block) @PreviewFeature inline fun Chat.asExtendedChat(): ExtendedChat? = this as? ExtendedChat @@ -202,7 +202,7 @@ inline fun Chat.asExtendedChat(): ExtendedChat? = this as? ExtendedChat inline fun Chat.requireExtendedChat(): ExtendedChat = this as ExtendedChat @PreviewFeature -inline fun Chat.whenExtendedGroupChat(block: (ExtendedGroupChat) -> T) = asExtendedGroupChat() ?.let(block) +inline fun Chat.whenExtendedGroupChat(block: (ExtendedGroupChat) -> T) = asExtendedGroupChat()?.let(block) @PreviewFeature inline fun Chat.asExtendedGroupChat(): ExtendedGroupChat? = this as? ExtendedGroupChat @@ -211,7 +211,7 @@ inline fun Chat.asExtendedGroupChat(): ExtendedGroupChat? = this as? ExtendedGro inline fun Chat.requireExtendedGroupChat(): ExtendedGroupChat = this as ExtendedGroupChat @PreviewFeature -inline fun Chat.whenExtendedPrivateChat(block: (ExtendedPrivateChat) -> T) = asExtendedPrivateChat() ?.let(block) +inline fun Chat.whenExtendedPrivateChat(block: (ExtendedPrivateChat) -> T) = asExtendedPrivateChat()?.let(block) @PreviewFeature inline fun Chat.asExtendedPrivateChat(): ExtendedPrivateChat? = this as? ExtendedPrivateChat @@ -220,7 +220,7 @@ inline fun Chat.asExtendedPrivateChat(): ExtendedPrivateChat? = this as? Extende inline fun Chat.requireExtendedPrivateChat(): ExtendedPrivateChat = this as ExtendedPrivateChat @PreviewFeature -inline fun Chat.whenExtendedPublicChat(block: (ExtendedPublicChat) -> T) = asExtendedPublicChat() ?.let(block) +inline fun Chat.whenExtendedPublicChat(block: (ExtendedPublicChat) -> T) = asExtendedPublicChat()?.let(block) @PreviewFeature inline fun Chat.asExtendedPublicChat(): ExtendedPublicChat? = this as? ExtendedPublicChat @@ -229,7 +229,8 @@ inline fun Chat.asExtendedPublicChat(): ExtendedPublicChat? = this as? ExtendedP inline fun Chat.requireExtendedPublicChat(): ExtendedPublicChat = this as ExtendedPublicChat @PreviewFeature -inline fun Chat.whenExtendedSupergroupChat(block: (ExtendedSupergroupChat) -> T) = asExtendedSupergroupChat() ?.let(block) +inline fun Chat.whenExtendedSupergroupChat(block: (ExtendedSupergroupChat) -> T) = + asExtendedSupergroupChat()?.let(block) @PreviewFeature inline fun Chat.asExtendedSupergroupChat(): ExtendedSupergroupChat? = this as? ExtendedSupergroupChat @@ -238,7 +239,7 @@ inline fun Chat.asExtendedSupergroupChat(): ExtendedSupergroupChat? = this as? E inline fun Chat.requireExtendedSupergroupChat(): ExtendedSupergroupChat = this as ExtendedSupergroupChat @PreviewFeature -inline fun Chat.whenPossiblyPremiumChat(block: (PossiblyPremiumChat) -> T) = asPossiblyPremiumChat() ?.let(block) +inline fun Chat.whenPossiblyPremiumChat(block: (PossiblyPremiumChat) -> T) = asPossiblyPremiumChat()?.let(block) @PreviewFeature inline fun Chat.asPossiblyPremiumChat(): PossiblyPremiumChat? = this as? PossiblyPremiumChat @@ -247,16 +248,19 @@ inline fun Chat.asPossiblyPremiumChat(): PossiblyPremiumChat? = this as? Possibl inline fun Chat.requirePossiblyPremiumChat(): PossiblyPremiumChat = this as PossiblyPremiumChat @PreviewFeature -inline fun Chat.whenAbleToAddInAttachmentMenuChat(block: (AbleToAddInAttachmentMenuChat) -> T) = asAbleToAddInAttachmentMenuChat() ?.let(block) +inline fun Chat.whenAbleToAddInAttachmentMenuChat(block: (AbleToAddInAttachmentMenuChat) -> T) = + asAbleToAddInAttachmentMenuChat()?.let(block) @PreviewFeature -inline fun Chat.asAbleToAddInAttachmentMenuChat(): AbleToAddInAttachmentMenuChat? = this as? AbleToAddInAttachmentMenuChat +inline fun Chat.asAbleToAddInAttachmentMenuChat(): AbleToAddInAttachmentMenuChat? = + this as? AbleToAddInAttachmentMenuChat @PreviewFeature -inline fun Chat.requireAbleToAddInAttachmentMenuChat(): AbleToAddInAttachmentMenuChat = this as AbleToAddInAttachmentMenuChat +inline fun Chat.requireAbleToAddInAttachmentMenuChat(): AbleToAddInAttachmentMenuChat = + this as AbleToAddInAttachmentMenuChat @PreviewFeature -inline fun CallbackQuery.whenDataCallbackQuery(block: (DataCallbackQuery) -> T) = asDataCallbackQuery() ?.let(block) +inline fun CallbackQuery.whenDataCallbackQuery(block: (DataCallbackQuery) -> T) = asDataCallbackQuery()?.let(block) @PreviewFeature inline fun CallbackQuery.asDataCallbackQuery(): DataCallbackQuery? = this as? DataCallbackQuery @@ -265,7 +269,8 @@ inline fun CallbackQuery.asDataCallbackQuery(): DataCallbackQuery? = this as? Da inline fun CallbackQuery.requireDataCallbackQuery(): DataCallbackQuery = this as DataCallbackQuery @PreviewFeature -inline fun CallbackQuery.whenGameShortNameCallbackQuery(block: (GameShortNameCallbackQuery) -> T) = asGameShortNameCallbackQuery() ?.let(block) +inline fun CallbackQuery.whenGameShortNameCallbackQuery(block: (GameShortNameCallbackQuery) -> T) = + asGameShortNameCallbackQuery()?.let(block) @PreviewFeature inline fun CallbackQuery.asGameShortNameCallbackQuery(): GameShortNameCallbackQuery? = @@ -276,7 +281,8 @@ inline fun CallbackQuery.requireGameShortNameCallbackQuery(): GameShortNameCallb this as GameShortNameCallbackQuery @PreviewFeature -inline fun CallbackQuery.whenInlineMessageIdCallbackQuery(block: (InlineMessageIdCallbackQuery) -> T) = asInlineMessageIdCallbackQuery() ?.let(block) +inline fun CallbackQuery.whenInlineMessageIdCallbackQuery(block: (InlineMessageIdCallbackQuery) -> T) = + asInlineMessageIdCallbackQuery()?.let(block) @PreviewFeature inline fun CallbackQuery.asInlineMessageIdCallbackQuery(): InlineMessageIdCallbackQuery? = @@ -287,7 +293,8 @@ inline fun CallbackQuery.requireInlineMessageIdCallbackQuery(): InlineMessageIdC this as InlineMessageIdCallbackQuery @PreviewFeature -inline fun CallbackQuery.whenInlineMessageIdDataCallbackQuery(block: (InlineMessageIdDataCallbackQuery) -> T) = asInlineMessageIdDataCallbackQuery() ?.let(block) +inline fun CallbackQuery.whenInlineMessageIdDataCallbackQuery(block: (InlineMessageIdDataCallbackQuery) -> T) = + asInlineMessageIdDataCallbackQuery()?.let(block) @PreviewFeature inline fun CallbackQuery.asInlineMessageIdDataCallbackQuery(): InlineMessageIdDataCallbackQuery? = @@ -298,7 +305,8 @@ inline fun CallbackQuery.requireInlineMessageIdDataCallbackQuery(): InlineMessag this as InlineMessageIdDataCallbackQuery @PreviewFeature -inline fun CallbackQuery.whenInlineMessageIdGameShortNameCallbackQuery(block: (InlineMessageIdGameShortNameCallbackQuery) -> T) = asInlineMessageIdGameShortNameCallbackQuery() ?.let(block) +inline fun CallbackQuery.whenInlineMessageIdGameShortNameCallbackQuery(block: (InlineMessageIdGameShortNameCallbackQuery) -> T) = + asInlineMessageIdGameShortNameCallbackQuery()?.let(block) @PreviewFeature inline fun CallbackQuery.asInlineMessageIdGameShortNameCallbackQuery(): InlineMessageIdGameShortNameCallbackQuery? = @@ -309,7 +317,8 @@ inline fun CallbackQuery.requireInlineMessageIdGameShortNameCallbackQuery(): Inl this as InlineMessageIdGameShortNameCallbackQuery @PreviewFeature -inline fun CallbackQuery.whenMessageCallbackQuery(block: (MessageCallbackQuery) -> T) = asMessageCallbackQuery() ?.let(block) +inline fun CallbackQuery.whenMessageCallbackQuery(block: (MessageCallbackQuery) -> T) = + asMessageCallbackQuery()?.let(block) @PreviewFeature inline fun CallbackQuery.asMessageCallbackQuery(): MessageCallbackQuery? = this as? MessageCallbackQuery @@ -318,7 +327,8 @@ inline fun CallbackQuery.asMessageCallbackQuery(): MessageCallbackQuery? = this inline fun CallbackQuery.requireMessageCallbackQuery(): MessageCallbackQuery = this as MessageCallbackQuery @PreviewFeature -inline fun CallbackQuery.whenMessageDataCallbackQuery(block: (MessageDataCallbackQuery) -> T) = asMessageDataCallbackQuery() ?.let(block) +inline fun CallbackQuery.whenMessageDataCallbackQuery(block: (MessageDataCallbackQuery) -> T) = + asMessageDataCallbackQuery()?.let(block) @PreviewFeature inline fun CallbackQuery.asMessageDataCallbackQuery(): MessageDataCallbackQuery? = this as? MessageDataCallbackQuery @@ -327,7 +337,8 @@ inline fun CallbackQuery.asMessageDataCallbackQuery(): MessageDataCallbackQuery? inline fun CallbackQuery.requireMessageDataCallbackQuery(): MessageDataCallbackQuery = this as MessageDataCallbackQuery @PreviewFeature -inline fun CallbackQuery.whenMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T) = asMessageGameShortNameCallbackQuery() ?.let(block) +inline fun CallbackQuery.whenMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T) = + asMessageGameShortNameCallbackQuery()?.let(block) @PreviewFeature inline fun CallbackQuery.asMessageGameShortNameCallbackQuery(): MessageGameShortNameCallbackQuery? = @@ -338,7 +349,8 @@ inline fun CallbackQuery.requireMessageGameShortNameCallbackQuery(): MessageGame this as MessageGameShortNameCallbackQuery @PreviewFeature -inline fun CallbackQuery.whenUnknownCallbackQueryType(block: (UnknownCallbackQueryType) -> T) = asUnknownCallbackQueryType() ?.let(block) +inline fun CallbackQuery.whenUnknownCallbackQueryType(block: (UnknownCallbackQueryType) -> T) = + asUnknownCallbackQueryType()?.let(block) @PreviewFeature inline fun CallbackQuery.asUnknownCallbackQueryType(): UnknownCallbackQueryType? = this as? UnknownCallbackQueryType @@ -347,7 +359,8 @@ inline fun CallbackQuery.asUnknownCallbackQueryType(): UnknownCallbackQueryType? inline fun CallbackQuery.requireUnknownCallbackQueryType(): UnknownCallbackQueryType = this as UnknownCallbackQueryType @PreviewFeature -inline fun PassportElementError.whenPassportElementErrorDataField(block: (PassportElementErrorDataField) -> T) = asPassportElementErrorDataField() ?.let(block) +inline fun PassportElementError.whenPassportElementErrorDataField(block: (PassportElementErrorDataField) -> T) = + asPassportElementErrorDataField()?.let(block) @PreviewFeature inline fun PassportElementError.asPassportElementErrorDataField(): PassportElementErrorDataField? = @@ -358,7 +371,8 @@ inline fun PassportElementError.requirePassportElementErrorDataField(): Passport this as PassportElementErrorDataField @PreviewFeature -inline fun PassportElementError.whenPassportElementErrorFile(block: (PassportElementErrorFile) -> T) = asPassportElementErrorFile() ?.let(block) +inline fun PassportElementError.whenPassportElementErrorFile(block: (PassportElementErrorFile) -> T) = + asPassportElementErrorFile()?.let(block) @PreviewFeature inline fun PassportElementError.asPassportElementErrorFile(): PassportElementErrorFile? = @@ -369,7 +383,8 @@ inline fun PassportElementError.requirePassportElementErrorFile(): PassportEleme this as PassportElementErrorFile @PreviewFeature -inline fun PassportElementError.whenPassportElementErrorFiles(block: (PassportElementErrorFiles) -> T) = asPassportElementErrorFiles() ?.let(block) +inline fun PassportElementError.whenPassportElementErrorFiles(block: (PassportElementErrorFiles) -> T) = + asPassportElementErrorFiles()?.let(block) @PreviewFeature inline fun PassportElementError.asPassportElementErrorFiles(): PassportElementErrorFiles? = @@ -380,7 +395,8 @@ inline fun PassportElementError.requirePassportElementErrorFiles(): PassportElem this as PassportElementErrorFiles @PreviewFeature -inline fun PassportElementError.whenPassportElementErrorFrontSide(block: (PassportElementErrorFrontSide) -> T) = asPassportElementErrorFrontSide() ?.let(block) +inline fun PassportElementError.whenPassportElementErrorFrontSide(block: (PassportElementErrorFrontSide) -> T) = + asPassportElementErrorFrontSide()?.let(block) @PreviewFeature inline fun PassportElementError.asPassportElementErrorFrontSide(): PassportElementErrorFrontSide? = @@ -391,7 +407,8 @@ inline fun PassportElementError.requirePassportElementErrorFrontSide(): Passport this as PassportElementErrorFrontSide @PreviewFeature -inline fun PassportElementError.whenPassportElementErrorReverseSide(block: (PassportElementErrorReverseSide) -> T) = asPassportElementErrorReverseSide() ?.let(block) +inline fun PassportElementError.whenPassportElementErrorReverseSide(block: (PassportElementErrorReverseSide) -> T) = + asPassportElementErrorReverseSide()?.let(block) @PreviewFeature inline fun PassportElementError.asPassportElementErrorReverseSide(): PassportElementErrorReverseSide? = @@ -402,7 +419,8 @@ inline fun PassportElementError.requirePassportElementErrorReverseSide(): Passpo this as PassportElementErrorReverseSide @PreviewFeature -inline fun PassportElementError.whenPassportElementErrorSelfie(block: (PassportElementErrorSelfie) -> T) = asPassportElementErrorSelfie() ?.let(block) +inline fun PassportElementError.whenPassportElementErrorSelfie(block: (PassportElementErrorSelfie) -> T) = + asPassportElementErrorSelfie()?.let(block) @PreviewFeature inline fun PassportElementError.asPassportElementErrorSelfie(): PassportElementErrorSelfie? = @@ -413,7 +431,8 @@ inline fun PassportElementError.requirePassportElementErrorSelfie(): PassportEle this as PassportElementErrorSelfie @PreviewFeature -inline fun PassportElementError.whenPassportElementErrorTranslationFile(block: (PassportElementErrorTranslationFile) -> T) = asPassportElementErrorTranslationFile() ?.let(block) +inline fun PassportElementError.whenPassportElementErrorTranslationFile(block: (PassportElementErrorTranslationFile) -> T) = + asPassportElementErrorTranslationFile()?.let(block) @PreviewFeature inline fun PassportElementError.asPassportElementErrorTranslationFile(): PassportElementErrorTranslationFile? = @@ -424,7 +443,8 @@ inline fun PassportElementError.requirePassportElementErrorTranslationFile(): Pa this as PassportElementErrorTranslationFile @PreviewFeature -inline fun PassportElementError.whenPassportElementErrorTranslationFiles(block: (PassportElementErrorTranslationFiles) -> T) = asPassportElementErrorTranslationFiles() ?.let(block) +inline fun PassportElementError.whenPassportElementErrorTranslationFiles(block: (PassportElementErrorTranslationFiles) -> T) = + asPassportElementErrorTranslationFiles()?.let(block) @PreviewFeature inline fun PassportElementError.asPassportElementErrorTranslationFiles(): PassportElementErrorTranslationFiles? = @@ -435,7 +455,8 @@ inline fun PassportElementError.requirePassportElementErrorTranslationFiles(): P this as PassportElementErrorTranslationFiles @PreviewFeature -inline fun PassportElementError.whenPassportElementErrorUnspecified(block: (PassportElementErrorUnspecified) -> T) = asPassportElementErrorUnspecified() ?.let(block) +inline fun PassportElementError.whenPassportElementErrorUnspecified(block: (PassportElementErrorUnspecified) -> T) = + asPassportElementErrorUnspecified()?.let(block) @PreviewFeature inline fun PassportElementError.asPassportElementErrorUnspecified(): PassportElementErrorUnspecified? = @@ -446,7 +467,8 @@ inline fun PassportElementError.requirePassportElementErrorUnspecified(): Passpo this as PassportElementErrorUnspecified @PreviewFeature -inline fun PassportElementError.whenPassportElementFileError(block: (PassportElementFileError) -> T) = asPassportElementFileError() ?.let(block) +inline fun PassportElementError.whenPassportElementFileError(block: (PassportElementFileError) -> T) = + asPassportElementFileError()?.let(block) @PreviewFeature inline fun PassportElementError.asPassportElementFileError(): PassportElementFileError? = @@ -457,7 +479,8 @@ inline fun PassportElementError.requirePassportElementFileError(): PassportEleme this as PassportElementFileError @PreviewFeature -inline fun PassportElementError.whenPassportElementFilesError(block: (PassportElementFilesError) -> T) = asPassportElementFilesError() ?.let(block) +inline fun PassportElementError.whenPassportElementFilesError(block: (PassportElementFilesError) -> T) = + asPassportElementFilesError()?.let(block) @PreviewFeature inline fun PassportElementError.asPassportElementFilesError(): PassportElementFilesError? = @@ -468,7 +491,8 @@ inline fun PassportElementError.requirePassportElementFilesError(): PassportElem this as PassportElementFilesError @PreviewFeature -inline fun PassportElementError.whenPassportMultipleElementsError(block: (PassportMultipleElementsError) -> T) = asPassportMultipleElementsError() ?.let(block) +inline fun PassportElementError.whenPassportMultipleElementsError(block: (PassportMultipleElementsError) -> T) = + asPassportMultipleElementsError()?.let(block) @PreviewFeature inline fun PassportElementError.asPassportMultipleElementsError(): PassportMultipleElementsError? = @@ -479,7 +503,8 @@ inline fun PassportElementError.requirePassportMultipleElementsError(): Passport this as PassportMultipleElementsError @PreviewFeature -inline fun PassportElementError.whenPassportSingleElementError(block: (PassportSingleElementError) -> T) = asPassportSingleElementError() ?.let(block) +inline fun PassportElementError.whenPassportSingleElementError(block: (PassportSingleElementError) -> T) = + asPassportSingleElementError()?.let(block) @PreviewFeature inline fun PassportElementError.asPassportSingleElementError(): PassportSingleElementError? = @@ -490,7 +515,8 @@ inline fun PassportElementError.requirePassportSingleElementError(): PassportSin this as PassportSingleElementError @PreviewFeature -inline fun PassportElementError.whenUnknownPassportElementError(block: (UnknownPassportElementError) -> T) = asUnknownPassportElementError() ?.let(block) +inline fun PassportElementError.whenUnknownPassportElementError(block: (UnknownPassportElementError) -> T) = + asUnknownPassportElementError()?.let(block) @PreviewFeature inline fun PassportElementError.asUnknownPassportElementError(): UnknownPassportElementError? = @@ -501,7 +527,7 @@ inline fun PassportElementError.requireUnknownPassportElementError(): UnknownPas this as UnknownPassportElementError @PreviewFeature -inline fun EncryptedPassportElement.whenBankStatement(block: (BankStatement) -> T) = asBankStatement() ?.let(block) +inline fun EncryptedPassportElement.whenBankStatement(block: (BankStatement) -> T) = asBankStatement()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asBankStatement(): BankStatement? = this as? BankStatement @@ -510,7 +536,8 @@ inline fun EncryptedPassportElement.asBankStatement(): BankStatement? = this as? inline fun EncryptedPassportElement.requireBankStatement(): BankStatement = this as BankStatement @PreviewFeature -inline fun EncryptedPassportElement.whenCommonPassport(block: (CommonPassport) -> T) = asCommonPassport() ?.let(block) +inline fun EncryptedPassportElement.whenCommonPassport(block: (CommonPassport) -> T) = + asCommonPassport()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asCommonPassport(): CommonPassport? = this as? CommonPassport @@ -519,7 +546,7 @@ inline fun EncryptedPassportElement.asCommonPassport(): CommonPassport? = this a inline fun EncryptedPassportElement.requireCommonPassport(): CommonPassport = this as CommonPassport @PreviewFeature -inline fun EncryptedPassportElement.whenDriverLicense(block: (DriverLicense) -> T) = asDriverLicense() ?.let(block) +inline fun EncryptedPassportElement.whenDriverLicense(block: (DriverLicense) -> T) = asDriverLicense()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asDriverLicense(): DriverLicense? = this as? DriverLicense @@ -528,7 +555,7 @@ inline fun EncryptedPassportElement.asDriverLicense(): DriverLicense? = this as? inline fun EncryptedPassportElement.requireDriverLicense(): DriverLicense = this as DriverLicense @PreviewFeature -inline fun EncryptedPassportElement.whenEmail(block: (Email) -> T) = asEmail() ?.let(block) +inline fun EncryptedPassportElement.whenEmail(block: (Email) -> T) = asEmail()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asEmail(): Email? = this as? Email @@ -537,7 +564,8 @@ inline fun EncryptedPassportElement.asEmail(): Email? = this as? Email inline fun EncryptedPassportElement.requireEmail(): Email = this as Email @PreviewFeature -inline fun EncryptedPassportElement.whenEncryptedAddress(block: (EncryptedAddress) -> T) = asEncryptedAddress() ?.let(block) +inline fun EncryptedPassportElement.whenEncryptedAddress(block: (EncryptedAddress) -> T) = + asEncryptedAddress()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asEncryptedAddress(): EncryptedAddress? = this as? EncryptedAddress @@ -546,7 +574,8 @@ inline fun EncryptedPassportElement.asEncryptedAddress(): EncryptedAddress? = th inline fun EncryptedPassportElement.requireEncryptedAddress(): EncryptedAddress = this as EncryptedAddress @PreviewFeature -inline fun EncryptedPassportElement.whenEncryptedPersonalDetails(block: (EncryptedPersonalDetails) -> T) = asEncryptedPersonalDetails() ?.let(block) +inline fun EncryptedPassportElement.whenEncryptedPersonalDetails(block: (EncryptedPersonalDetails) -> T) = + asEncryptedPersonalDetails()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asEncryptedPersonalDetails(): EncryptedPersonalDetails? = @@ -557,7 +586,7 @@ inline fun EncryptedPassportElement.requireEncryptedPersonalDetails(): Encrypted this as EncryptedPersonalDetails @PreviewFeature -inline fun EncryptedPassportElement.whenIdentityCard(block: (IdentityCard) -> T) = asIdentityCard() ?.let(block) +inline fun EncryptedPassportElement.whenIdentityCard(block: (IdentityCard) -> T) = asIdentityCard()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asIdentityCard(): IdentityCard? = this as? IdentityCard @@ -566,7 +595,8 @@ inline fun EncryptedPassportElement.asIdentityCard(): IdentityCard? = this as? I inline fun EncryptedPassportElement.requireIdentityCard(): IdentityCard = this as IdentityCard @PreviewFeature -inline fun EncryptedPassportElement.whenInternalPassport(block: (InternalPassport) -> T) = asInternalPassport() ?.let(block) +inline fun EncryptedPassportElement.whenInternalPassport(block: (InternalPassport) -> T) = + asInternalPassport()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asInternalPassport(): InternalPassport? = this as? InternalPassport @@ -575,7 +605,7 @@ inline fun EncryptedPassportElement.asInternalPassport(): InternalPassport? = th inline fun EncryptedPassportElement.requireInternalPassport(): InternalPassport = this as InternalPassport @PreviewFeature -inline fun EncryptedPassportElement.whenPassport(block: (Passport) -> T) = asPassport() ?.let(block) +inline fun EncryptedPassportElement.whenPassport(block: (Passport) -> T) = asPassport()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asPassport(): Passport? = this as? Passport @@ -584,7 +614,8 @@ inline fun EncryptedPassportElement.asPassport(): Passport? = this as? Passport inline fun EncryptedPassportElement.requirePassport(): Passport = this as Passport @PreviewFeature -inline fun EncryptedPassportElement.whenPassportRegistration(block: (PassportRegistration) -> T) = asPassportRegistration() ?.let(block) +inline fun EncryptedPassportElement.whenPassportRegistration(block: (PassportRegistration) -> T) = + asPassportRegistration()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asPassportRegistration(): PassportRegistration? = this as? PassportRegistration @@ -593,7 +624,7 @@ inline fun EncryptedPassportElement.asPassportRegistration(): PassportRegistrati inline fun EncryptedPassportElement.requirePassportRegistration(): PassportRegistration = this as PassportRegistration @PreviewFeature -inline fun EncryptedPassportElement.whenPhoneNumber(block: (PhoneNumber) -> T) = asPhoneNumber() ?.let(block) +inline fun EncryptedPassportElement.whenPhoneNumber(block: (PhoneNumber) -> T) = asPhoneNumber()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asPhoneNumber(): PhoneNumber? = this as? PhoneNumber @@ -602,7 +633,8 @@ inline fun EncryptedPassportElement.asPhoneNumber(): PhoneNumber? = this as? Pho inline fun EncryptedPassportElement.requirePhoneNumber(): PhoneNumber = this as PhoneNumber @PreviewFeature -inline fun EncryptedPassportElement.whenRentalAgreement(block: (RentalAgreement) -> T) = asRentalAgreement() ?.let(block) +inline fun EncryptedPassportElement.whenRentalAgreement(block: (RentalAgreement) -> T) = + asRentalAgreement()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asRentalAgreement(): RentalAgreement? = this as? RentalAgreement @@ -611,7 +643,8 @@ inline fun EncryptedPassportElement.asRentalAgreement(): RentalAgreement? = this inline fun EncryptedPassportElement.requireRentalAgreement(): RentalAgreement = this as RentalAgreement @PreviewFeature -inline fun EncryptedPassportElement.whenTemporaryRegistration(block: (TemporaryRegistration) -> T) = asTemporaryRegistration() ?.let(block) +inline fun EncryptedPassportElement.whenTemporaryRegistration(block: (TemporaryRegistration) -> T) = + asTemporaryRegistration()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asTemporaryRegistration(): TemporaryRegistration? = this as? TemporaryRegistration @@ -621,7 +654,8 @@ inline fun EncryptedPassportElement.requireTemporaryRegistration(): TemporaryReg this as TemporaryRegistration @PreviewFeature -inline fun EncryptedPassportElement.whenEncryptedPassportElementWithTranslatableFilesCollection(block: (EncryptedPassportElementWithTranslatableFilesCollection) -> T) = asEncryptedPassportElementWithTranslatableFilesCollection() ?.let(block) +inline fun EncryptedPassportElement.whenEncryptedPassportElementWithTranslatableFilesCollection(block: (EncryptedPassportElementWithTranslatableFilesCollection) -> T) = + asEncryptedPassportElementWithTranslatableFilesCollection()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asEncryptedPassportElementWithTranslatableFilesCollection(): EncryptedPassportElementWithTranslatableFilesCollection? = @@ -632,7 +666,8 @@ inline fun EncryptedPassportElement.requireEncryptedPassportElementWithTranslata this as EncryptedPassportElementWithTranslatableFilesCollection @PreviewFeature -inline fun EncryptedPassportElement.whenEncryptedPassportElementWithTranslatableIDDocument(block: (EncryptedPassportElementWithTranslatableIDDocument) -> T) = asEncryptedPassportElementWithTranslatableIDDocument() ?.let(block) +inline fun EncryptedPassportElement.whenEncryptedPassportElementWithTranslatableIDDocument(block: (EncryptedPassportElementWithTranslatableIDDocument) -> T) = + asEncryptedPassportElementWithTranslatableIDDocument()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asEncryptedPassportElementWithTranslatableIDDocument(): EncryptedPassportElementWithTranslatableIDDocument? = @@ -643,7 +678,7 @@ inline fun EncryptedPassportElement.requireEncryptedPassportElementWithTranslata this as EncryptedPassportElementWithTranslatableIDDocument @PreviewFeature -inline fun EncryptedPassportElement.whenUtilityBill(block: (UtilityBill) -> T) = asUtilityBill() ?.let(block) +inline fun EncryptedPassportElement.whenUtilityBill(block: (UtilityBill) -> T) = asUtilityBill()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asUtilityBill(): UtilityBill? = this as? UtilityBill @@ -652,7 +687,8 @@ inline fun EncryptedPassportElement.asUtilityBill(): UtilityBill? = this as? Uti inline fun EncryptedPassportElement.requireUtilityBill(): UtilityBill = this as UtilityBill @PreviewFeature -inline fun EncryptedPassportElement.whenEncryptedPassportElementWithFilesCollection(block: (EncryptedPassportElementWithFilesCollection) -> T) = asEncryptedPassportElementWithFilesCollection() ?.let(block) +inline fun EncryptedPassportElement.whenEncryptedPassportElementWithFilesCollection(block: (EncryptedPassportElementWithFilesCollection) -> T) = + asEncryptedPassportElementWithFilesCollection()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asEncryptedPassportElementWithFilesCollection(): EncryptedPassportElementWithFilesCollection? = @@ -663,7 +699,8 @@ inline fun EncryptedPassportElement.requireEncryptedPassportElementWithFilesColl this as EncryptedPassportElementWithFilesCollection @PreviewFeature -inline fun EncryptedPassportElement.whenEncryptedPassportElementTranslatable(block: (EncryptedPassportElementTranslatable) -> T) = asEncryptedPassportElementTranslatable() ?.let(block) +inline fun EncryptedPassportElement.whenEncryptedPassportElementTranslatable(block: (EncryptedPassportElementTranslatable) -> T) = + asEncryptedPassportElementTranslatable()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asEncryptedPassportElementTranslatable(): EncryptedPassportElementTranslatable? = @@ -674,7 +711,8 @@ inline fun EncryptedPassportElement.requireEncryptedPassportElementTranslatable( this as EncryptedPassportElementTranslatable @PreviewFeature -inline fun EncryptedPassportElement.whenUnknownEncryptedPassportElement(block: (UnknownEncryptedPassportElement) -> T) = asUnknownEncryptedPassportElement() ?.let(block) +inline fun EncryptedPassportElement.whenUnknownEncryptedPassportElement(block: (UnknownEncryptedPassportElement) -> T) = + asUnknownEncryptedPassportElement()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asUnknownEncryptedPassportElement(): UnknownEncryptedPassportElement? = @@ -685,7 +723,8 @@ inline fun EncryptedPassportElement.requireUnknownEncryptedPassportElement(): Un this as UnknownEncryptedPassportElement @PreviewFeature -inline fun EncryptedPassportElement.whenEncryptedPassportElementWithData(block: (EncryptedPassportElementWithData) -> T) = asEncryptedPassportElementWithData() ?.let(block) +inline fun EncryptedPassportElement.whenEncryptedPassportElementWithData(block: (EncryptedPassportElementWithData) -> T) = + asEncryptedPassportElementWithData()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asEncryptedPassportElementWithData(): EncryptedPassportElementWithData? = @@ -696,7 +735,8 @@ inline fun EncryptedPassportElement.requireEncryptedPassportElementWithData(): E this as EncryptedPassportElementWithData @PreviewFeature -inline fun EncryptedPassportElement.whenEncryptedPassportElementWithEmail(block: (EncryptedPassportElementWithEmail) -> T) = asEncryptedPassportElementWithEmail() ?.let(block) +inline fun EncryptedPassportElement.whenEncryptedPassportElementWithEmail(block: (EncryptedPassportElementWithEmail) -> T) = + asEncryptedPassportElementWithEmail()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asEncryptedPassportElementWithEmail(): EncryptedPassportElementWithEmail? = @@ -707,7 +747,8 @@ inline fun EncryptedPassportElement.requireEncryptedPassportElementWithEmail(): this as EncryptedPassportElementWithEmail @PreviewFeature -inline fun EncryptedPassportElement.whenEncryptedPassportElementWithFrontSide(block: (EncryptedPassportElementWithFrontSide) -> T) = asEncryptedPassportElementWithFrontSide() ?.let(block) +inline fun EncryptedPassportElement.whenEncryptedPassportElementWithFrontSide(block: (EncryptedPassportElementWithFrontSide) -> T) = + asEncryptedPassportElementWithFrontSide()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asEncryptedPassportElementWithFrontSide(): EncryptedPassportElementWithFrontSide? = @@ -718,7 +759,8 @@ inline fun EncryptedPassportElement.requireEncryptedPassportElementWithFrontSide this as EncryptedPassportElementWithFrontSide @PreviewFeature -inline fun EncryptedPassportElement.whenEncryptedPassportElementWithPhoneNumber(block: (EncryptedPassportElementWithPhoneNumber) -> T) = asEncryptedPassportElementWithPhoneNumber() ?.let(block) +inline fun EncryptedPassportElement.whenEncryptedPassportElementWithPhoneNumber(block: (EncryptedPassportElementWithPhoneNumber) -> T) = + asEncryptedPassportElementWithPhoneNumber()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asEncryptedPassportElementWithPhoneNumber(): EncryptedPassportElementWithPhoneNumber? = @@ -729,7 +771,8 @@ inline fun EncryptedPassportElement.requireEncryptedPassportElementWithPhoneNumb this as EncryptedPassportElementWithPhoneNumber @PreviewFeature -inline fun EncryptedPassportElement.whenEncryptedPassportElementWithReverseSide(block: (EncryptedPassportElementWithReverseSide) -> T) = asEncryptedPassportElementWithReverseSide() ?.let(block) +inline fun EncryptedPassportElement.whenEncryptedPassportElementWithReverseSide(block: (EncryptedPassportElementWithReverseSide) -> T) = + asEncryptedPassportElementWithReverseSide()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asEncryptedPassportElementWithReverseSide(): EncryptedPassportElementWithReverseSide? = @@ -740,7 +783,8 @@ inline fun EncryptedPassportElement.requireEncryptedPassportElementWithReverseSi this as EncryptedPassportElementWithReverseSide @PreviewFeature -inline fun EncryptedPassportElement.whenEncryptedPassportElementWithSelfie(block: (EncryptedPassportElementWithSelfie) -> T) = asEncryptedPassportElementWithSelfie() ?.let(block) +inline fun EncryptedPassportElement.whenEncryptedPassportElementWithSelfie(block: (EncryptedPassportElementWithSelfie) -> T) = + asEncryptedPassportElementWithSelfie()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.asEncryptedPassportElementWithSelfie(): EncryptedPassportElementWithSelfie? = @@ -751,7 +795,7 @@ inline fun EncryptedPassportElement.requireEncryptedPassportElementWithSelfie(): this as EncryptedPassportElementWithSelfie @PreviewFeature -inline fun SecureValue.whenAddressSecureValue(block: (AddressSecureValue) -> T) = asAddressSecureValue() ?.let(block) +inline fun SecureValue.whenAddressSecureValue(block: (AddressSecureValue) -> T) = asAddressSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asAddressSecureValue(): AddressSecureValue? = this as? AddressSecureValue @@ -760,7 +804,8 @@ inline fun SecureValue.asAddressSecureValue(): AddressSecureValue? = this as? Ad inline fun SecureValue.requireAddressSecureValue(): AddressSecureValue = this as AddressSecureValue @PreviewFeature -inline fun SecureValue.whenBankStatementSecureValue(block: (BankStatementSecureValue) -> T) = asBankStatementSecureValue() ?.let(block) +inline fun SecureValue.whenBankStatementSecureValue(block: (BankStatementSecureValue) -> T) = + asBankStatementSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asBankStatementSecureValue(): BankStatementSecureValue? = this as? BankStatementSecureValue @@ -769,7 +814,8 @@ inline fun SecureValue.asBankStatementSecureValue(): BankStatementSecureValue? = inline fun SecureValue.requireBankStatementSecureValue(): BankStatementSecureValue = this as BankStatementSecureValue @PreviewFeature -inline fun SecureValue.whenCommonPassportSecureValue(block: (CommonPassportSecureValue) -> T) = asCommonPassportSecureValue() ?.let(block) +inline fun SecureValue.whenCommonPassportSecureValue(block: (CommonPassportSecureValue) -> T) = + asCommonPassportSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asCommonPassportSecureValue(): CommonPassportSecureValue? = this as? CommonPassportSecureValue @@ -778,7 +824,8 @@ inline fun SecureValue.asCommonPassportSecureValue(): CommonPassportSecureValue? inline fun SecureValue.requireCommonPassportSecureValue(): CommonPassportSecureValue = this as CommonPassportSecureValue @PreviewFeature -inline fun SecureValue.whenDriverLicenseSecureValue(block: (DriverLicenseSecureValue) -> T) = asDriverLicenseSecureValue() ?.let(block) +inline fun SecureValue.whenDriverLicenseSecureValue(block: (DriverLicenseSecureValue) -> T) = + asDriverLicenseSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asDriverLicenseSecureValue(): DriverLicenseSecureValue? = this as? DriverLicenseSecureValue @@ -787,7 +834,8 @@ inline fun SecureValue.asDriverLicenseSecureValue(): DriverLicenseSecureValue? = inline fun SecureValue.requireDriverLicenseSecureValue(): DriverLicenseSecureValue = this as DriverLicenseSecureValue @PreviewFeature -inline fun SecureValue.whenIdentityCardSecureValue(block: (IdentityCardSecureValue) -> T) = asIdentityCardSecureValue() ?.let(block) +inline fun SecureValue.whenIdentityCardSecureValue(block: (IdentityCardSecureValue) -> T) = + asIdentityCardSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asIdentityCardSecureValue(): IdentityCardSecureValue? = this as? IdentityCardSecureValue @@ -796,7 +844,8 @@ inline fun SecureValue.asIdentityCardSecureValue(): IdentityCardSecureValue? = t inline fun SecureValue.requireIdentityCardSecureValue(): IdentityCardSecureValue = this as IdentityCardSecureValue @PreviewFeature -inline fun SecureValue.whenIdentityWithReverseSideSecureValue(block: (IdentityWithReverseSideSecureValue) -> T) = asIdentityWithReverseSideSecureValue() ?.let(block) +inline fun SecureValue.whenIdentityWithReverseSideSecureValue(block: (IdentityWithReverseSideSecureValue) -> T) = + asIdentityWithReverseSideSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asIdentityWithReverseSideSecureValue(): IdentityWithReverseSideSecureValue? = @@ -807,7 +856,8 @@ inline fun SecureValue.requireIdentityWithReverseSideSecureValue(): IdentityWith this as IdentityWithReverseSideSecureValue @PreviewFeature -inline fun SecureValue.whenInternalPassportSecureValue(block: (InternalPassportSecureValue) -> T) = asInternalPassportSecureValue() ?.let(block) +inline fun SecureValue.whenInternalPassportSecureValue(block: (InternalPassportSecureValue) -> T) = + asInternalPassportSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asInternalPassportSecureValue(): InternalPassportSecureValue? = @@ -818,7 +868,8 @@ inline fun SecureValue.requireInternalPassportSecureValue(): InternalPassportSec this as InternalPassportSecureValue @PreviewFeature -inline fun SecureValue.whenOtherDocumentsSecureValue(block: (OtherDocumentsSecureValue) -> T) = asOtherDocumentsSecureValue() ?.let(block) +inline fun SecureValue.whenOtherDocumentsSecureValue(block: (OtherDocumentsSecureValue) -> T) = + asOtherDocumentsSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asOtherDocumentsSecureValue(): OtherDocumentsSecureValue? = this as? OtherDocumentsSecureValue @@ -827,7 +878,8 @@ inline fun SecureValue.asOtherDocumentsSecureValue(): OtherDocumentsSecureValue? inline fun SecureValue.requireOtherDocumentsSecureValue(): OtherDocumentsSecureValue = this as OtherDocumentsSecureValue @PreviewFeature -inline fun SecureValue.whenPassportRegistrationSecureValue(block: (PassportRegistrationSecureValue) -> T) = asPassportRegistrationSecureValue() ?.let(block) +inline fun SecureValue.whenPassportRegistrationSecureValue(block: (PassportRegistrationSecureValue) -> T) = + asPassportRegistrationSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asPassportRegistrationSecureValue(): PassportRegistrationSecureValue? = @@ -838,7 +890,8 @@ inline fun SecureValue.requirePassportRegistrationSecureValue(): PassportRegistr this as PassportRegistrationSecureValue @PreviewFeature -inline fun SecureValue.whenPassportSecureValue(block: (PassportSecureValue) -> T) = asPassportSecureValue() ?.let(block) +inline fun SecureValue.whenPassportSecureValue(block: (PassportSecureValue) -> T) = + asPassportSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asPassportSecureValue(): PassportSecureValue? = this as? PassportSecureValue @@ -847,7 +900,8 @@ inline fun SecureValue.asPassportSecureValue(): PassportSecureValue? = this as? inline fun SecureValue.requirePassportSecureValue(): PassportSecureValue = this as PassportSecureValue @PreviewFeature -inline fun SecureValue.whenPersonalDetailsSecureValue(block: (PersonalDetailsSecureValue) -> T) = asPersonalDetailsSecureValue() ?.let(block) +inline fun SecureValue.whenPersonalDetailsSecureValue(block: (PersonalDetailsSecureValue) -> T) = + asPersonalDetailsSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asPersonalDetailsSecureValue(): PersonalDetailsSecureValue? = this as? PersonalDetailsSecureValue @@ -857,7 +911,8 @@ inline fun SecureValue.requirePersonalDetailsSecureValue(): PersonalDetailsSecur this as PersonalDetailsSecureValue @PreviewFeature -inline fun SecureValue.whenRentalAgreementSecureValue(block: (RentalAgreementSecureValue) -> T) = asRentalAgreementSecureValue() ?.let(block) +inline fun SecureValue.whenRentalAgreementSecureValue(block: (RentalAgreementSecureValue) -> T) = + asRentalAgreementSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asRentalAgreementSecureValue(): RentalAgreementSecureValue? = this as? RentalAgreementSecureValue @@ -867,7 +922,8 @@ inline fun SecureValue.requireRentalAgreementSecureValue(): RentalAgreementSecur this as RentalAgreementSecureValue @PreviewFeature -inline fun SecureValue.whenTemporalRegistrationSecureValue(block: (TemporalRegistrationSecureValue) -> T) = asTemporalRegistrationSecureValue() ?.let(block) +inline fun SecureValue.whenTemporalRegistrationSecureValue(block: (TemporalRegistrationSecureValue) -> T) = + asTemporalRegistrationSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asTemporalRegistrationSecureValue(): TemporalRegistrationSecureValue? = @@ -878,7 +934,8 @@ inline fun SecureValue.requireTemporalRegistrationSecureValue(): TemporalRegistr this as TemporalRegistrationSecureValue @PreviewFeature -inline fun SecureValue.whenUtilityBillSecureValue(block: (UtilityBillSecureValue) -> T) = asUtilityBillSecureValue() ?.let(block) +inline fun SecureValue.whenUtilityBillSecureValue(block: (UtilityBillSecureValue) -> T) = + asUtilityBillSecureValue()?.let(block) @PreviewFeature inline fun SecureValue.asUtilityBillSecureValue(): UtilityBillSecureValue? = this as? UtilityBillSecureValue @@ -887,7 +944,8 @@ inline fun SecureValue.asUtilityBillSecureValue(): UtilityBillSecureValue? = thi inline fun SecureValue.requireUtilityBillSecureValue(): UtilityBillSecureValue = this as UtilityBillSecureValue @PreviewFeature -inline fun SecureValue.whenSecureValueIdentity(block: (SecureValueIdentity) -> T) = asSecureValueIdentity() ?.let(block) +inline fun SecureValue.whenSecureValueIdentity(block: (SecureValueIdentity) -> T) = + asSecureValueIdentity()?.let(block) @PreviewFeature inline fun SecureValue.asSecureValueIdentity(): SecureValueIdentity? = this as? SecureValueIdentity @@ -896,7 +954,8 @@ inline fun SecureValue.asSecureValueIdentity(): SecureValueIdentity? = this as? inline fun SecureValue.requireSecureValueIdentity(): SecureValueIdentity = this as SecureValueIdentity @PreviewFeature -inline fun SecureValue.whenSecureValueWithData(block: (SecureValueWithData) -> T) = asSecureValueWithData() ?.let(block) +inline fun SecureValue.whenSecureValueWithData(block: (SecureValueWithData) -> T) = + asSecureValueWithData()?.let(block) @PreviewFeature inline fun SecureValue.asSecureValueWithData(): SecureValueWithData? = this as? SecureValueWithData @@ -905,7 +964,8 @@ inline fun SecureValue.asSecureValueWithData(): SecureValueWithData? = this as? inline fun SecureValue.requireSecureValueWithData(): SecureValueWithData = this as SecureValueWithData @PreviewFeature -inline fun SecureValue.whenSecureValueWithFiles(block: (SecureValueWithFiles) -> T) = asSecureValueWithFiles() ?.let(block) +inline fun SecureValue.whenSecureValueWithFiles(block: (SecureValueWithFiles) -> T) = + asSecureValueWithFiles()?.let(block) @PreviewFeature inline fun SecureValue.asSecureValueWithFiles(): SecureValueWithFiles? = this as? SecureValueWithFiles @@ -914,7 +974,8 @@ inline fun SecureValue.asSecureValueWithFiles(): SecureValueWithFiles? = this as inline fun SecureValue.requireSecureValueWithFiles(): SecureValueWithFiles = this as SecureValueWithFiles @PreviewFeature -inline fun SecureValue.whenSecureValueWithReverseSide(block: (SecureValueWithReverseSide) -> T) = asSecureValueWithReverseSide() ?.let(block) +inline fun SecureValue.whenSecureValueWithReverseSide(block: (SecureValueWithReverseSide) -> T) = + asSecureValueWithReverseSide()?.let(block) @PreviewFeature inline fun SecureValue.asSecureValueWithReverseSide(): SecureValueWithReverseSide? = this as? SecureValueWithReverseSide @@ -924,7 +985,8 @@ inline fun SecureValue.requireSecureValueWithReverseSide(): SecureValueWithRever this as SecureValueWithReverseSide @PreviewFeature -inline fun SecureValue.whenSecureValueWithTranslations(block: (SecureValueWithTranslations) -> T) = asSecureValueWithTranslations() ?.let(block) +inline fun SecureValue.whenSecureValueWithTranslations(block: (SecureValueWithTranslations) -> T) = + asSecureValueWithTranslations()?.let(block) @PreviewFeature inline fun SecureValue.asSecureValueWithTranslations(): SecureValueWithTranslations? = @@ -935,7 +997,8 @@ inline fun SecureValue.requireSecureValueWithTranslations(): SecureValueWithTran this as SecureValueWithTranslations @PreviewFeature -inline fun Message.whenAnonymousGroupContentMessageImpl(block: (AnonymousGroupContentMessageImpl) -> T) = asAnonymousGroupContentMessageImpl() ?.let(block) +inline fun Message.whenAnonymousGroupContentMessageImpl(block: (AnonymousGroupContentMessageImpl) -> T) = + asAnonymousGroupContentMessageImpl()?.let(block) @PreviewFeature inline fun Message.asAnonymousGroupContentMessageImpl(): AnonymousGroupContentMessageImpl? = @@ -946,7 +1009,8 @@ inline fun Message.requireAnonymousGroupContentMessageImpl(): AnonymousGroupCont this as AnonymousGroupContentMessageImpl @PreviewFeature -inline fun Message.whenChannelContentMessageImpl(block: (UnconnectedFromChannelGroupContentMessageImpl) -> T) = asChannelContentMessageImpl() ?.let(block) +inline fun Message.whenChannelContentMessageImpl(block: (UnconnectedFromChannelGroupContentMessageImpl) -> T) = + asChannelContentMessageImpl()?.let(block) @PreviewFeature inline fun Message.asChannelContentMessageImpl(): UnconnectedFromChannelGroupContentMessageImpl? = @@ -957,7 +1021,7 @@ inline fun Message.requireChannelContentMessageImpl(): UnconnectedFromChannelGro this as UnconnectedFromChannelGroupContentMessageImpl @PreviewFeature -inline fun Message.whenPassportMessage(block: (PassportMessage) -> T) = asPassportMessage() ?.let(block) +inline fun Message.whenPassportMessage(block: (PassportMessage) -> T) = asPassportMessage()?.let(block) @PreviewFeature inline fun Message.asPassportMessage(): PassportMessage? = this as? PassportMessage @@ -966,7 +1030,8 @@ inline fun Message.asPassportMessage(): PassportMessage? = this as? PassportMess inline fun Message.requirePassportMessage(): PassportMessage = this as PassportMessage @PreviewFeature -inline fun Message.whenPrivateContentMessageImpl(block: (PrivateContentMessageImpl) -> T) = asPrivateContentMessageImpl() ?.let(block) +inline fun Message.whenPrivateContentMessageImpl(block: (PrivateContentMessageImpl) -> T) = + asPrivateContentMessageImpl()?.let(block) @PreviewFeature inline fun Message.asPrivateContentMessageImpl(): PrivateContentMessageImpl? = @@ -977,7 +1042,8 @@ inline fun Message.requirePrivateContentMessageImpl(): PrivateContentMessageImpl this as PrivateContentMessageImpl @PreviewFeature -inline fun Message.whenChannelEventMessage(block: (ChannelEventMessage) -> T) = asChannelEventMessage() ?.let(block) +inline fun Message.whenChannelEventMessage(block: (ChannelEventMessage) -> T) = + asChannelEventMessage()?.let(block) @PreviewFeature inline fun Message.asChannelEventMessage(): ChannelEventMessage? = @@ -988,7 +1054,8 @@ inline fun Message.requireChannelEventMessage(): ChannelEventMessage @PreviewFeature -inline fun Message.whenChannelMediaGroupMessage(block: (ChannelMediaGroupMessage) -> T) = asChannelMediaGroupMessage() ?.let(block) +inline fun Message.whenChannelMediaGroupMessage(block: (ChannelMediaGroupMessage) -> T) = + asChannelMediaGroupMessage()?.let(block) @PreviewFeature inline fun Message.asChannelMediaGroupMessage(): ChannelMediaGroupMessage? = @@ -999,7 +1066,8 @@ inline fun Message.requireChannelMediaGroupMessage(): ChannelMediaGroupMessage @PreviewFeature -inline fun Message.whenCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T) = asCommonGroupEventMessage() ?.let(block) +inline fun Message.whenCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T) = + asCommonGroupEventMessage()?.let(block) @PreviewFeature inline fun Message.asCommonGroupEventMessage(): CommonGroupEventMessage? = @@ -1010,7 +1078,8 @@ inline fun Message.requireCommonGroupEventMessage(): CommonGroupEventMessage @PreviewFeature -inline fun Message.whenCommonMediaGroupMessage(block: (CommonMediaGroupMessage) -> T) = asCommonMediaGroupMessage() ?.let(block) +inline fun Message.whenCommonMediaGroupMessage(block: (CommonMediaGroupMessage) -> T) = + asCommonMediaGroupMessage()?.let(block) @PreviewFeature inline fun Message.asCommonMediaGroupMessage(): CommonMediaGroupMessage? = @@ -1021,7 +1090,8 @@ inline fun Message.requireCommonMediaGroupMessage(): CommonMediaGroupMessage @PreviewFeature -inline fun Message.whenCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T) = asCommonSupergroupEventMessage() ?.let(block) +inline fun Message.whenCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T) = + asCommonSupergroupEventMessage()?.let(block) @PreviewFeature inline fun Message.asCommonSupergroupEventMessage(): CommonSupergroupEventMessage? = @@ -1032,7 +1102,8 @@ inline fun Message.requireCommonSupergroupEventMessage(): CommonSupergroupEventM this as CommonSupergroupEventMessage @PreviewFeature -inline fun Message.whenAnonymousGroupContentMessage(block: (AnonymousGroupContentMessage) -> T) = asAnonymousGroupContentMessage() ?.let(block) +inline fun Message.whenAnonymousGroupContentMessage(block: (AnonymousGroupContentMessage) -> T) = + asAnonymousGroupContentMessage()?.let(block) @PreviewFeature inline fun Message.asAnonymousGroupContentMessage(): AnonymousGroupContentMessage? = @@ -1043,7 +1114,8 @@ inline fun Message.requireAnonymousGroupContentMessage(): AnonymousGroupContentM this as AnonymousGroupContentMessage @PreviewFeature -inline fun Message.whenChannelContentMessage(block: (ChannelContentMessage) -> T) = asChannelContentMessage() ?.let(block) +inline fun Message.whenChannelContentMessage(block: (ChannelContentMessage) -> T) = + asChannelContentMessage()?.let(block) @PreviewFeature inline fun Message.asChannelContentMessage(): ChannelContentMessage? = @@ -1054,7 +1126,8 @@ inline fun Message.requireChannelContentMessage(): ChannelContentMessage @PreviewFeature -inline fun Message.whenConnectedFromChannelGroupContentMessage(block: (ConnectedFromChannelGroupContentMessage) -> T) = asConnectedFromChannelGroupContentMessage() ?.let(block) +inline fun Message.whenConnectedFromChannelGroupContentMessage(block: (ConnectedFromChannelGroupContentMessage) -> T) = + asConnectedFromChannelGroupContentMessage()?.let(block) @PreviewFeature inline fun Message.asConnectedFromChannelGroupContentMessage(): ConnectedFromChannelGroupContentMessage? = @@ -1065,7 +1138,8 @@ inline fun Message.requireConnectedFromChannelGroupContentMessage(): ConnectedFr this as ConnectedFromChannelGroupContentMessage @PreviewFeature -inline fun Message.whenUnconnectedFromChannelGroupContentMessage(block: (UnconnectedFromChannelGroupContentMessage) -> T) = asUnconnectedFromChannelGroupContentMessage() ?.let(block) +inline fun Message.whenUnconnectedFromChannelGroupContentMessage(block: (UnconnectedFromChannelGroupContentMessage) -> T) = + asUnconnectedFromChannelGroupContentMessage()?.let(block) @PreviewFeature inline fun Message.asUnconnectedFromChannelGroupContentMessage(): UnconnectedFromChannelGroupContentMessage? = @@ -1076,7 +1150,8 @@ inline fun Message.requireUnconnectedFromChannelGroupContentMessage(): Unconnect this as UnconnectedFromChannelGroupContentMessage @PreviewFeature -inline fun Message.whenChatEventMessage(block: (ChatEventMessage) -> T) = asChatEventMessage() ?.let(block) +inline fun Message.whenChatEventMessage(block: (ChatEventMessage) -> T) = + asChatEventMessage()?.let(block) @PreviewFeature inline fun Message.asChatEventMessage(): ChatEventMessage? = this as? ChatEventMessage @@ -1085,7 +1160,8 @@ inline fun Message.asChatEventMessage(): ChatEventMessage? = this as? inline fun Message.requireChatEventMessage(): ChatEventMessage = this as ChatEventMessage @PreviewFeature -inline fun Message.whenCommonGroupContentMessage(block: (CommonGroupContentMessage) -> T) = asCommonGroupContentMessage() ?.let(block) +inline fun Message.whenCommonGroupContentMessage(block: (CommonGroupContentMessage) -> T) = + asCommonGroupContentMessage()?.let(block) @PreviewFeature inline fun Message.asCommonGroupContentMessage(): CommonGroupContentMessage? = @@ -1096,7 +1172,7 @@ inline fun Message.requireCommonGroupContentMessage(): CommonGroupContentMessage this as CommonGroupContentMessage @PreviewFeature -inline fun Message.whenCommonMessage(block: (CommonMessage) -> T) = asCommonMessage() ?.let(block) +inline fun Message.whenCommonMessage(block: (CommonMessage) -> T) = asCommonMessage()?.let(block) @PreviewFeature inline fun Message.asCommonMessage(): CommonMessage? = this as? CommonMessage @@ -1105,7 +1181,7 @@ inline fun Message.asCommonMessage(): CommonMessage? = this as? inline fun Message.requireCommonMessage(): CommonMessage = this as CommonMessage @PreviewFeature -inline fun Message.whenContentMessage(block: (ContentMessage) -> T) = asContentMessage() ?.let(block) +inline fun Message.whenContentMessage(block: (ContentMessage) -> T) = asContentMessage()?.let(block) @PreviewFeature inline fun Message.asContentMessage(): ContentMessage? = this as? ContentMessage @@ -1114,7 +1190,8 @@ inline fun Message.asContentMessage(): ContentMessage? = this as inline fun Message.requireContentMessage(): ContentMessage = this as ContentMessage @PreviewFeature -inline fun Message.whenFromChannelGroupContentMessage(block: (FromChannelGroupContentMessage) -> T) = asFromChannelGroupContentMessage() ?.let(block) +inline fun Message.whenFromChannelGroupContentMessage(block: (FromChannelGroupContentMessage) -> T) = + asFromChannelGroupContentMessage()?.let(block) @PreviewFeature inline fun Message.asFromChannelGroupContentMessage(): FromChannelGroupContentMessage? = @@ -1125,7 +1202,8 @@ inline fun Message.requireFromChannelGroupContentMessage(): FromChannelGroupCont this as FromChannelGroupContentMessage @PreviewFeature -inline fun Message.whenGroupEventMessage(block: (GroupEventMessage) -> T) = asGroupEventMessage() ?.let(block) +inline fun Message.whenGroupEventMessage(block: (GroupEventMessage) -> T) = + asGroupEventMessage()?.let(block) @PreviewFeature inline fun Message.asGroupEventMessage(): GroupEventMessage? = this as? GroupEventMessage @@ -1134,16 +1212,20 @@ inline fun Message.asGroupEventMessage(): GroupEventMessage? = this inline fun Message.requireGroupEventMessage(): GroupEventMessage = this as GroupEventMessage @PreviewFeature -inline fun Message.whenPrivateEventMessage(block: (PrivateEventMessage) -> T) = asPrivateEventMessage() ?.let(block) +inline fun Message.whenPrivateEventMessage(block: (PrivateEventMessage) -> T) = + asPrivateEventMessage()?.let(block) @PreviewFeature -inline fun Message.asPrivateEventMessage(): PrivateEventMessage? = this as? PrivateEventMessage +inline fun Message.asPrivateEventMessage(): PrivateEventMessage? = + this as? PrivateEventMessage @PreviewFeature -inline fun Message.requirePrivateEventMessage(): PrivateEventMessage = this as PrivateEventMessage +inline fun Message.requirePrivateEventMessage(): PrivateEventMessage = + this as PrivateEventMessage @PreviewFeature -inline fun Message.whenGroupContentMessage(block: (GroupContentMessage) -> T) = asGroupContentMessage() ?.let(block) +inline fun Message.whenGroupContentMessage(block: (GroupContentMessage) -> T) = + asGroupContentMessage()?.let(block) @PreviewFeature inline fun Message.asGroupContentMessage(): GroupContentMessage? = @@ -1154,7 +1236,8 @@ inline fun Message.requireGroupContentMessage(): GroupContentMessage @PreviewFeature -inline fun Message.whenMediaGroupMessage(block: (MediaGroupMessage) -> T) = asMediaGroupMessage() ?.let(block) +inline fun Message.whenMediaGroupMessage(block: (MediaGroupMessage) -> T) = + asMediaGroupMessage()?.let(block) @PreviewFeature inline fun Message.asMediaGroupMessage(): MediaGroupMessage? = @@ -1165,7 +1248,8 @@ inline fun Message.requireMediaGroupMessage(): MediaGroupMessage @PreviewFeature -inline fun Message.whenPossiblyEditedMessage(block: (PossiblyEditedMessage) -> T) = asPossiblyEditedMessage() ?.let(block) +inline fun Message.whenPossiblyEditedMessage(block: (PossiblyEditedMessage) -> T) = + asPossiblyEditedMessage()?.let(block) @PreviewFeature inline fun Message.asPossiblyEditedMessage(): PossiblyEditedMessage? = this as? PossiblyEditedMessage @@ -1174,7 +1258,8 @@ inline fun Message.asPossiblyEditedMessage(): PossiblyEditedMessage? = this as? inline fun Message.requirePossiblyEditedMessage(): PossiblyEditedMessage = this as PossiblyEditedMessage @PreviewFeature -inline fun Message.whenPossiblyReplyMessage(block: (PossiblyReplyMessage) -> T) = asPossiblyReplyMessage() ?.let(block) +inline fun Message.whenPossiblyReplyMessage(block: (PossiblyReplyMessage) -> T) = + asPossiblyReplyMessage()?.let(block) @PreviewFeature inline fun Message.asPossiblyReplyMessage(): PossiblyReplyMessage? = this as? PossiblyReplyMessage @@ -1183,7 +1268,8 @@ inline fun Message.asPossiblyReplyMessage(): PossiblyReplyMessage? = this as? Po inline fun Message.requirePossiblyReplyMessage(): PossiblyReplyMessage = this as PossiblyReplyMessage @PreviewFeature -inline fun Message.whenPossiblyForwardedMessage(block: (PossiblyForwardedMessage) -> T) = asPossiblyForwardedMessage() ?.let(block) +inline fun Message.whenPossiblyForwardedMessage(block: (PossiblyForwardedMessage) -> T) = + asPossiblyForwardedMessage()?.let(block) @PreviewFeature inline fun Message.asPossiblyForwardedMessage(): PossiblyForwardedMessage? = this as? PossiblyForwardedMessage @@ -1192,7 +1278,8 @@ inline fun Message.asPossiblyForwardedMessage(): PossiblyForwardedMessage? = thi inline fun Message.requirePossiblyForwardedMessage(): PossiblyForwardedMessage = this as PossiblyForwardedMessage @PreviewFeature -inline fun Message.whenPossiblyPaymentMessage(block: (PossiblyPaymentMessage) -> T) = asPossiblyPaymentMessage() ?.let(block) +inline fun Message.whenPossiblyPaymentMessage(block: (PossiblyPaymentMessage) -> T) = + asPossiblyPaymentMessage()?.let(block) @PreviewFeature inline fun Message.asPossiblyPaymentMessage(): PossiblyPaymentMessage? = this as? PossiblyPaymentMessage @@ -1201,7 +1288,8 @@ inline fun Message.asPossiblyPaymentMessage(): PossiblyPaymentMessage? = this as inline fun Message.requirePossiblyPaymentMessage(): PossiblyPaymentMessage = this as PossiblyPaymentMessage @PreviewFeature -inline fun Message.whenPrivateContentMessage(block: (PrivateContentMessage) -> T) = asPrivateContentMessage() ?.let(block) +inline fun Message.whenPrivateContentMessage(block: (PrivateContentMessage) -> T) = + asPrivateContentMessage()?.let(block) @PreviewFeature inline fun Message.asPrivateContentMessage(): PrivateContentMessage? = @@ -1212,7 +1300,8 @@ inline fun Message.requirePrivateContentMessage(): PrivateContentMessage @PreviewFeature -inline fun Message.whenPublicContentMessage(block: (PublicContentMessage) -> T) = asPublicContentMessage() ?.let(block) +inline fun Message.whenPublicContentMessage(block: (PublicContentMessage) -> T) = + asPublicContentMessage()?.let(block) @PreviewFeature inline fun Message.asPublicContentMessage(): PublicContentMessage? = @@ -1223,7 +1312,7 @@ inline fun Message.requirePublicContentMessage(): PublicContentMessage @PreviewFeature -inline fun Message.whenSignedMessage(block: (SignedMessage) -> T) = asSignedMessage() ?.let(block) +inline fun Message.whenSignedMessage(block: (SignedMessage) -> T) = asSignedMessage()?.let(block) @PreviewFeature inline fun Message.asSignedMessage(): SignedMessage? = this as? SignedMessage @@ -1232,7 +1321,8 @@ inline fun Message.asSignedMessage(): SignedMessage? = this as? SignedMessage inline fun Message.requireSignedMessage(): SignedMessage = this as SignedMessage @PreviewFeature -inline fun Message.whenSupergroupEventMessage(block: (SupergroupEventMessage) -> T) = asSupergroupEventMessage() ?.let(block) +inline fun Message.whenSupergroupEventMessage(block: (SupergroupEventMessage) -> T) = + asSupergroupEventMessage()?.let(block) @PreviewFeature inline fun Message.asSupergroupEventMessage(): SupergroupEventMessage? = @@ -1243,7 +1333,7 @@ inline fun Message.requireSupergroupEventMessage(): SupergroupEventMessage @PreviewFeature -inline fun Message.whenUnknownMessageType(block: (UnknownMessageType) -> T) = asUnknownMessageType() ?.let(block) +inline fun Message.whenUnknownMessageType(block: (UnknownMessageType) -> T) = asUnknownMessageType()?.let(block) @PreviewFeature inline fun Message.asUnknownMessageType(): UnknownMessageType? = this as? UnknownMessageType @@ -1252,7 +1342,8 @@ inline fun Message.asUnknownMessageType(): UnknownMessageType? = this as? Unknow inline fun Message.requireUnknownMessageType(): UnknownMessageType = this as UnknownMessageType @PreviewFeature -inline fun Message.whenPossiblySentViaBotCommonMessage(block: (PossiblySentViaBotCommonMessage) -> T) = asPossiblySentViaBotCommonMessage() ?.let(block) +inline fun Message.whenPossiblySentViaBotCommonMessage(block: (PossiblySentViaBotCommonMessage) -> T) = + asPossiblySentViaBotCommonMessage()?.let(block) @PreviewFeature inline fun Message.asPossiblySentViaBotCommonMessage(): PossiblySentViaBotCommonMessage? = @@ -1263,7 +1354,7 @@ inline fun Message.requirePossiblySentViaBotCommonMessage(): PossiblySentViaBotC this as PossiblySentViaBotCommonMessage @PreviewFeature -inline fun Message.whenFromUserMessage(block: (FromUserMessage) -> T) = asFromUserMessage() ?.let(block) +inline fun Message.whenFromUserMessage(block: (FromUserMessage) -> T) = asFromUserMessage()?.let(block) @PreviewFeature inline fun Message.asFromUserMessage(): FromUserMessage? = this as? FromUserMessage @@ -1272,7 +1363,7 @@ inline fun Message.asFromUserMessage(): FromUserMessage? = this as? FromUserMess inline fun Message.requireFromUserMessage(): FromUserMessage = this as FromUserMessage @PreviewFeature -inline fun BotAction.whenFindLocationAction(block: (FindLocationAction) -> T) = asFindLocationAction() ?.let(block) +inline fun BotAction.whenFindLocationAction(block: (FindLocationAction) -> T) = asFindLocationAction()?.let(block) @PreviewFeature inline fun BotAction.asFindLocationAction(): FindLocationAction? = this as? FindLocationAction @@ -1281,7 +1372,7 @@ inline fun BotAction.asFindLocationAction(): FindLocationAction? = this as? Find inline fun BotAction.requireFindLocationAction(): FindLocationAction = this as FindLocationAction @PreviewFeature -inline fun BotAction.whenRecordVoiceAction(block: (RecordVoiceAction) -> T) = asRecordVoiceAction() ?.let(block) +inline fun BotAction.whenRecordVoiceAction(block: (RecordVoiceAction) -> T) = asRecordVoiceAction()?.let(block) @PreviewFeature inline fun BotAction.asRecordVoiceAction(): RecordVoiceAction? = this as? RecordVoiceAction @@ -1290,7 +1381,7 @@ inline fun BotAction.asRecordVoiceAction(): RecordVoiceAction? = this as? Record inline fun BotAction.requireRecordVoiceAction(): RecordVoiceAction = this as RecordVoiceAction @PreviewFeature -inline fun BotAction.whenRecordVideoAction(block: (RecordVideoAction) -> T) = asRecordVideoAction() ?.let(block) +inline fun BotAction.whenRecordVideoAction(block: (RecordVideoAction) -> T) = asRecordVideoAction()?.let(block) @PreviewFeature inline fun BotAction.asRecordVideoAction(): RecordVideoAction? = this as? RecordVideoAction @@ -1299,7 +1390,8 @@ inline fun BotAction.asRecordVideoAction(): RecordVideoAction? = this as? Record inline fun BotAction.requireRecordVideoAction(): RecordVideoAction = this as RecordVideoAction @PreviewFeature -inline fun BotAction.whenRecordVideoNoteAction(block: (RecordVideoNoteAction) -> T) = asRecordVideoNoteAction() ?.let(block) +inline fun BotAction.whenRecordVideoNoteAction(block: (RecordVideoNoteAction) -> T) = + asRecordVideoNoteAction()?.let(block) @PreviewFeature inline fun BotAction.asRecordVideoNoteAction(): RecordVideoNoteAction? = this as? RecordVideoNoteAction @@ -1308,7 +1400,7 @@ inline fun BotAction.asRecordVideoNoteAction(): RecordVideoNoteAction? = this as inline fun BotAction.requireRecordVideoNoteAction(): RecordVideoNoteAction = this as RecordVideoNoteAction @PreviewFeature -inline fun BotAction.whenTypingAction(block: (TypingAction) -> T) = asTypingAction() ?.let(block) +inline fun BotAction.whenTypingAction(block: (TypingAction) -> T) = asTypingAction()?.let(block) @PreviewFeature inline fun BotAction.asTypingAction(): TypingAction? = this as? TypingAction @@ -1317,7 +1409,8 @@ inline fun BotAction.asTypingAction(): TypingAction? = this as? TypingAction inline fun BotAction.requireTypingAction(): TypingAction = this as TypingAction @PreviewFeature -inline fun BotAction.whenChooseStickerAction(block: (ChooseStickerAction) -> T) = asChooseStickerAction() ?.let(block) +inline fun BotAction.whenChooseStickerAction(block: (ChooseStickerAction) -> T) = + asChooseStickerAction()?.let(block) @PreviewFeature inline fun BotAction.asChooseStickerAction(): ChooseStickerAction? = this as? ChooseStickerAction @@ -1326,7 +1419,7 @@ inline fun BotAction.asChooseStickerAction(): ChooseStickerAction? = this as? Ch inline fun BotAction.requireChooseStickerAction(): ChooseStickerAction = this as ChooseStickerAction @PreviewFeature -inline fun BotAction.whenUploadVoiceAction(block: (UploadVoiceAction) -> T) = asUploadVoiceAction() ?.let(block) +inline fun BotAction.whenUploadVoiceAction(block: (UploadVoiceAction) -> T) = asUploadVoiceAction()?.let(block) @PreviewFeature inline fun BotAction.asUploadVoiceAction(): UploadVoiceAction? = this as? UploadVoiceAction @@ -1335,7 +1428,8 @@ inline fun BotAction.asUploadVoiceAction(): UploadVoiceAction? = this as? Upload inline fun BotAction.requireUploadVoiceAction(): UploadVoiceAction = this as UploadVoiceAction @PreviewFeature -inline fun BotAction.whenUploadDocumentAction(block: (UploadDocumentAction) -> T) = asUploadDocumentAction() ?.let(block) +inline fun BotAction.whenUploadDocumentAction(block: (UploadDocumentAction) -> T) = + asUploadDocumentAction()?.let(block) @PreviewFeature inline fun BotAction.asUploadDocumentAction(): UploadDocumentAction? = this as? UploadDocumentAction @@ -1344,7 +1438,7 @@ inline fun BotAction.asUploadDocumentAction(): UploadDocumentAction? = this as? inline fun BotAction.requireUploadDocumentAction(): UploadDocumentAction = this as UploadDocumentAction @PreviewFeature -inline fun BotAction.whenUploadPhotoAction(block: (UploadPhotoAction) -> T) = asUploadPhotoAction() ?.let(block) +inline fun BotAction.whenUploadPhotoAction(block: (UploadPhotoAction) -> T) = asUploadPhotoAction()?.let(block) @PreviewFeature inline fun BotAction.asUploadPhotoAction(): UploadPhotoAction? = this as? UploadPhotoAction @@ -1353,7 +1447,7 @@ inline fun BotAction.asUploadPhotoAction(): UploadPhotoAction? = this as? Upload inline fun BotAction.requireUploadPhotoAction(): UploadPhotoAction = this as UploadPhotoAction @PreviewFeature -inline fun BotAction.whenUploadVideoAction(block: (UploadVideoAction) -> T) = asUploadVideoAction() ?.let(block) +inline fun BotAction.whenUploadVideoAction(block: (UploadVideoAction) -> T) = asUploadVideoAction()?.let(block) @PreviewFeature inline fun BotAction.asUploadVideoAction(): UploadVideoAction? = this as? UploadVideoAction @@ -1362,7 +1456,8 @@ inline fun BotAction.asUploadVideoAction(): UploadVideoAction? = this as? Upload inline fun BotAction.requireUploadVideoAction(): UploadVideoAction = this as UploadVideoAction @PreviewFeature -inline fun BotAction.whenUploadVideoNoteAction(block: (UploadVideoNoteAction) -> T) = asUploadVideoNoteAction() ?.let(block) +inline fun BotAction.whenUploadVideoNoteAction(block: (UploadVideoNoteAction) -> T) = + asUploadVideoNoteAction()?.let(block) @PreviewFeature inline fun BotAction.asUploadVideoNoteAction(): UploadVideoNoteAction? = this as? UploadVideoNoteAction @@ -1371,7 +1466,7 @@ inline fun BotAction.asUploadVideoNoteAction(): UploadVideoNoteAction? = this as inline fun BotAction.requireUploadVideoNoteAction(): UploadVideoNoteAction = this as UploadVideoNoteAction @PreviewFeature -inline fun InlineQuery.whenBaseInlineQuery(block: (BaseInlineQuery) -> T) = asBaseInlineQuery() ?.let(block) +inline fun InlineQuery.whenBaseInlineQuery(block: (BaseInlineQuery) -> T) = asBaseInlineQuery()?.let(block) @PreviewFeature inline fun InlineQuery.asBaseInlineQuery(): BaseInlineQuery? = @@ -1382,7 +1477,8 @@ inline fun InlineQuery.requireBaseInlineQuery(): BaseInlineQuery = this as BaseInlineQuery @PreviewFeature -inline fun InlineQuery.whenLocationInlineQuery(block: (LocationInlineQuery) -> T) = asLocationInlineQuery() ?.let(block) +inline fun InlineQuery.whenLocationInlineQuery(block: (LocationInlineQuery) -> T) = + asLocationInlineQuery()?.let(block) @PreviewFeature inline fun InlineQuery.asLocationInlineQuery(): LocationInlineQuery? = @@ -1393,7 +1489,8 @@ inline fun InlineQuery.requireLocationInlineQuery(): LocationInlineQuery = this as LocationInlineQuery @PreviewFeature -inline fun InputMessageContent.whenInputContactMessageContent(block: (InputContactMessageContent) -> T) = asInputContactMessageContent() ?.let(block) +inline fun InputMessageContent.whenInputContactMessageContent(block: (InputContactMessageContent) -> T) = + asInputContactMessageContent()?.let(block) @PreviewFeature inline fun InputMessageContent.asInputContactMessageContent(): InputContactMessageContent? = @@ -1404,7 +1501,8 @@ inline fun InputMessageContent.requireInputContactMessageContent(): InputContact this as InputContactMessageContent @PreviewFeature -inline fun InputMessageContent.whenInputLocationMessageContent(block: (InputLocationMessageContent) -> T) = asInputLocationMessageContent() ?.let(block) +inline fun InputMessageContent.whenInputLocationMessageContent(block: (InputLocationMessageContent) -> T) = + asInputLocationMessageContent()?.let(block) @PreviewFeature inline fun InputMessageContent.asInputLocationMessageContent(): InputLocationMessageContent? = @@ -1415,7 +1513,8 @@ inline fun InputMessageContent.requireInputLocationMessageContent(): InputLocati this as InputLocationMessageContent @PreviewFeature -inline fun InputMessageContent.whenInputTextMessageContent(block: (InputTextMessageContent) -> T) = asInputTextMessageContent() ?.let(block) +inline fun InputMessageContent.whenInputTextMessageContent(block: (InputTextMessageContent) -> T) = + asInputTextMessageContent()?.let(block) @PreviewFeature inline fun InputMessageContent.asInputTextMessageContent(): InputTextMessageContent? = this as? InputTextMessageContent @@ -1425,7 +1524,8 @@ inline fun InputMessageContent.requireInputTextMessageContent(): InputTextMessag this as InputTextMessageContent @PreviewFeature -inline fun InputMessageContent.whenInputVenueMessageContent(block: (InputVenueMessageContent) -> T) = asInputVenueMessageContent() ?.let(block) +inline fun InputMessageContent.whenInputVenueMessageContent(block: (InputVenueMessageContent) -> T) = + asInputVenueMessageContent()?.let(block) @PreviewFeature inline fun InputMessageContent.asInputVenueMessageContent(): InputVenueMessageContent? = @@ -1436,7 +1536,8 @@ inline fun InputMessageContent.requireInputVenueMessageContent(): InputVenueMess this as InputVenueMessageContent @PreviewFeature -inline fun InputMessageContent.whenInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T) = asInputInvoiceMessageContent() ?.let(block) +inline fun InputMessageContent.whenInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T) = + asInputInvoiceMessageContent()?.let(block) @PreviewFeature inline fun InputMessageContent.asInputInvoiceMessageContent(): InputInvoiceMessageContent? = @@ -1447,7 +1548,8 @@ inline fun InputMessageContent.requireInputInvoiceMessageContent(): InputInvoice this as InputInvoiceMessageContent @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultArticle(block: (InlineQueryResultArticle) -> T) = asInlineQueryResultArticle() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultArticle(block: (InlineQueryResultArticle) -> T) = + asInlineQueryResultArticle()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultArticle(): InlineQueryResultArticle? = this as? InlineQueryResultArticle @@ -1457,7 +1559,8 @@ inline fun InlineQueryResult.requireInlineQueryResultArticle(): InlineQueryResul this as InlineQueryResultArticle @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultContact(block: (InlineQueryResultContact) -> T) = asInlineQueryResultContact() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultContact(block: (InlineQueryResultContact) -> T) = + asInlineQueryResultContact()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultContact(): InlineQueryResultContact? = this as? InlineQueryResultContact @@ -1467,7 +1570,8 @@ inline fun InlineQueryResult.requireInlineQueryResultContact(): InlineQueryResul this as InlineQueryResultContact @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultGame(block: (InlineQueryResultGame) -> T) = asInlineQueryResultGame() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultGame(block: (InlineQueryResultGame) -> T) = + asInlineQueryResultGame()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultGame(): InlineQueryResultGame? = this as? InlineQueryResultGame @@ -1476,7 +1580,8 @@ inline fun InlineQueryResult.asInlineQueryResultGame(): InlineQueryResultGame? = inline fun InlineQueryResult.requireInlineQueryResultGame(): InlineQueryResultGame = this as InlineQueryResultGame @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultLocation(block: (InlineQueryResultLocation) -> T) = asInlineQueryResultLocation() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultLocation(block: (InlineQueryResultLocation) -> T) = + asInlineQueryResultLocation()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultLocation(): InlineQueryResultLocation? = @@ -1487,7 +1592,8 @@ inline fun InlineQueryResult.requireInlineQueryResultLocation(): InlineQueryResu this as InlineQueryResultLocation @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultStickerCached(block: (InlineQueryResultStickerCached) -> T) = asInlineQueryResultStickerCached() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultStickerCached(block: (InlineQueryResultStickerCached) -> T) = + asInlineQueryResultStickerCached()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultStickerCached(): InlineQueryResultStickerCached? = @@ -1498,7 +1604,8 @@ inline fun InlineQueryResult.requireInlineQueryResultStickerCached(): InlineQuer this as InlineQueryResultStickerCached @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultVenue(block: (InlineQueryResultVenue) -> T) = asInlineQueryResultVenue() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultVenue(block: (InlineQueryResultVenue) -> T) = + asInlineQueryResultVenue()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultVenue(): InlineQueryResultVenue? = this as? InlineQueryResultVenue @@ -1507,7 +1614,8 @@ inline fun InlineQueryResult.asInlineQueryResultVenue(): InlineQueryResultVenue? inline fun InlineQueryResult.requireInlineQueryResultVenue(): InlineQueryResultVenue = this as InlineQueryResultVenue @PreviewFeature -inline fun InlineQueryResult.whenDescribedInlineQueryResult(block: (DescribedInlineQueryResult) -> T) = asDescribedInlineQueryResult() ?.let(block) +inline fun InlineQueryResult.whenDescribedInlineQueryResult(block: (DescribedInlineQueryResult) -> T) = + asDescribedInlineQueryResult()?.let(block) @PreviewFeature inline fun InlineQueryResult.asDescribedInlineQueryResult(): DescribedInlineQueryResult? = @@ -1518,7 +1626,8 @@ inline fun InlineQueryResult.requireDescribedInlineQueryResult(): DescribedInlin this as DescribedInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.whenFileInlineQueryResult(block: (FileInlineQueryResult) -> T) = asFileInlineQueryResult() ?.let(block) +inline fun InlineQueryResult.whenFileInlineQueryResult(block: (FileInlineQueryResult) -> T) = + asFileInlineQueryResult()?.let(block) @PreviewFeature inline fun InlineQueryResult.asFileInlineQueryResult(): FileInlineQueryResult? = this as? FileInlineQueryResult @@ -1527,7 +1636,8 @@ inline fun InlineQueryResult.asFileInlineQueryResult(): FileInlineQueryResult? = inline fun InlineQueryResult.requireFileInlineQueryResult(): FileInlineQueryResult = this as FileInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.whenOptionallyTitledInlineQueryResult(block: (OptionallyTitledInlineQueryResult) -> T) = asOptionallyTitledInlineQueryResult() ?.let(block) +inline fun InlineQueryResult.whenOptionallyTitledInlineQueryResult(block: (OptionallyTitledInlineQueryResult) -> T) = + asOptionallyTitledInlineQueryResult()?.let(block) @PreviewFeature inline fun InlineQueryResult.asOptionallyTitledInlineQueryResult(): OptionallyTitledInlineQueryResult? = @@ -1538,7 +1648,8 @@ inline fun InlineQueryResult.requireOptionallyTitledInlineQueryResult(): Optiona this as OptionallyTitledInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.whenSizedInlineQueryResult(block: (SizedInlineQueryResult) -> T) = asSizedInlineQueryResult() ?.let(block) +inline fun InlineQueryResult.whenSizedInlineQueryResult(block: (SizedInlineQueryResult) -> T) = + asSizedInlineQueryResult()?.let(block) @PreviewFeature inline fun InlineQueryResult.asSizedInlineQueryResult(): SizedInlineQueryResult? = this as? SizedInlineQueryResult @@ -1547,7 +1658,8 @@ inline fun InlineQueryResult.asSizedInlineQueryResult(): SizedInlineQueryResult? inline fun InlineQueryResult.requireSizedInlineQueryResult(): SizedInlineQueryResult = this as SizedInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.whenThumbSizedInlineQueryResult(block: (ThumbSizedInlineQueryResult) -> T) = asThumbSizedInlineQueryResult() ?.let(block) +inline fun InlineQueryResult.whenThumbSizedInlineQueryResult(block: (ThumbSizedInlineQueryResult) -> T) = + asThumbSizedInlineQueryResult()?.let(block) @PreviewFeature inline fun InlineQueryResult.asThumbSizedInlineQueryResult(): ThumbSizedInlineQueryResult? = @@ -1558,7 +1670,8 @@ inline fun InlineQueryResult.requireThumbSizedInlineQueryResult(): ThumbSizedInl this as ThumbSizedInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.whenThumbedInlineQueryResult(block: (ThumbedInlineQueryResult) -> T) = asThumbedInlineQueryResult() ?.let(block) +inline fun InlineQueryResult.whenThumbedInlineQueryResult(block: (ThumbedInlineQueryResult) -> T) = + asThumbedInlineQueryResult()?.let(block) @PreviewFeature inline fun InlineQueryResult.asThumbedInlineQueryResult(): ThumbedInlineQueryResult? = this as? ThumbedInlineQueryResult @@ -1568,7 +1681,8 @@ inline fun InlineQueryResult.requireThumbedInlineQueryResult(): ThumbedInlineQue this as ThumbedInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.whenThumbedWithMimeTypeInlineQueryResult(block: (ThumbedWithMimeTypeInlineQueryResult) -> T) = asThumbedWithMimeTypeInlineQueryResult() ?.let(block) +inline fun InlineQueryResult.whenThumbedWithMimeTypeInlineQueryResult(block: (ThumbedWithMimeTypeInlineQueryResult) -> T) = + asThumbedWithMimeTypeInlineQueryResult()?.let(block) @PreviewFeature inline fun InlineQueryResult.asThumbedWithMimeTypeInlineQueryResult(): ThumbedWithMimeTypeInlineQueryResult? = @@ -1579,7 +1693,8 @@ inline fun InlineQueryResult.requireThumbedWithMimeTypeInlineQueryResult(): Thum this as ThumbedWithMimeTypeInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.whenTitledInlineQueryResult(block: (TitledInlineQueryResult) -> T) = asTitledInlineQueryResult() ?.let(block) +inline fun InlineQueryResult.whenTitledInlineQueryResult(block: (TitledInlineQueryResult) -> T) = + asTitledInlineQueryResult()?.let(block) @PreviewFeature inline fun InlineQueryResult.asTitledInlineQueryResult(): TitledInlineQueryResult? = this as? TitledInlineQueryResult @@ -1588,7 +1703,8 @@ inline fun InlineQueryResult.asTitledInlineQueryResult(): TitledInlineQueryResul inline fun InlineQueryResult.requireTitledInlineQueryResult(): TitledInlineQueryResult = this as TitledInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.whenUrlInlineQueryResult(block: (UrlInlineQueryResult) -> T) = asUrlInlineQueryResult() ?.let(block) +inline fun InlineQueryResult.whenUrlInlineQueryResult(block: (UrlInlineQueryResult) -> T) = + asUrlInlineQueryResult()?.let(block) @PreviewFeature inline fun InlineQueryResult.asUrlInlineQueryResult(): UrlInlineQueryResult? = this as? UrlInlineQueryResult @@ -1597,7 +1713,8 @@ inline fun InlineQueryResult.asUrlInlineQueryResult(): UrlInlineQueryResult? = t inline fun InlineQueryResult.requireUrlInlineQueryResult(): UrlInlineQueryResult = this as UrlInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.whenWithInputMessageContentInlineQueryResult(block: (WithInputMessageContentInlineQueryResult) -> T) = asWithInputMessageContentInlineQueryResult() ?.let(block) +inline fun InlineQueryResult.whenWithInputMessageContentInlineQueryResult(block: (WithInputMessageContentInlineQueryResult) -> T) = + asWithInputMessageContentInlineQueryResult()?.let(block) @PreviewFeature inline fun InlineQueryResult.asWithInputMessageContentInlineQueryResult(): WithInputMessageContentInlineQueryResult? = @@ -1608,7 +1725,8 @@ inline fun InlineQueryResult.requireWithInputMessageContentInlineQueryResult(): this as WithInputMessageContentInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultAudio(block: (InlineQueryResultAudio) -> T) = asInlineQueryResultAudio() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultAudio(block: (InlineQueryResultAudio) -> T) = + asInlineQueryResultAudio()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultAudio(): InlineQueryResultAudio? = this as? InlineQueryResultAudio @@ -1617,7 +1735,8 @@ inline fun InlineQueryResult.asInlineQueryResultAudio(): InlineQueryResultAudio? inline fun InlineQueryResult.requireInlineQueryResultAudio(): InlineQueryResultAudio = this as InlineQueryResultAudio @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultAudioCached(block: (InlineQueryResultAudioCached) -> T) = asInlineQueryResultAudioCached() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultAudioCached(block: (InlineQueryResultAudioCached) -> T) = + asInlineQueryResultAudioCached()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultAudioCached(): InlineQueryResultAudioCached? = @@ -1628,7 +1747,8 @@ inline fun InlineQueryResult.requireInlineQueryResultAudioCached(): InlineQueryR this as InlineQueryResultAudioCached @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultAudioCommon(block: (InlineQueryResultAudioCommon) -> T) = asInlineQueryResultAudioCommon() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultAudioCommon(block: (InlineQueryResultAudioCommon) -> T) = + asInlineQueryResultAudioCommon()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultAudioCommon(): InlineQueryResultAudioCommon? = @@ -1639,7 +1759,8 @@ inline fun InlineQueryResult.requireInlineQueryResultAudioCommon(): InlineQueryR this as InlineQueryResultAudioCommon @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultDocument(block: (InlineQueryResultDocument) -> T) = asInlineQueryResultDocument() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultDocument(block: (InlineQueryResultDocument) -> T) = + asInlineQueryResultDocument()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultDocument(): InlineQueryResultDocument? = @@ -1650,7 +1771,8 @@ inline fun InlineQueryResult.requireInlineQueryResultDocument(): InlineQueryResu this as InlineQueryResultDocument @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultDocumentCached(block: (InlineQueryResultDocumentCached) -> T) = asInlineQueryResultDocumentCached() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultDocumentCached(block: (InlineQueryResultDocumentCached) -> T) = + asInlineQueryResultDocumentCached()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultDocumentCached(): InlineQueryResultDocumentCached? = @@ -1661,7 +1783,8 @@ inline fun InlineQueryResult.requireInlineQueryResultDocumentCached(): InlineQue this as InlineQueryResultDocumentCached @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultDocumentCommon(block: (InlineQueryResultDocumentCommon) -> T) = asInlineQueryResultDocumentCommon() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultDocumentCommon(block: (InlineQueryResultDocumentCommon) -> T) = + asInlineQueryResultDocumentCommon()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultDocumentCommon(): InlineQueryResultDocumentCommon? = @@ -1672,7 +1795,8 @@ inline fun InlineQueryResult.requireInlineQueryResultDocumentCommon(): InlineQue this as InlineQueryResultDocumentCommon @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultGif(block: (InlineQueryResultGif) -> T) = asInlineQueryResultGif() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultGif(block: (InlineQueryResultGif) -> T) = + asInlineQueryResultGif()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultGif(): InlineQueryResultGif? = this as? InlineQueryResultGif @@ -1681,7 +1805,8 @@ inline fun InlineQueryResult.asInlineQueryResultGif(): InlineQueryResultGif? = t inline fun InlineQueryResult.requireInlineQueryResultGif(): InlineQueryResultGif = this as InlineQueryResultGif @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultGifCached(block: (InlineQueryResultGifCached) -> T) = asInlineQueryResultGifCached() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultGifCached(block: (InlineQueryResultGifCached) -> T) = + asInlineQueryResultGifCached()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultGifCached(): InlineQueryResultGifCached? = @@ -1692,7 +1817,8 @@ inline fun InlineQueryResult.requireInlineQueryResultGifCached(): InlineQueryRes this as InlineQueryResultGifCached @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultGifCommon(block: (InlineQueryResultGifCommon) -> T) = asInlineQueryResultGifCommon() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultGifCommon(block: (InlineQueryResultGifCommon) -> T) = + asInlineQueryResultGifCommon()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultGifCommon(): InlineQueryResultGifCommon? = @@ -1703,7 +1829,8 @@ inline fun InlineQueryResult.requireInlineQueryResultGifCommon(): InlineQueryRes this as InlineQueryResultGifCommon @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultMpeg4Gif(block: (InlineQueryResultMpeg4Gif) -> T) = asInlineQueryResultMpeg4Gif() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultMpeg4Gif(block: (InlineQueryResultMpeg4Gif) -> T) = + asInlineQueryResultMpeg4Gif()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultMpeg4Gif(): InlineQueryResultMpeg4Gif? = @@ -1714,7 +1841,8 @@ inline fun InlineQueryResult.requireInlineQueryResultMpeg4Gif(): InlineQueryResu this as InlineQueryResultMpeg4Gif @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultMpeg4GifCached(block: (InlineQueryResultMpeg4GifCached) -> T) = asInlineQueryResultMpeg4GifCached() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultMpeg4GifCached(block: (InlineQueryResultMpeg4GifCached) -> T) = + asInlineQueryResultMpeg4GifCached()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultMpeg4GifCached(): InlineQueryResultMpeg4GifCached? = @@ -1725,7 +1853,8 @@ inline fun InlineQueryResult.requireInlineQueryResultMpeg4GifCached(): InlineQue this as InlineQueryResultMpeg4GifCached @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultMpeg4GifCommon(block: (InlineQueryResultMpeg4GifCommon) -> T) = asInlineQueryResultMpeg4GifCommon() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultMpeg4GifCommon(block: (InlineQueryResultMpeg4GifCommon) -> T) = + asInlineQueryResultMpeg4GifCommon()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultMpeg4GifCommon(): InlineQueryResultMpeg4GifCommon? = @@ -1736,7 +1865,8 @@ inline fun InlineQueryResult.requireInlineQueryResultMpeg4GifCommon(): InlineQue this as InlineQueryResultMpeg4GifCommon @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultPhoto(block: (InlineQueryResultPhoto) -> T) = asInlineQueryResultPhoto() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultPhoto(block: (InlineQueryResultPhoto) -> T) = + asInlineQueryResultPhoto()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultPhoto(): InlineQueryResultPhoto? = this as? InlineQueryResultPhoto @@ -1745,7 +1875,8 @@ inline fun InlineQueryResult.asInlineQueryResultPhoto(): InlineQueryResultPhoto? inline fun InlineQueryResult.requireInlineQueryResultPhoto(): InlineQueryResultPhoto = this as InlineQueryResultPhoto @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultPhotoCached(block: (InlineQueryResultPhotoCached) -> T) = asInlineQueryResultPhotoCached() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultPhotoCached(block: (InlineQueryResultPhotoCached) -> T) = + asInlineQueryResultPhotoCached()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultPhotoCached(): InlineQueryResultPhotoCached? = @@ -1756,7 +1887,8 @@ inline fun InlineQueryResult.requireInlineQueryResultPhotoCached(): InlineQueryR this as InlineQueryResultPhotoCached @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultPhotoCommon(block: (InlineQueryResultPhotoCommon) -> T) = asInlineQueryResultPhotoCommon() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultPhotoCommon(block: (InlineQueryResultPhotoCommon) -> T) = + asInlineQueryResultPhotoCommon()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultPhotoCommon(): InlineQueryResultPhotoCommon? = @@ -1767,7 +1899,8 @@ inline fun InlineQueryResult.requireInlineQueryResultPhotoCommon(): InlineQueryR this as InlineQueryResultPhotoCommon @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultVideo(block: (InlineQueryResultVideo) -> T) = asInlineQueryResultVideo() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultVideo(block: (InlineQueryResultVideo) -> T) = + asInlineQueryResultVideo()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultVideo(): InlineQueryResultVideo? = this as? InlineQueryResultVideo @@ -1776,7 +1909,8 @@ inline fun InlineQueryResult.asInlineQueryResultVideo(): InlineQueryResultVideo? inline fun InlineQueryResult.requireInlineQueryResultVideo(): InlineQueryResultVideo = this as InlineQueryResultVideo @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultVideoCached(block: (InlineQueryResultVideoCached) -> T) = asInlineQueryResultVideoCached() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultVideoCached(block: (InlineQueryResultVideoCached) -> T) = + asInlineQueryResultVideoCached()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultVideoCached(): InlineQueryResultVideoCached? = @@ -1787,7 +1921,8 @@ inline fun InlineQueryResult.requireInlineQueryResultVideoCached(): InlineQueryR this as InlineQueryResultVideoCached @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultVideoCommon(block: (InlineQueryResultVideoCommon) -> T) = asInlineQueryResultVideoCommon() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultVideoCommon(block: (InlineQueryResultVideoCommon) -> T) = + asInlineQueryResultVideoCommon()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultVideoCommon(): InlineQueryResultVideoCommon? = @@ -1798,7 +1933,8 @@ inline fun InlineQueryResult.requireInlineQueryResultVideoCommon(): InlineQueryR this as InlineQueryResultVideoCommon @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultVoice(block: (InlineQueryResultVoice) -> T) = asInlineQueryResultVoice() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultVoice(block: (InlineQueryResultVoice) -> T) = + asInlineQueryResultVoice()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultVoice(): InlineQueryResultVoice? = this as? InlineQueryResultVoice @@ -1807,7 +1943,8 @@ inline fun InlineQueryResult.asInlineQueryResultVoice(): InlineQueryResultVoice? inline fun InlineQueryResult.requireInlineQueryResultVoice(): InlineQueryResultVoice = this as InlineQueryResultVoice @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultVoiceCached(block: (InlineQueryResultVoiceCached) -> T) = asInlineQueryResultVoiceCached() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultVoiceCached(block: (InlineQueryResultVoiceCached) -> T) = + asInlineQueryResultVoiceCached()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultVoiceCached(): InlineQueryResultVoiceCached? = @@ -1818,7 +1955,8 @@ inline fun InlineQueryResult.requireInlineQueryResultVoiceCached(): InlineQueryR this as InlineQueryResultVoiceCached @PreviewFeature -inline fun InlineQueryResult.whenInlineQueryResultVoiceCommon(block: (InlineQueryResultVoiceCommon) -> T) = asInlineQueryResultVoiceCommon() ?.let(block) +inline fun InlineQueryResult.whenInlineQueryResultVoiceCommon(block: (InlineQueryResultVoiceCommon) -> T) = + asInlineQueryResultVoiceCommon()?.let(block) @PreviewFeature inline fun InlineQueryResult.asInlineQueryResultVoiceCommon(): InlineQueryResultVoiceCommon? = @@ -1829,7 +1967,7 @@ inline fun InlineQueryResult.requireInlineQueryResultVoiceCommon(): InlineQueryR this as InlineQueryResultVoiceCommon @PreviewFeature -inline fun ChatMember.whenOwnerChatMember(block: (OwnerChatMember) -> T) = asOwnerChatMember() ?.let(block) +inline fun ChatMember.whenOwnerChatMember(block: (OwnerChatMember) -> T) = asOwnerChatMember()?.let(block) @PreviewFeature inline fun ChatMember.asOwnerChatMember(): OwnerChatMember? = this as? OwnerChatMember @@ -1838,7 +1976,7 @@ inline fun ChatMember.asOwnerChatMember(): OwnerChatMember? = this as? OwnerChat inline fun ChatMember.requireOwnerChatMember(): OwnerChatMember = this as OwnerChatMember @PreviewFeature -inline fun ChatMember.whenKickedChatMember(block: (KickedChatMember) -> T) = asKickedChatMember() ?.let(block) +inline fun ChatMember.whenKickedChatMember(block: (KickedChatMember) -> T) = asKickedChatMember()?.let(block) @PreviewFeature inline fun ChatMember.asKickedChatMember(): KickedChatMember? = this as? KickedChatMember @@ -1847,7 +1985,7 @@ inline fun ChatMember.asKickedChatMember(): KickedChatMember? = this as? KickedC inline fun ChatMember.requireKickedChatMember(): KickedChatMember = this as KickedChatMember @PreviewFeature -inline fun ChatMember.whenLeftChatMember(block: (LeftChatMember) -> T) = asLeftChatMember() ?.let(block) +inline fun ChatMember.whenLeftChatMember(block: (LeftChatMember) -> T) = asLeftChatMember()?.let(block) @PreviewFeature inline fun ChatMember.asLeftChatMember(): LeftChatMember? = this as? LeftChatMember @@ -1856,7 +1994,7 @@ inline fun ChatMember.asLeftChatMember(): LeftChatMember? = this as? LeftChatMem inline fun ChatMember.requireLeftChatMember(): LeftChatMember = this as LeftChatMember @PreviewFeature -inline fun ChatMember.whenMemberChatMember(block: (MemberChatMember) -> T) = asMemberChatMember() ?.let(block) +inline fun ChatMember.whenMemberChatMember(block: (MemberChatMember) -> T) = asMemberChatMember()?.let(block) @PreviewFeature inline fun ChatMember.asMemberChatMember(): MemberChatMember? = this as? MemberChatMember @@ -1865,7 +2003,8 @@ inline fun ChatMember.asMemberChatMember(): MemberChatMember? = this as? MemberC inline fun ChatMember.requireMemberChatMember(): MemberChatMember = this as MemberChatMember @PreviewFeature -inline fun ChatMember.whenRestrictedChatMember(block: (RestrictedChatMember) -> T) = asRestrictedChatMember() ?.let(block) +inline fun ChatMember.whenRestrictedChatMember(block: (RestrictedChatMember) -> T) = + asRestrictedChatMember()?.let(block) @PreviewFeature inline fun ChatMember.asRestrictedChatMember(): RestrictedChatMember? = this as? RestrictedChatMember @@ -1874,7 +2013,8 @@ inline fun ChatMember.asRestrictedChatMember(): RestrictedChatMember? = this as? inline fun ChatMember.requireRestrictedChatMember(): RestrictedChatMember = this as RestrictedChatMember @PreviewFeature -inline fun ChatMember.whenAdministratorChatMember(block: (AdministratorChatMember) -> T) = asAdministratorChatMember() ?.let(block) +inline fun ChatMember.whenAdministratorChatMember(block: (AdministratorChatMember) -> T) = + asAdministratorChatMember()?.let(block) @PreviewFeature inline fun ChatMember.asAdministratorChatMember(): AdministratorChatMember? = this as? AdministratorChatMember @@ -1883,7 +2023,7 @@ inline fun ChatMember.asAdministratorChatMember(): AdministratorChatMember? = th inline fun ChatMember.requireAdministratorChatMember(): AdministratorChatMember = this as AdministratorChatMember @PreviewFeature -inline fun ChatMember.whenBannedChatMember(block: (BannedChatMember) -> T) = asBannedChatMember() ?.let(block) +inline fun ChatMember.whenBannedChatMember(block: (BannedChatMember) -> T) = asBannedChatMember()?.let(block) @PreviewFeature inline fun ChatMember.asBannedChatMember(): BannedChatMember? = this as? BannedChatMember @@ -1892,7 +2032,8 @@ inline fun ChatMember.asBannedChatMember(): BannedChatMember? = this as? BannedC inline fun ChatMember.requireBannedChatMember(): BannedChatMember = this as BannedChatMember @PreviewFeature -inline fun ChatMember.whenSpecialRightsChatMember(block: (SpecialRightsChatMember) -> T) = asSpecialRightsChatMember() ?.let(block) +inline fun ChatMember.whenSpecialRightsChatMember(block: (SpecialRightsChatMember) -> T) = + asSpecialRightsChatMember()?.let(block) @PreviewFeature inline fun ChatMember.asSpecialRightsChatMember(): SpecialRightsChatMember? = this as? SpecialRightsChatMember @@ -1901,7 +2042,8 @@ inline fun ChatMember.asSpecialRightsChatMember(): SpecialRightsChatMember? = th inline fun ChatMember.requireSpecialRightsChatMember(): SpecialRightsChatMember = this as SpecialRightsChatMember @PreviewFeature -inline fun TelegramMedia.whenAudioMediaGroupMemberTelegramMedia(block: (AudioMediaGroupMemberTelegramMedia) -> T) = asAudioMediaGroupMemberTelegramMedia() ?.let(block) +inline fun TelegramMedia.whenAudioMediaGroupMemberTelegramMedia(block: (AudioMediaGroupMemberTelegramMedia) -> T) = + asAudioMediaGroupMemberTelegramMedia()?.let(block) @PreviewFeature inline fun TelegramMedia.asAudioMediaGroupMemberTelegramMedia(): AudioMediaGroupMemberTelegramMedia? = @@ -1912,7 +2054,8 @@ inline fun TelegramMedia.requireAudioMediaGroupMemberTelegramMedia(): AudioMedia this as AudioMediaGroupMemberTelegramMedia @PreviewFeature -inline fun TelegramMedia.whenDocumentMediaGroupMemberTelegramMedia(block: (DocumentMediaGroupMemberTelegramMedia) -> T) = asDocumentMediaGroupMemberTelegramMedia() ?.let(block) +inline fun TelegramMedia.whenDocumentMediaGroupMemberTelegramMedia(block: (DocumentMediaGroupMemberTelegramMedia) -> T) = + asDocumentMediaGroupMemberTelegramMedia()?.let(block) @PreviewFeature inline fun TelegramMedia.asDocumentMediaGroupMemberTelegramMedia(): DocumentMediaGroupMemberTelegramMedia? = @@ -1923,7 +2066,8 @@ inline fun TelegramMedia.requireDocumentMediaGroupMemberTelegramMedia(): Documen this as DocumentMediaGroupMemberTelegramMedia @PreviewFeature -inline fun TelegramMedia.whenDuratedTelegramMedia(block: (DuratedTelegramMedia) -> T) = asDuratedTelegramMedia() ?.let(block) +inline fun TelegramMedia.whenDuratedTelegramMedia(block: (DuratedTelegramMedia) -> T) = + asDuratedTelegramMedia()?.let(block) @PreviewFeature inline fun TelegramMedia.asDuratedTelegramMedia(): DuratedTelegramMedia? = this as? DuratedTelegramMedia @@ -1932,7 +2076,8 @@ inline fun TelegramMedia.asDuratedTelegramMedia(): DuratedTelegramMedia? = this inline fun TelegramMedia.requireDuratedTelegramMedia(): DuratedTelegramMedia = this as DuratedTelegramMedia @PreviewFeature -inline fun TelegramMedia.whenTelegramMediaAnimation(block: (TelegramMediaAnimation) -> T) = asTelegramMediaAnimation() ?.let(block) +inline fun TelegramMedia.whenTelegramMediaAnimation(block: (TelegramMediaAnimation) -> T) = + asTelegramMediaAnimation()?.let(block) @PreviewFeature inline fun TelegramMedia.asTelegramMediaAnimation(): TelegramMediaAnimation? = this as? TelegramMediaAnimation @@ -1941,7 +2086,8 @@ inline fun TelegramMedia.asTelegramMediaAnimation(): TelegramMediaAnimation? = t inline fun TelegramMedia.requireTelegramMediaAnimation(): TelegramMediaAnimation = this as TelegramMediaAnimation @PreviewFeature -inline fun TelegramMedia.whenTelegramMediaAudio(block: (TelegramMediaAudio) -> T) = asTelegramMediaAudio() ?.let(block) +inline fun TelegramMedia.whenTelegramMediaAudio(block: (TelegramMediaAudio) -> T) = + asTelegramMediaAudio()?.let(block) @PreviewFeature inline fun TelegramMedia.asTelegramMediaAudio(): TelegramMediaAudio? = this as? TelegramMediaAudio @@ -1950,7 +2096,8 @@ inline fun TelegramMedia.asTelegramMediaAudio(): TelegramMediaAudio? = this as? inline fun TelegramMedia.requireTelegramMediaAudio(): TelegramMediaAudio = this as TelegramMediaAudio @PreviewFeature -inline fun TelegramMedia.whenTelegramMediaDocument(block: (TelegramMediaDocument) -> T) = asTelegramMediaDocument() ?.let(block) +inline fun TelegramMedia.whenTelegramMediaDocument(block: (TelegramMediaDocument) -> T) = + asTelegramMediaDocument()?.let(block) @PreviewFeature inline fun TelegramMedia.asTelegramMediaDocument(): TelegramMediaDocument? = this as? TelegramMediaDocument @@ -1959,7 +2106,8 @@ inline fun TelegramMedia.asTelegramMediaDocument(): TelegramMediaDocument? = thi inline fun TelegramMedia.requireTelegramMediaDocument(): TelegramMediaDocument = this as TelegramMediaDocument @PreviewFeature -inline fun TelegramMedia.whenTelegramMediaPhoto(block: (TelegramMediaPhoto) -> T) = asTelegramMediaPhoto() ?.let(block) +inline fun TelegramMedia.whenTelegramMediaPhoto(block: (TelegramMediaPhoto) -> T) = + asTelegramMediaPhoto()?.let(block) @PreviewFeature inline fun TelegramMedia.asTelegramMediaPhoto(): TelegramMediaPhoto? = this as? TelegramMediaPhoto @@ -1968,7 +2116,8 @@ inline fun TelegramMedia.asTelegramMediaPhoto(): TelegramMediaPhoto? = this as? inline fun TelegramMedia.requireTelegramMediaPhoto(): TelegramMediaPhoto = this as TelegramMediaPhoto @PreviewFeature -inline fun TelegramMedia.whenTelegramMediaVideo(block: (TelegramMediaVideo) -> T) = asTelegramMediaVideo() ?.let(block) +inline fun TelegramMedia.whenTelegramMediaVideo(block: (TelegramMediaVideo) -> T) = + asTelegramMediaVideo()?.let(block) @PreviewFeature inline fun TelegramMedia.asTelegramMediaVideo(): TelegramMediaVideo? = this as? TelegramMediaVideo @@ -1977,17 +2126,20 @@ inline fun TelegramMedia.asTelegramMediaVideo(): TelegramMediaVideo? = this as? inline fun TelegramMedia.requireTelegramMediaVideo(): TelegramMediaVideo = this as TelegramMediaVideo @PreviewFeature -inline fun TelegramMedia.whenMediaGroupMemberTelegramMedia(block: (MediaGroupMemberTelegramMedia) -> T) = asMediaGroupMemberTelegramMedia() ?.let(block) +inline fun TelegramMedia.whenMediaGroupMemberTelegramMedia(block: (MediaGroupMemberTelegramMedia) -> T) = + asMediaGroupMemberTelegramMedia()?.let(block) @PreviewFeature -inline fun TelegramMedia.asMediaGroupMemberTelegramMedia(): MediaGroupMemberTelegramMedia? = this as? MediaGroupMemberTelegramMedia +inline fun TelegramMedia.asMediaGroupMemberTelegramMedia(): MediaGroupMemberTelegramMedia? = + this as? MediaGroupMemberTelegramMedia @PreviewFeature inline fun TelegramMedia.requireMediaGroupMemberTelegramMedia(): MediaGroupMemberTelegramMedia = this as MediaGroupMemberTelegramMedia @PreviewFeature -inline fun TelegramMedia.whenSizedTelegramMedia(block: (SizedTelegramMedia) -> T) = asSizedTelegramMedia() ?.let(block) +inline fun TelegramMedia.whenSizedTelegramMedia(block: (SizedTelegramMedia) -> T) = + asSizedTelegramMedia()?.let(block) @PreviewFeature inline fun TelegramMedia.asSizedTelegramMedia(): SizedTelegramMedia? = this as? SizedTelegramMedia @@ -1996,7 +2148,8 @@ inline fun TelegramMedia.asSizedTelegramMedia(): SizedTelegramMedia? = this as? inline fun TelegramMedia.requireSizedTelegramMedia(): SizedTelegramMedia = this as SizedTelegramMedia @PreviewFeature -inline fun TelegramMedia.whenThumbedTelegramMedia(block: (ThumbedTelegramMedia) -> T) = asThumbedTelegramMedia() ?.let(block) +inline fun TelegramMedia.whenThumbedTelegramMedia(block: (ThumbedTelegramMedia) -> T) = + asThumbedTelegramMedia()?.let(block) @PreviewFeature inline fun TelegramMedia.asThumbedTelegramMedia(): ThumbedTelegramMedia? = this as? ThumbedTelegramMedia @@ -2005,7 +2158,8 @@ inline fun TelegramMedia.asThumbedTelegramMedia(): ThumbedTelegramMedia? = this inline fun TelegramMedia.requireThumbedTelegramMedia(): ThumbedTelegramMedia = this as ThumbedTelegramMedia @PreviewFeature -inline fun TelegramMedia.whenTitledTelegramMedia(block: (TitledTelegramMedia) -> T) = asTitledTelegramMedia() ?.let(block) +inline fun TelegramMedia.whenTitledTelegramMedia(block: (TitledTelegramMedia) -> T) = + asTitledTelegramMedia()?.let(block) @PreviewFeature inline fun TelegramMedia.asTitledTelegramMedia(): TitledTelegramMedia? = this as? TitledTelegramMedia @@ -2014,7 +2168,8 @@ inline fun TelegramMedia.asTitledTelegramMedia(): TitledTelegramMedia? = this as inline fun TelegramMedia.requireTitledTelegramMedia(): TitledTelegramMedia = this as TitledTelegramMedia @PreviewFeature -inline fun TelegramMedia.whenVisualMediaGroupMemberTelegramMedia(block: (VisualMediaGroupMemberTelegramMedia) -> T) = asVisualMediaGroupMemberTelegramMedia() ?.let(block) +inline fun TelegramMedia.whenVisualMediaGroupMemberTelegramMedia(block: (VisualMediaGroupMemberTelegramMedia) -> T) = + asVisualMediaGroupMemberTelegramMedia()?.let(block) @PreviewFeature inline fun TelegramMedia.asVisualMediaGroupMemberTelegramMedia(): VisualMediaGroupMemberTelegramMedia? = @@ -2025,7 +2180,7 @@ inline fun TelegramMedia.requireVisualMediaGroupMemberTelegramMedia(): VisualMed this as VisualMediaGroupMemberTelegramMedia @PreviewFeature -inline fun Update.whenCallbackQueryUpdate(block: (CallbackQueryUpdate) -> T) = asCallbackQueryUpdate() ?.let(block) +inline fun Update.whenCallbackQueryUpdate(block: (CallbackQueryUpdate) -> T) = asCallbackQueryUpdate()?.let(block) @PreviewFeature inline fun Update.asCallbackQueryUpdate(): CallbackQueryUpdate? = this as? CallbackQueryUpdate @@ -2034,7 +2189,7 @@ inline fun Update.asCallbackQueryUpdate(): CallbackQueryUpdate? = this as? Callb inline fun Update.requireCallbackQueryUpdate(): CallbackQueryUpdate = this as CallbackQueryUpdate @PreviewFeature -inline fun Update.whenChannelPostUpdate(block: (ChannelPostUpdate) -> T) = asChannelPostUpdate() ?.let(block) +inline fun Update.whenChannelPostUpdate(block: (ChannelPostUpdate) -> T) = asChannelPostUpdate()?.let(block) @PreviewFeature inline fun Update.asChannelPostUpdate(): ChannelPostUpdate? = this as? ChannelPostUpdate @@ -2043,7 +2198,8 @@ inline fun Update.asChannelPostUpdate(): ChannelPostUpdate? = this as? ChannelPo inline fun Update.requireChannelPostUpdate(): ChannelPostUpdate = this as ChannelPostUpdate @PreviewFeature -inline fun Update.whenChosenInlineResultUpdate(block: (ChosenInlineResultUpdate) -> T) = asChosenInlineResultUpdate() ?.let(block) +inline fun Update.whenChosenInlineResultUpdate(block: (ChosenInlineResultUpdate) -> T) = + asChosenInlineResultUpdate()?.let(block) @PreviewFeature inline fun Update.asChosenInlineResultUpdate(): ChosenInlineResultUpdate? = this as? ChosenInlineResultUpdate @@ -2052,7 +2208,8 @@ inline fun Update.asChosenInlineResultUpdate(): ChosenInlineResultUpdate? = this inline fun Update.requireChosenInlineResultUpdate(): ChosenInlineResultUpdate = this as ChosenInlineResultUpdate @PreviewFeature -inline fun Update.whenEditChannelPostUpdate(block: (EditChannelPostUpdate) -> T) = asEditChannelPostUpdate() ?.let(block) +inline fun Update.whenEditChannelPostUpdate(block: (EditChannelPostUpdate) -> T) = + asEditChannelPostUpdate()?.let(block) @PreviewFeature inline fun Update.asEditChannelPostUpdate(): EditChannelPostUpdate? = this as? EditChannelPostUpdate @@ -2061,7 +2218,7 @@ inline fun Update.asEditChannelPostUpdate(): EditChannelPostUpdate? = this as? E inline fun Update.requireEditChannelPostUpdate(): EditChannelPostUpdate = this as EditChannelPostUpdate @PreviewFeature -inline fun Update.whenEditMessageUpdate(block: (EditMessageUpdate) -> T) = asEditMessageUpdate() ?.let(block) +inline fun Update.whenEditMessageUpdate(block: (EditMessageUpdate) -> T) = asEditMessageUpdate()?.let(block) @PreviewFeature inline fun Update.asEditMessageUpdate(): EditMessageUpdate? = this as? EditMessageUpdate @@ -2070,7 +2227,7 @@ inline fun Update.asEditMessageUpdate(): EditMessageUpdate? = this as? EditMessa inline fun Update.requireEditMessageUpdate(): EditMessageUpdate = this as EditMessageUpdate @PreviewFeature -inline fun Update.whenInlineQueryUpdate(block: (InlineQueryUpdate) -> T) = asInlineQueryUpdate() ?.let(block) +inline fun Update.whenInlineQueryUpdate(block: (InlineQueryUpdate) -> T) = asInlineQueryUpdate()?.let(block) @PreviewFeature inline fun Update.asInlineQueryUpdate(): InlineQueryUpdate? = this as? InlineQueryUpdate @@ -2079,7 +2236,8 @@ inline fun Update.asInlineQueryUpdate(): InlineQueryUpdate? = this as? InlineQue inline fun Update.requireInlineQueryUpdate(): InlineQueryUpdate = this as InlineQueryUpdate @PreviewFeature -inline fun Update.whenChannelPostMediaGroupUpdate(block: (ChannelPostMediaGroupUpdate) -> T) = asChannelPostMediaGroupUpdate() ?.let(block) +inline fun Update.whenChannelPostMediaGroupUpdate(block: (ChannelPostMediaGroupUpdate) -> T) = + asChannelPostMediaGroupUpdate()?.let(block) @PreviewFeature inline fun Update.asChannelPostMediaGroupUpdate(): ChannelPostMediaGroupUpdate? = this as? ChannelPostMediaGroupUpdate @@ -2089,7 +2247,8 @@ inline fun Update.requireChannelPostMediaGroupUpdate(): ChannelPostMediaGroupUpd this as ChannelPostMediaGroupUpdate @PreviewFeature -inline fun Update.whenEditChannelPostMediaGroupUpdate(block: (EditChannelPostMediaGroupUpdate) -> T) = asEditChannelPostMediaGroupUpdate() ?.let(block) +inline fun Update.whenEditChannelPostMediaGroupUpdate(block: (EditChannelPostMediaGroupUpdate) -> T) = + asEditChannelPostMediaGroupUpdate()?.let(block) @PreviewFeature inline fun Update.asEditChannelPostMediaGroupUpdate(): EditChannelPostMediaGroupUpdate? = @@ -2100,7 +2259,8 @@ inline fun Update.requireEditChannelPostMediaGroupUpdate(): EditChannelPostMedia this as EditChannelPostMediaGroupUpdate @PreviewFeature -inline fun Update.whenEditMediaGroupUpdate(block: (EditMediaGroupUpdate) -> T) = asEditMediaGroupUpdate() ?.let(block) +inline fun Update.whenEditMediaGroupUpdate(block: (EditMediaGroupUpdate) -> T) = + asEditMediaGroupUpdate()?.let(block) @PreviewFeature inline fun Update.asEditMediaGroupUpdate(): EditMediaGroupUpdate? = this as? EditMediaGroupUpdate @@ -2109,7 +2269,8 @@ inline fun Update.asEditMediaGroupUpdate(): EditMediaGroupUpdate? = this as? Edi inline fun Update.requireEditMediaGroupUpdate(): EditMediaGroupUpdate = this as EditMediaGroupUpdate @PreviewFeature -inline fun Update.whenEditMessageMediaGroupUpdate(block: (EditMessageMediaGroupUpdate) -> T) = asEditMessageMediaGroupUpdate() ?.let(block) +inline fun Update.whenEditMessageMediaGroupUpdate(block: (EditMessageMediaGroupUpdate) -> T) = + asEditMessageMediaGroupUpdate()?.let(block) @PreviewFeature inline fun Update.asEditMessageMediaGroupUpdate(): EditMessageMediaGroupUpdate? = this as? EditMessageMediaGroupUpdate @@ -2119,7 +2280,7 @@ inline fun Update.requireEditMessageMediaGroupUpdate(): EditMessageMediaGroupUpd this as EditMessageMediaGroupUpdate @PreviewFeature -inline fun Update.whenMediaGroupUpdate(block: (MediaGroupUpdate) -> T) = asMediaGroupUpdate() ?.let(block) +inline fun Update.whenMediaGroupUpdate(block: (MediaGroupUpdate) -> T) = asMediaGroupUpdate()?.let(block) @PreviewFeature inline fun Update.asMediaGroupUpdate(): MediaGroupUpdate? = this as? MediaGroupUpdate @@ -2128,7 +2289,8 @@ inline fun Update.asMediaGroupUpdate(): MediaGroupUpdate? = this as? MediaGroupU inline fun Update.requireMediaGroupUpdate(): MediaGroupUpdate = this as MediaGroupUpdate @PreviewFeature -inline fun Update.whenMessageMediaGroupUpdate(block: (MessageMediaGroupUpdate) -> T) = asMessageMediaGroupUpdate() ?.let(block) +inline fun Update.whenMessageMediaGroupUpdate(block: (MessageMediaGroupUpdate) -> T) = + asMessageMediaGroupUpdate()?.let(block) @PreviewFeature inline fun Update.asMessageMediaGroupUpdate(): MessageMediaGroupUpdate? = this as? MessageMediaGroupUpdate @@ -2137,7 +2299,8 @@ inline fun Update.asMessageMediaGroupUpdate(): MessageMediaGroupUpdate? = this a inline fun Update.requireMessageMediaGroupUpdate(): MessageMediaGroupUpdate = this as MessageMediaGroupUpdate @PreviewFeature -inline fun Update.whenSentMediaGroupUpdate(block: (SentMediaGroupUpdate) -> T) = asSentMediaGroupUpdate() ?.let(block) +inline fun Update.whenSentMediaGroupUpdate(block: (SentMediaGroupUpdate) -> T) = + asSentMediaGroupUpdate()?.let(block) @PreviewFeature inline fun Update.asSentMediaGroupUpdate(): SentMediaGroupUpdate? = this as? SentMediaGroupUpdate @@ -2146,7 +2309,7 @@ inline fun Update.asSentMediaGroupUpdate(): SentMediaGroupUpdate? = this as? Sen inline fun Update.requireSentMediaGroupUpdate(): SentMediaGroupUpdate = this as SentMediaGroupUpdate @PreviewFeature -inline fun Update.whenMessageUpdate(block: (MessageUpdate) -> T) = asMessageUpdate() ?.let(block) +inline fun Update.whenMessageUpdate(block: (MessageUpdate) -> T) = asMessageUpdate()?.let(block) @PreviewFeature inline fun Update.asMessageUpdate(): MessageUpdate? = this as? MessageUpdate @@ -2155,7 +2318,7 @@ inline fun Update.asMessageUpdate(): MessageUpdate? = this as? MessageUpdate inline fun Update.requireMessageUpdate(): MessageUpdate = this as MessageUpdate @PreviewFeature -inline fun Update.whenPollAnswerUpdate(block: (PollAnswerUpdate) -> T) = asPollAnswerUpdate() ?.let(block) +inline fun Update.whenPollAnswerUpdate(block: (PollAnswerUpdate) -> T) = asPollAnswerUpdate()?.let(block) @PreviewFeature inline fun Update.asPollAnswerUpdate(): PollAnswerUpdate? = this as? PollAnswerUpdate @@ -2164,7 +2327,7 @@ inline fun Update.asPollAnswerUpdate(): PollAnswerUpdate? = this as? PollAnswerU inline fun Update.requirePollAnswerUpdate(): PollAnswerUpdate = this as PollAnswerUpdate @PreviewFeature -inline fun Update.whenPollUpdate(block: (PollUpdate) -> T) = asPollUpdate() ?.let(block) +inline fun Update.whenPollUpdate(block: (PollUpdate) -> T) = asPollUpdate()?.let(block) @PreviewFeature inline fun Update.asPollUpdate(): PollUpdate? = this as? PollUpdate @@ -2173,7 +2336,8 @@ inline fun Update.asPollUpdate(): PollUpdate? = this as? PollUpdate inline fun Update.requirePollUpdate(): PollUpdate = this as PollUpdate @PreviewFeature -inline fun Update.whenPreCheckoutQueryUpdate(block: (PreCheckoutQueryUpdate) -> T) = asPreCheckoutQueryUpdate() ?.let(block) +inline fun Update.whenPreCheckoutQueryUpdate(block: (PreCheckoutQueryUpdate) -> T) = + asPreCheckoutQueryUpdate()?.let(block) @PreviewFeature inline fun Update.asPreCheckoutQueryUpdate(): PreCheckoutQueryUpdate? = this as? PreCheckoutQueryUpdate @@ -2182,7 +2346,7 @@ inline fun Update.asPreCheckoutQueryUpdate(): PreCheckoutQueryUpdate? = this as? inline fun Update.requirePreCheckoutQueryUpdate(): PreCheckoutQueryUpdate = this as PreCheckoutQueryUpdate @PreviewFeature -inline fun Update.whenShippingQueryUpdate(block: (ShippingQueryUpdate) -> T) = asShippingQueryUpdate() ?.let(block) +inline fun Update.whenShippingQueryUpdate(block: (ShippingQueryUpdate) -> T) = asShippingQueryUpdate()?.let(block) @PreviewFeature inline fun Update.asShippingQueryUpdate(): ShippingQueryUpdate? = this as? ShippingQueryUpdate @@ -2191,7 +2355,8 @@ inline fun Update.asShippingQueryUpdate(): ShippingQueryUpdate? = this as? Shipp inline fun Update.requireShippingQueryUpdate(): ShippingQueryUpdate = this as ShippingQueryUpdate @PreviewFeature -inline fun Update.whenBaseEditMessageUpdate(block: (BaseEditMessageUpdate) -> T) = asBaseEditMessageUpdate() ?.let(block) +inline fun Update.whenBaseEditMessageUpdate(block: (BaseEditMessageUpdate) -> T) = + asBaseEditMessageUpdate()?.let(block) @PreviewFeature inline fun Update.asBaseEditMessageUpdate(): BaseEditMessageUpdate? = this as? BaseEditMessageUpdate @@ -2200,7 +2365,7 @@ inline fun Update.asBaseEditMessageUpdate(): BaseEditMessageUpdate? = this as? B inline fun Update.requireBaseEditMessageUpdate(): BaseEditMessageUpdate = this as BaseEditMessageUpdate @PreviewFeature -inline fun Update.whenBaseMessageUpdate(block: (BaseMessageUpdate) -> T) = asBaseMessageUpdate() ?.let(block) +inline fun Update.whenBaseMessageUpdate(block: (BaseMessageUpdate) -> T) = asBaseMessageUpdate()?.let(block) @PreviewFeature inline fun Update.asBaseMessageUpdate(): BaseMessageUpdate? = this as? BaseMessageUpdate @@ -2209,7 +2374,8 @@ inline fun Update.asBaseMessageUpdate(): BaseMessageUpdate? = this as? BaseMessa inline fun Update.requireBaseMessageUpdate(): BaseMessageUpdate = this as BaseMessageUpdate @PreviewFeature -inline fun Update.whenBaseSentMessageUpdate(block: (BaseSentMessageUpdate) -> T) = asBaseSentMessageUpdate() ?.let(block) +inline fun Update.whenBaseSentMessageUpdate(block: (BaseSentMessageUpdate) -> T) = + asBaseSentMessageUpdate()?.let(block) @PreviewFeature inline fun Update.asBaseSentMessageUpdate(): BaseSentMessageUpdate? = this as? BaseSentMessageUpdate @@ -2218,7 +2384,7 @@ inline fun Update.asBaseSentMessageUpdate(): BaseSentMessageUpdate? = this as? B inline fun Update.requireBaseSentMessageUpdate(): BaseSentMessageUpdate = this as BaseSentMessageUpdate @PreviewFeature -inline fun Update.whenUnknownUpdate(block: (UnknownUpdate) -> T) = asUnknownUpdate() ?.let(block) +inline fun Update.whenUnknownUpdate(block: (UnknownUpdate) -> T) = asUnknownUpdate()?.let(block) @PreviewFeature inline fun Update.asUnknownUpdate(): UnknownUpdate? = this as? UnknownUpdate @@ -2227,7 +2393,8 @@ inline fun Update.asUnknownUpdate(): UnknownUpdate? = this as? UnknownUpdate inline fun Update.requireUnknownUpdate(): UnknownUpdate = this as UnknownUpdate @PreviewFeature -inline fun Update.whenCommonChatMemberUpdatedUpdate(block: (CommonChatMemberUpdatedUpdate) -> T) = asCommonChatMemberUpdatedUpdate() ?.let(block) +inline fun Update.whenCommonChatMemberUpdatedUpdate(block: (CommonChatMemberUpdatedUpdate) -> T) = + asCommonChatMemberUpdatedUpdate()?.let(block) @PreviewFeature inline fun Update.asCommonChatMemberUpdatedUpdate(): CommonChatMemberUpdatedUpdate? = @@ -2238,7 +2405,8 @@ inline fun Update.requireCommonChatMemberUpdatedUpdate(): CommonChatMemberUpdate this as CommonChatMemberUpdatedUpdate @PreviewFeature -inline fun Update.whenMyChatMemberUpdatedUpdate(block: (MyChatMemberUpdatedUpdate) -> T) = asMyChatMemberUpdatedUpdate() ?.let(block) +inline fun Update.whenMyChatMemberUpdatedUpdate(block: (MyChatMemberUpdatedUpdate) -> T) = + asMyChatMemberUpdatedUpdate()?.let(block) @PreviewFeature inline fun Update.asMyChatMemberUpdatedUpdate(): MyChatMemberUpdatedUpdate? = this as? MyChatMemberUpdatedUpdate @@ -2247,7 +2415,8 @@ inline fun Update.asMyChatMemberUpdatedUpdate(): MyChatMemberUpdatedUpdate? = th inline fun Update.requireMyChatMemberUpdatedUpdate(): MyChatMemberUpdatedUpdate = this as MyChatMemberUpdatedUpdate @PreviewFeature -inline fun Update.whenChatMemberUpdatedUpdate(block: (ChatMemberUpdatedUpdate) -> T) = asChatMemberUpdatedUpdate() ?.let(block) +inline fun Update.whenChatMemberUpdatedUpdate(block: (ChatMemberUpdatedUpdate) -> T) = + asChatMemberUpdatedUpdate()?.let(block) @PreviewFeature inline fun Update.asChatMemberUpdatedUpdate(): ChatMemberUpdatedUpdate? = this as? ChatMemberUpdatedUpdate @@ -2256,7 +2425,8 @@ inline fun Update.asChatMemberUpdatedUpdate(): ChatMemberUpdatedUpdate? = this a inline fun Update.requireChatMemberUpdatedUpdate(): ChatMemberUpdatedUpdate = this as ChatMemberUpdatedUpdate @PreviewFeature -inline fun Update.whenChatJoinRequestUpdate(block: (ChatJoinRequestUpdate) -> T) = asChatJoinRequestUpdate() ?.let(block) +inline fun Update.whenChatJoinRequestUpdate(block: (ChatJoinRequestUpdate) -> T) = + asChatJoinRequestUpdate()?.let(block) @PreviewFeature inline fun Update.asChatJoinRequestUpdate(): ChatJoinRequestUpdate? = this as? ChatJoinRequestUpdate @@ -2265,7 +2435,7 @@ inline fun Update.asChatJoinRequestUpdate(): ChatJoinRequestUpdate? = this as? C inline fun Update.requireChatJoinRequestUpdate(): ChatJoinRequestUpdate = this as ChatJoinRequestUpdate @PreviewFeature -inline fun TelegramMediaFile.whenAnimationFile(block: (AnimationFile) -> T) = asAnimationFile() ?.let(block) +inline fun TelegramMediaFile.whenAnimationFile(block: (AnimationFile) -> T) = asAnimationFile()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asAnimationFile(): AnimationFile? = this as? AnimationFile @@ -2274,7 +2444,7 @@ inline fun TelegramMediaFile.asAnimationFile(): AnimationFile? = this as? Animat inline fun TelegramMediaFile.requireAnimationFile(): AnimationFile = this as AnimationFile @PreviewFeature -inline fun TelegramMediaFile.whenAudioFile(block: (AudioFile) -> T) = asAudioFile() ?.let(block) +inline fun TelegramMediaFile.whenAudioFile(block: (AudioFile) -> T) = asAudioFile()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asAudioFile(): AudioFile? = this as? AudioFile @@ -2283,7 +2453,7 @@ inline fun TelegramMediaFile.asAudioFile(): AudioFile? = this as? AudioFile inline fun TelegramMediaFile.requireAudioFile(): AudioFile = this as AudioFile @PreviewFeature -inline fun TelegramMediaFile.whenDocumentFile(block: (DocumentFile) -> T) = asDocumentFile() ?.let(block) +inline fun TelegramMediaFile.whenDocumentFile(block: (DocumentFile) -> T) = asDocumentFile()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asDocumentFile(): DocumentFile? = this as? DocumentFile @@ -2292,7 +2462,7 @@ inline fun TelegramMediaFile.asDocumentFile(): DocumentFile? = this as? Document inline fun TelegramMediaFile.requireDocumentFile(): DocumentFile = this as DocumentFile @PreviewFeature -inline fun TelegramMediaFile.whenFile(block: (File) -> T) = asFile() ?.let(block) +inline fun TelegramMediaFile.whenFile(block: (File) -> T) = asFile()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asFile(): File? = this as? File @@ -2301,7 +2471,7 @@ inline fun TelegramMediaFile.asFile(): File? = this as? File inline fun TelegramMediaFile.requireFile(): File = this as File @PreviewFeature -inline fun TelegramMediaFile.whenPathedFile(block: (PathedFile) -> T) = asPathedFile() ?.let(block) +inline fun TelegramMediaFile.whenPathedFile(block: (PathedFile) -> T) = asPathedFile()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asPathedFile(): PathedFile? = this as? PathedFile @@ -2310,7 +2480,7 @@ inline fun TelegramMediaFile.asPathedFile(): PathedFile? = this as? PathedFile inline fun TelegramMediaFile.requirePathedFile(): PathedFile = this as PathedFile @PreviewFeature -inline fun TelegramMediaFile.whenPhotoSize(block: (PhotoSize) -> T) = asPhotoSize() ?.let(block) +inline fun TelegramMediaFile.whenPhotoSize(block: (PhotoSize) -> T) = asPhotoSize()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asPhotoSize(): PhotoSize? = this as? PhotoSize @@ -2319,7 +2489,7 @@ inline fun TelegramMediaFile.asPhotoSize(): PhotoSize? = this as? PhotoSize inline fun TelegramMediaFile.requirePhotoSize(): PhotoSize = this as PhotoSize @PreviewFeature -inline fun TelegramMediaFile.whenSticker(block: (Sticker) -> T) = asSticker() ?.let(block) +inline fun TelegramMediaFile.whenSticker(block: (Sticker) -> T) = asSticker()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asSticker(): Sticker? = this as? Sticker @@ -2328,7 +2498,7 @@ inline fun TelegramMediaFile.asSticker(): Sticker? = this as? Sticker inline fun TelegramMediaFile.requireSticker(): Sticker = this as Sticker @PreviewFeature -inline fun TelegramMediaFile.whenSimpleSticker(block: (SimpleSticker) -> T) = asSimpleSticker() ?.let(block) +inline fun TelegramMediaFile.whenSimpleSticker(block: (SimpleSticker) -> T) = asSimpleSticker()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asSimpleSticker(): SimpleSticker? = this as? SimpleSticker @@ -2337,7 +2507,7 @@ inline fun TelegramMediaFile.asSimpleSticker(): SimpleSticker? = this as? Simple inline fun TelegramMediaFile.requireSimpleSticker(): SimpleSticker = this as SimpleSticker @PreviewFeature -inline fun TelegramMediaFile.whenAnimatedSticker(block: (AnimatedSticker) -> T) = asAnimatedSticker() ?.let(block) +inline fun TelegramMediaFile.whenAnimatedSticker(block: (AnimatedSticker) -> T) = asAnimatedSticker()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asAnimatedSticker(): AnimatedSticker? = this as? AnimatedSticker @@ -2346,7 +2516,7 @@ inline fun TelegramMediaFile.asAnimatedSticker(): AnimatedSticker? = this as? An inline fun TelegramMediaFile.requireAnimatedSticker(): AnimatedSticker = this as AnimatedSticker @PreviewFeature -inline fun TelegramMediaFile.whenVideoSticker(block: (VideoSticker) -> T) = asVideoSticker() ?.let(block) +inline fun TelegramMediaFile.whenVideoSticker(block: (VideoSticker) -> T) = asVideoSticker()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asVideoSticker(): VideoSticker? = this as? VideoSticker @@ -2355,7 +2525,7 @@ inline fun TelegramMediaFile.asVideoSticker(): VideoSticker? = this as? VideoSti inline fun TelegramMediaFile.requireVideoSticker(): VideoSticker = this as VideoSticker @PreviewFeature -inline fun TelegramMediaFile.whenVideoFile(block: (VideoFile) -> T) = asVideoFile() ?.let(block) +inline fun TelegramMediaFile.whenVideoFile(block: (VideoFile) -> T) = asVideoFile()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asVideoFile(): VideoFile? = this as? VideoFile @@ -2364,7 +2534,7 @@ inline fun TelegramMediaFile.asVideoFile(): VideoFile? = this as? VideoFile inline fun TelegramMediaFile.requireVideoFile(): VideoFile = this as VideoFile @PreviewFeature -inline fun TelegramMediaFile.whenVideoNoteFile(block: (VideoNoteFile) -> T) = asVideoNoteFile() ?.let(block) +inline fun TelegramMediaFile.whenVideoNoteFile(block: (VideoNoteFile) -> T) = asVideoNoteFile()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asVideoNoteFile(): VideoNoteFile? = this as? VideoNoteFile @@ -2373,7 +2543,7 @@ inline fun TelegramMediaFile.asVideoNoteFile(): VideoNoteFile? = this as? VideoN inline fun TelegramMediaFile.requireVideoNoteFile(): VideoNoteFile = this as VideoNoteFile @PreviewFeature -inline fun TelegramMediaFile.whenVoiceFile(block: (VoiceFile) -> T) = asVoiceFile() ?.let(block) +inline fun TelegramMediaFile.whenVoiceFile(block: (VoiceFile) -> T) = asVoiceFile()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asVoiceFile(): VoiceFile? = this as? VoiceFile @@ -2382,7 +2552,7 @@ inline fun TelegramMediaFile.asVoiceFile(): VoiceFile? = this as? VoiceFile inline fun TelegramMediaFile.requireVoiceFile(): VoiceFile = this as VoiceFile @PreviewFeature -inline fun TelegramMediaFile.whenMimedMediaFile(block: (MimedMediaFile) -> T) = asMimedMediaFile() ?.let(block) +inline fun TelegramMediaFile.whenMimedMediaFile(block: (MimedMediaFile) -> T) = asMimedMediaFile()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asMimedMediaFile(): MimedMediaFile? = this as? MimedMediaFile @@ -2391,7 +2561,8 @@ inline fun TelegramMediaFile.asMimedMediaFile(): MimedMediaFile? = this as? Mime inline fun TelegramMediaFile.requireMimedMediaFile(): MimedMediaFile = this as MimedMediaFile @PreviewFeature -inline fun TelegramMediaFile.whenPlayableMediaFile(block: (PlayableMediaFile) -> T) = asPlayableMediaFile() ?.let(block) +inline fun TelegramMediaFile.whenPlayableMediaFile(block: (PlayableMediaFile) -> T) = + asPlayableMediaFile()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asPlayableMediaFile(): PlayableMediaFile? = this as? PlayableMediaFile @@ -2400,7 +2571,7 @@ inline fun TelegramMediaFile.asPlayableMediaFile(): PlayableMediaFile? = this as inline fun TelegramMediaFile.requirePlayableMediaFile(): PlayableMediaFile = this as PlayableMediaFile @PreviewFeature -inline fun TelegramMediaFile.whenSizedMediaFile(block: (SizedMediaFile) -> T) = asSizedMediaFile() ?.let(block) +inline fun TelegramMediaFile.whenSizedMediaFile(block: (SizedMediaFile) -> T) = asSizedMediaFile()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asSizedMediaFile(): SizedMediaFile? = this as? SizedMediaFile @@ -2409,7 +2580,7 @@ inline fun TelegramMediaFile.asSizedMediaFile(): SizedMediaFile? = this as? Size inline fun TelegramMediaFile.requireSizedMediaFile(): SizedMediaFile = this as SizedMediaFile @PreviewFeature -inline fun TelegramMediaFile.whenThumbedMediaFile(block: (ThumbedMediaFile) -> T) = asThumbedMediaFile() ?.let(block) +inline fun TelegramMediaFile.whenThumbedMediaFile(block: (ThumbedMediaFile) -> T) = asThumbedMediaFile()?.let(block) @PreviewFeature inline fun TelegramMediaFile.asThumbedMediaFile(): ThumbedMediaFile? = this as? ThumbedMediaFile @@ -2418,7 +2589,7 @@ inline fun TelegramMediaFile.asThumbedMediaFile(): ThumbedMediaFile? = this as? inline fun TelegramMediaFile.requireThumbedMediaFile(): ThumbedMediaFile = this as ThumbedMediaFile @PreviewFeature -inline fun KeyboardMarkup.whenForceReply(block: (ReplyForce) -> T) = asForceReply() ?.let(block) +inline fun KeyboardMarkup.whenForceReply(block: (ReplyForce) -> T) = asForceReply()?.let(block) @PreviewFeature inline fun KeyboardMarkup.asForceReply(): ReplyForce? = this as? ReplyForce @@ -2427,7 +2598,8 @@ inline fun KeyboardMarkup.asForceReply(): ReplyForce? = this as? ReplyForce inline fun KeyboardMarkup.requireForceReply(): ReplyForce = this as ReplyForce @PreviewFeature -inline fun KeyboardMarkup.whenInlineKeyboardMarkup(block: (InlineKeyboardMarkup) -> T) = asInlineKeyboardMarkup() ?.let(block) +inline fun KeyboardMarkup.whenInlineKeyboardMarkup(block: (InlineKeyboardMarkup) -> T) = + asInlineKeyboardMarkup()?.let(block) @PreviewFeature inline fun KeyboardMarkup.asInlineKeyboardMarkup(): InlineKeyboardMarkup? = this as? InlineKeyboardMarkup @@ -2436,7 +2608,8 @@ inline fun KeyboardMarkup.asInlineKeyboardMarkup(): InlineKeyboardMarkup? = this inline fun KeyboardMarkup.requireInlineKeyboardMarkup(): InlineKeyboardMarkup = this as InlineKeyboardMarkup @PreviewFeature -inline fun KeyboardMarkup.whenReplyKeyboardMarkup(block: (ReplyKeyboardMarkup) -> T) = asReplyKeyboardMarkup() ?.let(block) +inline fun KeyboardMarkup.whenReplyKeyboardMarkup(block: (ReplyKeyboardMarkup) -> T) = + asReplyKeyboardMarkup()?.let(block) @PreviewFeature inline fun KeyboardMarkup.asReplyKeyboardMarkup(): ReplyKeyboardMarkup? = this as? ReplyKeyboardMarkup @@ -2445,7 +2618,8 @@ inline fun KeyboardMarkup.asReplyKeyboardMarkup(): ReplyKeyboardMarkup? = this a inline fun KeyboardMarkup.requireReplyKeyboardMarkup(): ReplyKeyboardMarkup = this as ReplyKeyboardMarkup @PreviewFeature -inline fun KeyboardMarkup.whenReplyKeyboardRemove(block: (ReplyKeyboardRemove) -> T) = asReplyKeyboardRemove() ?.let(block) +inline fun KeyboardMarkup.whenReplyKeyboardRemove(block: (ReplyKeyboardRemove) -> T) = + asReplyKeyboardRemove()?.let(block) @PreviewFeature inline fun KeyboardMarkup.asReplyKeyboardRemove(): ReplyKeyboardRemove? = this as? ReplyKeyboardRemove @@ -2454,7 +2628,8 @@ inline fun KeyboardMarkup.asReplyKeyboardRemove(): ReplyKeyboardRemove? = this a inline fun KeyboardMarkup.requireReplyKeyboardRemove(): ReplyKeyboardRemove = this as ReplyKeyboardRemove @PreviewFeature -inline fun InlineKeyboardButton.whenCallbackDataInlineKeyboardButton(block: (CallbackDataInlineKeyboardButton) -> T) = asCallbackDataInlineKeyboardButton() ?.let(block) +inline fun InlineKeyboardButton.whenCallbackDataInlineKeyboardButton(block: (CallbackDataInlineKeyboardButton) -> T) = + asCallbackDataInlineKeyboardButton()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.asCallbackDataInlineKeyboardButton(): CallbackDataInlineKeyboardButton? = @@ -2465,7 +2640,8 @@ inline fun InlineKeyboardButton.requireCallbackDataInlineKeyboardButton(): Callb this as CallbackDataInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.whenCallbackGameInlineKeyboardButton(block: (CallbackGameInlineKeyboardButton) -> T) = asCallbackGameInlineKeyboardButton() ?.let(block) +inline fun InlineKeyboardButton.whenCallbackGameInlineKeyboardButton(block: (CallbackGameInlineKeyboardButton) -> T) = + asCallbackGameInlineKeyboardButton()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.asCallbackGameInlineKeyboardButton(): CallbackGameInlineKeyboardButton? = @@ -2476,7 +2652,8 @@ inline fun InlineKeyboardButton.requireCallbackGameInlineKeyboardButton(): Callb this as CallbackGameInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.whenLoginURLInlineKeyboardButton(block: (LoginURLInlineKeyboardButton) -> T) = asLoginURLInlineKeyboardButton() ?.let(block) +inline fun InlineKeyboardButton.whenLoginURLInlineKeyboardButton(block: (LoginURLInlineKeyboardButton) -> T) = + asLoginURLInlineKeyboardButton()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.asLoginURLInlineKeyboardButton(): LoginURLInlineKeyboardButton? = @@ -2487,7 +2664,8 @@ inline fun InlineKeyboardButton.requireLoginURLInlineKeyboardButton(): LoginURLI this as LoginURLInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.whenPayInlineKeyboardButton(block: (PayInlineKeyboardButton) -> T) = asPayInlineKeyboardButton() ?.let(block) +inline fun InlineKeyboardButton.whenPayInlineKeyboardButton(block: (PayInlineKeyboardButton) -> T) = + asPayInlineKeyboardButton()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.asPayInlineKeyboardButton(): PayInlineKeyboardButton? = this as? PayInlineKeyboardButton @@ -2497,7 +2675,8 @@ inline fun InlineKeyboardButton.requirePayInlineKeyboardButton(): PayInlineKeybo this as PayInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.whenSwitchInlineQueryCurrentChatInlineKeyboardButton(block: (SwitchInlineQueryCurrentChatInlineKeyboardButton) -> T) = asSwitchInlineQueryCurrentChatInlineKeyboardButton() ?.let(block) +inline fun InlineKeyboardButton.whenSwitchInlineQueryCurrentChatInlineKeyboardButton(block: (SwitchInlineQueryCurrentChatInlineKeyboardButton) -> T) = + asSwitchInlineQueryCurrentChatInlineKeyboardButton()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.asSwitchInlineQueryCurrentChatInlineKeyboardButton(): SwitchInlineQueryCurrentChatInlineKeyboardButton? = @@ -2508,7 +2687,8 @@ inline fun InlineKeyboardButton.requireSwitchInlineQueryCurrentChatInlineKeyboar this as SwitchInlineQueryCurrentChatInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.whenSwitchInlineQueryInlineKeyboardButton(block: (SwitchInlineQueryInlineKeyboardButton) -> T) = asSwitchInlineQueryInlineKeyboardButton() ?.let(block) +inline fun InlineKeyboardButton.whenSwitchInlineQueryInlineKeyboardButton(block: (SwitchInlineQueryInlineKeyboardButton) -> T) = + asSwitchInlineQueryInlineKeyboardButton()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.asSwitchInlineQueryInlineKeyboardButton(): SwitchInlineQueryInlineKeyboardButton? = @@ -2519,7 +2699,8 @@ inline fun InlineKeyboardButton.requireSwitchInlineQueryInlineKeyboardButton(): this as SwitchInlineQueryInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.whenURLInlineKeyboardButton(block: (URLInlineKeyboardButton) -> T) = asURLInlineKeyboardButton() ?.let(block) +inline fun InlineKeyboardButton.whenURLInlineKeyboardButton(block: (URLInlineKeyboardButton) -> T) = + asURLInlineKeyboardButton()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.asURLInlineKeyboardButton(): URLInlineKeyboardButton? = this as? URLInlineKeyboardButton @@ -2529,7 +2710,8 @@ inline fun InlineKeyboardButton.requireURLInlineKeyboardButton(): URLInlineKeybo this as URLInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.whenWebAppKeyboardButton(block: (WebAppKeyboardButton) -> T) = asWebAppKeyboardButton() ?.let(block) +inline fun InlineKeyboardButton.whenWebAppKeyboardButton(block: (WebAppKeyboardButton) -> T) = + asWebAppKeyboardButton()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.asWebAppKeyboardButton(): WebAppKeyboardButton? = this as? WebAppKeyboardButton @@ -2539,7 +2721,8 @@ inline fun InlineKeyboardButton.requireWebAppKeyboardButton(): WebAppKeyboardBut this as WebAppKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.whenUnknownInlineKeyboardButton(block: (UnknownInlineKeyboardButton) -> T) = asUnknownInlineKeyboardButton() ?.let(block) +inline fun InlineKeyboardButton.whenUnknownInlineKeyboardButton(block: (UnknownInlineKeyboardButton) -> T) = + asUnknownInlineKeyboardButton()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.asUnknownInlineKeyboardButton(): UnknownInlineKeyboardButton? = @@ -2550,7 +2733,7 @@ inline fun InlineKeyboardButton.requireUnknownInlineKeyboardButton(): UnknownInl this as UnknownInlineKeyboardButton @PreviewFeature -inline fun Poll.whenMultipleAnswersPoll(block: (MultipleAnswersPoll) -> T) = asMultipleAnswersPoll() ?.let(block) +inline fun Poll.whenMultipleAnswersPoll(block: (MultipleAnswersPoll) -> T) = asMultipleAnswersPoll()?.let(block) @PreviewFeature inline fun Poll.asMultipleAnswersPoll(): MultipleAnswersPoll? = this as? MultipleAnswersPoll @@ -2559,7 +2742,7 @@ inline fun Poll.asMultipleAnswersPoll(): MultipleAnswersPoll? = this as? Multipl inline fun Poll.requireMultipleAnswersPoll(): MultipleAnswersPoll = this as MultipleAnswersPoll @PreviewFeature -inline fun Poll.whenQuizPoll(block: (QuizPoll) -> T) = asQuizPoll() ?.let(block) +inline fun Poll.whenQuizPoll(block: (QuizPoll) -> T) = asQuizPoll()?.let(block) @PreviewFeature inline fun Poll.asQuizPoll(): QuizPoll? = this as? QuizPoll @@ -2568,7 +2751,7 @@ inline fun Poll.asQuizPoll(): QuizPoll? = this as? QuizPoll inline fun Poll.requireQuizPoll(): QuizPoll = this as QuizPoll @PreviewFeature -inline fun Poll.whenRegularPoll(block: (RegularPoll) -> T) = asRegularPoll() ?.let(block) +inline fun Poll.whenRegularPoll(block: (RegularPoll) -> T) = asRegularPoll()?.let(block) @PreviewFeature inline fun Poll.asRegularPoll(): RegularPoll? = this as? RegularPoll @@ -2577,7 +2760,7 @@ inline fun Poll.asRegularPoll(): RegularPoll? = this as? RegularPoll inline fun Poll.requireRegularPoll(): RegularPoll = this as RegularPoll @PreviewFeature -inline fun Poll.whenUnknownPollType(block: (UnknownPollType) -> T) = asUnknownPollType() ?.let(block) +inline fun Poll.whenUnknownPollType(block: (UnknownPollType) -> T) = asUnknownPollType()?.let(block) @PreviewFeature inline fun Poll.asUnknownPollType(): UnknownPollType? = this as? UnknownPollType @@ -2586,7 +2769,7 @@ inline fun Poll.asUnknownPollType(): UnknownPollType? = this as? UnknownPollType inline fun Poll.requireUnknownPollType(): UnknownPollType = this as UnknownPollType @PreviewFeature -inline fun ResendableContent.whenContactContent(block: (ContactContent) -> T) = asContactContent() ?.let(block) +inline fun ResendableContent.whenContactContent(block: (ContactContent) -> T) = asContactContent()?.let(block) @PreviewFeature inline fun ResendableContent.asContactContent(): ContactContent? = this as? ContactContent @@ -2595,7 +2778,7 @@ inline fun ResendableContent.asContactContent(): ContactContent? = this as? Cont inline fun ResendableContent.requireContactContent(): ContactContent = this as ContactContent @PreviewFeature -inline fun ResendableContent.whenDiceContent(block: (DiceContent) -> T) = asDiceContent() ?.let(block) +inline fun ResendableContent.whenDiceContent(block: (DiceContent) -> T) = asDiceContent()?.let(block) @PreviewFeature inline fun ResendableContent.asDiceContent(): DiceContent? = this as? DiceContent @@ -2604,7 +2787,7 @@ inline fun ResendableContent.asDiceContent(): DiceContent? = this as? DiceConten inline fun ResendableContent.requireDiceContent(): DiceContent = this as DiceContent @PreviewFeature -inline fun ResendableContent.whenGameContent(block: (GameContent) -> T) = asGameContent() ?.let(block) +inline fun ResendableContent.whenGameContent(block: (GameContent) -> T) = asGameContent()?.let(block) @PreviewFeature inline fun ResendableContent.asGameContent(): GameContent? = this as? GameContent @@ -2613,7 +2796,7 @@ inline fun ResendableContent.asGameContent(): GameContent? = this as? GameConten inline fun ResendableContent.requireGameContent(): GameContent = this as GameContent @PreviewFeature -inline fun ResendableContent.whenLocationContent(block: (LocationContent) -> T) = asLocationContent() ?.let(block) +inline fun ResendableContent.whenLocationContent(block: (LocationContent) -> T) = asLocationContent()?.let(block) @PreviewFeature inline fun ResendableContent.asLocationContent(): LocationContent? = this as? LocationContent @@ -2622,7 +2805,8 @@ inline fun ResendableContent.asLocationContent(): LocationContent? = this as? Lo inline fun ResendableContent.requireLocationContent(): LocationContent = this as LocationContent @PreviewFeature -inline fun ResendableContent.whenLiveLocationContent(block: (LiveLocationContent) -> T) = asLiveLocationContent() ?.let(block) +inline fun ResendableContent.whenLiveLocationContent(block: (LiveLocationContent) -> T) = + asLiveLocationContent()?.let(block) @PreviewFeature inline fun ResendableContent.asLiveLocationContent(): LiveLocationContent? = this as? LiveLocationContent @@ -2631,7 +2815,8 @@ inline fun ResendableContent.asLiveLocationContent(): LiveLocationContent? = thi inline fun ResendableContent.requireLiveLocationContent(): LiveLocationContent = this as LiveLocationContent @PreviewFeature -inline fun ResendableContent.whenStaticLocationContent(block: (StaticLocationContent) -> T) = asStaticLocationContent() ?.let(block) +inline fun ResendableContent.whenStaticLocationContent(block: (StaticLocationContent) -> T) = + asStaticLocationContent()?.let(block) @PreviewFeature inline fun ResendableContent.asStaticLocationContent(): StaticLocationContent? = this as? StaticLocationContent @@ -2640,7 +2825,7 @@ inline fun ResendableContent.asStaticLocationContent(): StaticLocationContent? = inline fun ResendableContent.requireStaticLocationContent(): StaticLocationContent = this as StaticLocationContent @PreviewFeature -inline fun ResendableContent.whenPollContent(block: (PollContent) -> T) = asPollContent() ?.let(block) +inline fun ResendableContent.whenPollContent(block: (PollContent) -> T) = asPollContent()?.let(block) @PreviewFeature inline fun ResendableContent.asPollContent(): PollContent? = this as? PollContent @@ -2649,7 +2834,7 @@ inline fun ResendableContent.asPollContent(): PollContent? = this as? PollConten inline fun ResendableContent.requirePollContent(): PollContent = this as PollContent @PreviewFeature -inline fun ResendableContent.whenTextContent(block: (TextContent) -> T) = asTextContent() ?.let(block) +inline fun ResendableContent.whenTextContent(block: (TextContent) -> T) = asTextContent()?.let(block) @PreviewFeature inline fun ResendableContent.asTextContent(): TextContent? = this as? TextContent @@ -2658,7 +2843,7 @@ inline fun ResendableContent.asTextContent(): TextContent? = this as? TextConten inline fun ResendableContent.requireTextContent(): TextContent = this as TextContent @PreviewFeature -inline fun ResendableContent.whenVenueContent(block: (VenueContent) -> T) = asVenueContent() ?.let(block) +inline fun ResendableContent.whenVenueContent(block: (VenueContent) -> T) = asVenueContent()?.let(block) @PreviewFeature inline fun ResendableContent.asVenueContent(): VenueContent? = this as? VenueContent @@ -2667,7 +2852,8 @@ inline fun ResendableContent.asVenueContent(): VenueContent? = this as? VenueCon inline fun ResendableContent.requireVenueContent(): VenueContent = this as VenueContent @PreviewFeature -inline fun ResendableContent.whenAudioMediaGroupContent(block: (AudioMediaGroupContent) -> T) = asAudioMediaGroupContent() ?.let(block) +inline fun ResendableContent.whenAudioMediaGroupContent(block: (AudioMediaGroupContent) -> T) = + asAudioMediaGroupContent()?.let(block) @PreviewFeature inline fun ResendableContent.asAudioMediaGroupContent(): AudioMediaGroupContent? = this as? AudioMediaGroupContent @@ -2676,7 +2862,8 @@ inline fun ResendableContent.asAudioMediaGroupContent(): AudioMediaGroupContent? inline fun ResendableContent.requireAudioMediaGroupContent(): AudioMediaGroupContent = this as AudioMediaGroupContent @PreviewFeature -inline fun ResendableContent.whenDocumentMediaGroupContent(block: (DocumentMediaGroupContent) -> T) = asDocumentMediaGroupContent() ?.let(block) +inline fun ResendableContent.whenDocumentMediaGroupContent(block: (DocumentMediaGroupContent) -> T) = + asDocumentMediaGroupContent()?.let(block) @PreviewFeature inline fun ResendableContent.asDocumentMediaGroupContent(): DocumentMediaGroupContent? = @@ -2687,7 +2874,8 @@ inline fun ResendableContent.requireDocumentMediaGroupContent(): DocumentMediaGr this as DocumentMediaGroupContent @PreviewFeature -inline fun ResendableContent.whenMediaCollectionContent(block: (MediaCollectionContent) -> T) = asMediaCollectionContent() ?.let(block) +inline fun ResendableContent.whenMediaCollectionContent(block: (MediaCollectionContent) -> T) = + asMediaCollectionContent()?.let(block) @PreviewFeature inline fun ResendableContent.asMediaCollectionContent(): MediaCollectionContent? = @@ -2698,7 +2886,8 @@ inline fun ResendableContent.requireMediaCollectionContent(): MediaCollectionCon this as MediaCollectionContent @PreviewFeature -inline fun ResendableContent.whenTextedMediaContent(block: (TextedMediaContent) -> T) = asTextedMediaContent() ?.let(block) +inline fun ResendableContent.whenTextedMediaContent(block: (TextedMediaContent) -> T) = + asTextedMediaContent()?.let(block) @PreviewFeature inline fun ResendableContent.asTextedMediaContent(): TextedMediaContent? = @@ -2709,7 +2898,7 @@ inline fun ResendableContent.requireTextedMediaContent(): TextedMediaContent = this as TextedMediaContent @PreviewFeature -inline fun ResendableContent.whenMediaContent(block: (MediaContent) -> T) = asMediaContent() ?.let(block) +inline fun ResendableContent.whenMediaContent(block: (MediaContent) -> T) = asMediaContent()?.let(block) @PreviewFeature inline fun ResendableContent.asMediaContent(): MediaContent? = this as? MediaContent @@ -2718,7 +2907,8 @@ inline fun ResendableContent.asMediaContent(): MediaContent? = this as? MediaCon inline fun ResendableContent.requireMediaContent(): MediaContent = this as MediaContent @PreviewFeature -inline fun ResendableContent.whenMediaGroupContent(block: (MediaGroupContent) -> T) = asMediaGroupContent() ?.let(block) +inline fun ResendableContent.whenMediaGroupContent(block: (MediaGroupContent) -> T) = + asMediaGroupContent()?.let(block) @PreviewFeature inline fun ResendableContent.asMediaGroupContent(): MediaGroupContent? = this as? MediaGroupContent @@ -2727,7 +2917,7 @@ inline fun ResendableContent.asMediaGroupContent(): MediaGroupContent? = this as inline fun ResendableContent.requireMediaGroupContent(): MediaGroupContent = this as MediaGroupContent @PreviewFeature -inline fun ResendableContent.whenMessageContent(block: (MessageContent) -> T) = asMessageContent() ?.let(block) +inline fun ResendableContent.whenMessageContent(block: (MessageContent) -> T) = asMessageContent()?.let(block) @PreviewFeature inline fun ResendableContent.asMessageContent(): MessageContent? = this as? MessageContent @@ -2736,7 +2926,8 @@ inline fun ResendableContent.asMessageContent(): MessageContent? = this as? Mess inline fun ResendableContent.requireMessageContent(): MessageContent = this as MessageContent @PreviewFeature -inline fun ResendableContent.whenVisualMediaGroupContent(block: (VisualMediaGroupContent) -> T) = asVisualMediaGroupContent() ?.let(block) +inline fun ResendableContent.whenVisualMediaGroupContent(block: (VisualMediaGroupContent) -> T) = + asVisualMediaGroupContent()?.let(block) @PreviewFeature inline fun ResendableContent.asVisualMediaGroupContent(): VisualMediaGroupContent? = this as? VisualMediaGroupContent @@ -2745,7 +2936,7 @@ inline fun ResendableContent.asVisualMediaGroupContent(): VisualMediaGroupConten inline fun ResendableContent.requireVisualMediaGroupContent(): VisualMediaGroupContent = this as VisualMediaGroupContent @PreviewFeature -inline fun ResendableContent.whenAnimationContent(block: (AnimationContent) -> T) = asAnimationContent() ?.let(block) +inline fun ResendableContent.whenAnimationContent(block: (AnimationContent) -> T) = asAnimationContent()?.let(block) @PreviewFeature inline fun ResendableContent.asAnimationContent(): AnimationContent? = this as? AnimationContent @@ -2754,7 +2945,7 @@ inline fun ResendableContent.asAnimationContent(): AnimationContent? = this as? inline fun ResendableContent.requireAnimationContent(): AnimationContent = this as AnimationContent @PreviewFeature -inline fun ResendableContent.whenAudioContent(block: (AudioContent) -> T) = asAudioContent() ?.let(block) +inline fun ResendableContent.whenAudioContent(block: (AudioContent) -> T) = asAudioContent()?.let(block) @PreviewFeature inline fun ResendableContent.asAudioContent(): AudioContent? = this as? AudioContent @@ -2763,7 +2954,7 @@ inline fun ResendableContent.asAudioContent(): AudioContent? = this as? AudioCon inline fun ResendableContent.requireAudioContent(): AudioContent = this as AudioContent @PreviewFeature -inline fun ResendableContent.whenDocumentContent(block: (DocumentContent) -> T) = asDocumentContent() ?.let(block) +inline fun ResendableContent.whenDocumentContent(block: (DocumentContent) -> T) = asDocumentContent()?.let(block) @PreviewFeature inline fun ResendableContent.asDocumentContent(): DocumentContent? = this as? DocumentContent @@ -2772,7 +2963,7 @@ inline fun ResendableContent.asDocumentContent(): DocumentContent? = this as? Do inline fun ResendableContent.requireDocumentContent(): DocumentContent = this as DocumentContent @PreviewFeature -inline fun ResendableContent.whenPhotoContent(block: (PhotoContent) -> T) = asPhotoContent() ?.let(block) +inline fun ResendableContent.whenPhotoContent(block: (PhotoContent) -> T) = asPhotoContent()?.let(block) @PreviewFeature inline fun ResendableContent.asPhotoContent(): PhotoContent? = this as? PhotoContent @@ -2781,7 +2972,7 @@ inline fun ResendableContent.asPhotoContent(): PhotoContent? = this as? PhotoCon inline fun ResendableContent.requirePhotoContent(): PhotoContent = this as PhotoContent @PreviewFeature -inline fun ResendableContent.whenStickerContent(block: (StickerContent) -> T) = asStickerContent() ?.let(block) +inline fun ResendableContent.whenStickerContent(block: (StickerContent) -> T) = asStickerContent()?.let(block) @PreviewFeature inline fun ResendableContent.asStickerContent(): StickerContent? = this as? StickerContent @@ -2790,7 +2981,7 @@ inline fun ResendableContent.asStickerContent(): StickerContent? = this as? Stic inline fun ResendableContent.requireStickerContent(): StickerContent = this as StickerContent @PreviewFeature -inline fun ResendableContent.whenVideoContent(block: (VideoContent) -> T) = asVideoContent() ?.let(block) +inline fun ResendableContent.whenVideoContent(block: (VideoContent) -> T) = asVideoContent()?.let(block) @PreviewFeature inline fun ResendableContent.asVideoContent(): VideoContent? = this as? VideoContent @@ -2799,7 +2990,7 @@ inline fun ResendableContent.asVideoContent(): VideoContent? = this as? VideoCon inline fun ResendableContent.requireVideoContent(): VideoContent = this as VideoContent @PreviewFeature -inline fun ResendableContent.whenVideoNoteContent(block: (VideoNoteContent) -> T) = asVideoNoteContent() ?.let(block) +inline fun ResendableContent.whenVideoNoteContent(block: (VideoNoteContent) -> T) = asVideoNoteContent()?.let(block) @PreviewFeature inline fun ResendableContent.asVideoNoteContent(): VideoNoteContent? = this as? VideoNoteContent @@ -2808,7 +2999,7 @@ inline fun ResendableContent.asVideoNoteContent(): VideoNoteContent? = this as? inline fun ResendableContent.requireVideoNoteContent(): VideoNoteContent = this as VideoNoteContent @PreviewFeature -inline fun ResendableContent.whenVoiceContent(block: (VoiceContent) -> T) = asVoiceContent() ?.let(block) +inline fun ResendableContent.whenVoiceContent(block: (VoiceContent) -> T) = asVoiceContent()?.let(block) @PreviewFeature inline fun ResendableContent.asVoiceContent(): VoiceContent? = this as? VoiceContent @@ -2817,7 +3008,7 @@ inline fun ResendableContent.asVoiceContent(): VoiceContent? = this as? VoiceCon inline fun ResendableContent.requireVoiceContent(): VoiceContent = this as VoiceContent @PreviewFeature -inline fun ResendableContent.whenInvoiceContent(block: (InvoiceContent) -> T) = asInvoiceContent() ?.let(block) +inline fun ResendableContent.whenInvoiceContent(block: (InvoiceContent) -> T) = asInvoiceContent()?.let(block) @PreviewFeature inline fun ResendableContent.asInvoiceContent(): InvoiceContent? = this as? InvoiceContent @@ -2826,7 +3017,8 @@ inline fun ResendableContent.asInvoiceContent(): InvoiceContent? = this as? Invo inline fun ResendableContent.requireInvoiceContent(): InvoiceContent = this as InvoiceContent @PreviewFeature -inline fun TextSource.whenMultilevelTextSource(block: (MultilevelTextSource) -> T) = asMultilevelTextSource() ?.let(block) +inline fun TextSource.whenMultilevelTextSource(block: (MultilevelTextSource) -> T) = + asMultilevelTextSource()?.let(block) @PreviewFeature inline fun TextSource.asMultilevelTextSource(): MultilevelTextSource? = this as? MultilevelTextSource @@ -2835,7 +3027,7 @@ inline fun TextSource.asMultilevelTextSource(): MultilevelTextSource? = this as? inline fun TextSource.requireMultilevelTextSource(): MultilevelTextSource = this as MultilevelTextSource @PreviewFeature -inline fun TextSource.whenBoldTextSource(block: (BoldTextSource) -> T) = asBoldTextSource() ?.let(block) +inline fun TextSource.whenBoldTextSource(block: (BoldTextSource) -> T) = asBoldTextSource()?.let(block) @PreviewFeature inline fun TextSource.asBoldTextSource(): BoldTextSource? = this as? BoldTextSource @@ -2844,7 +3036,8 @@ inline fun TextSource.asBoldTextSource(): BoldTextSource? = this as? BoldTextSou inline fun TextSource.requireBoldTextSource(): BoldTextSource = this as BoldTextSource @PreviewFeature -inline fun TextSource.whenBotCommandTextSource(block: (BotCommandTextSource) -> T) = asBotCommandTextSource() ?.let(block) +inline fun TextSource.whenBotCommandTextSource(block: (BotCommandTextSource) -> T) = + asBotCommandTextSource()?.let(block) @PreviewFeature inline fun TextSource.asBotCommandTextSource(): BotCommandTextSource? = this as? BotCommandTextSource @@ -2853,7 +3046,7 @@ inline fun TextSource.asBotCommandTextSource(): BotCommandTextSource? = this as? inline fun TextSource.requireBotCommandTextSource(): BotCommandTextSource = this as BotCommandTextSource @PreviewFeature -inline fun TextSource.whenCashTagTextSource(block: (CashTagTextSource) -> T) = asCashTagTextSource() ?.let(block) +inline fun TextSource.whenCashTagTextSource(block: (CashTagTextSource) -> T) = asCashTagTextSource()?.let(block) @PreviewFeature inline fun TextSource.asCashTagTextSource(): CashTagTextSource? = this as? CashTagTextSource @@ -2862,7 +3055,7 @@ inline fun TextSource.asCashTagTextSource(): CashTagTextSource? = this as? CashT inline fun TextSource.requireCashTagTextSource(): CashTagTextSource = this as CashTagTextSource @PreviewFeature -inline fun TextSource.whenCodeTextSource(block: (CodeTextSource) -> T) = asCodeTextSource() ?.let(block) +inline fun TextSource.whenCodeTextSource(block: (CodeTextSource) -> T) = asCodeTextSource()?.let(block) @PreviewFeature inline fun TextSource.asCodeTextSource(): CodeTextSource? = this as? CodeTextSource @@ -2871,7 +3064,7 @@ inline fun TextSource.asCodeTextSource(): CodeTextSource? = this as? CodeTextSou inline fun TextSource.requireCodeTextSource(): CodeTextSource = this as CodeTextSource @PreviewFeature -inline fun TextSource.whenEMailTextSource(block: (EMailTextSource) -> T) = asEMailTextSource() ?.let(block) +inline fun TextSource.whenEMailTextSource(block: (EMailTextSource) -> T) = asEMailTextSource()?.let(block) @PreviewFeature inline fun TextSource.asEMailTextSource(): EMailTextSource? = this as? EMailTextSource @@ -2880,7 +3073,7 @@ inline fun TextSource.asEMailTextSource(): EMailTextSource? = this as? EMailText inline fun TextSource.requireEMailTextSource(): EMailTextSource = this as EMailTextSource @PreviewFeature -inline fun TextSource.whenHashTagTextSource(block: (HashTagTextSource) -> T) = asHashTagTextSource() ?.let(block) +inline fun TextSource.whenHashTagTextSource(block: (HashTagTextSource) -> T) = asHashTagTextSource()?.let(block) @PreviewFeature inline fun TextSource.asHashTagTextSource(): HashTagTextSource? = this as? HashTagTextSource @@ -2889,7 +3082,7 @@ inline fun TextSource.asHashTagTextSource(): HashTagTextSource? = this as? HashT inline fun TextSource.requireHashTagTextSource(): HashTagTextSource = this as HashTagTextSource @PreviewFeature -inline fun TextSource.whenItalicTextSource(block: (ItalicTextSource) -> T) = asItalicTextSource() ?.let(block) +inline fun TextSource.whenItalicTextSource(block: (ItalicTextSource) -> T) = asItalicTextSource()?.let(block) @PreviewFeature inline fun TextSource.asItalicTextSource(): ItalicTextSource? = this as? ItalicTextSource @@ -2898,7 +3091,7 @@ inline fun TextSource.asItalicTextSource(): ItalicTextSource? = this as? ItalicT inline fun TextSource.requireItalicTextSource(): ItalicTextSource = this as ItalicTextSource @PreviewFeature -inline fun TextSource.whenMentionTextSource(block: (MentionTextSource) -> T) = asMentionTextSource() ?.let(block) +inline fun TextSource.whenMentionTextSource(block: (MentionTextSource) -> T) = asMentionTextSource()?.let(block) @PreviewFeature inline fun TextSource.asMentionTextSource(): MentionTextSource? = this as? MentionTextSource @@ -2907,7 +3100,8 @@ inline fun TextSource.asMentionTextSource(): MentionTextSource? = this as? Menti inline fun TextSource.requireMentionTextSource(): MentionTextSource = this as MentionTextSource @PreviewFeature -inline fun TextSource.whenPhoneNumberTextSource(block: (PhoneNumberTextSource) -> T) = asPhoneNumberTextSource() ?.let(block) +inline fun TextSource.whenPhoneNumberTextSource(block: (PhoneNumberTextSource) -> T) = + asPhoneNumberTextSource()?.let(block) @PreviewFeature inline fun TextSource.asPhoneNumberTextSource(): PhoneNumberTextSource? = this as? PhoneNumberTextSource @@ -2916,7 +3110,7 @@ inline fun TextSource.asPhoneNumberTextSource(): PhoneNumberTextSource? = this a inline fun TextSource.requirePhoneNumberTextSource(): PhoneNumberTextSource = this as PhoneNumberTextSource @PreviewFeature -inline fun TextSource.whenPreTextSource(block: (PreTextSource) -> T) = asPreTextSource() ?.let(block) +inline fun TextSource.whenPreTextSource(block: (PreTextSource) -> T) = asPreTextSource()?.let(block) @PreviewFeature inline fun TextSource.asPreTextSource(): PreTextSource? = this as? PreTextSource @@ -2925,7 +3119,7 @@ inline fun TextSource.asPreTextSource(): PreTextSource? = this as? PreTextSource inline fun TextSource.requirePreTextSource(): PreTextSource = this as PreTextSource @PreviewFeature -inline fun TextSource.whenRegularTextSource(block: (RegularTextSource) -> T) = asRegularTextSource() ?.let(block) +inline fun TextSource.whenRegularTextSource(block: (RegularTextSource) -> T) = asRegularTextSource()?.let(block) @PreviewFeature inline fun TextSource.asRegularTextSource(): RegularTextSource? = this as? RegularTextSource @@ -2934,7 +3128,8 @@ inline fun TextSource.asRegularTextSource(): RegularTextSource? = this as? Regul inline fun TextSource.requireRegularTextSource(): RegularTextSource = this as RegularTextSource @PreviewFeature -inline fun TextSource.whenStrikethroughTextSource(block: (StrikethroughTextSource) -> T) = asStrikethroughTextSource() ?.let(block) +inline fun TextSource.whenStrikethroughTextSource(block: (StrikethroughTextSource) -> T) = + asStrikethroughTextSource()?.let(block) @PreviewFeature inline fun TextSource.asStrikethroughTextSource(): StrikethroughTextSource? = this as? StrikethroughTextSource @@ -2943,7 +3138,7 @@ inline fun TextSource.asStrikethroughTextSource(): StrikethroughTextSource? = th inline fun TextSource.requireStrikethroughTextSource(): StrikethroughTextSource = this as StrikethroughTextSource @PreviewFeature -inline fun TextSource.whenTextLinkTextSource(block: (TextLinkTextSource) -> T) = asTextLinkTextSource() ?.let(block) +inline fun TextSource.whenTextLinkTextSource(block: (TextLinkTextSource) -> T) = asTextLinkTextSource()?.let(block) @PreviewFeature inline fun TextSource.asTextLinkTextSource(): TextLinkTextSource? = this as? TextLinkTextSource @@ -2952,7 +3147,8 @@ inline fun TextSource.asTextLinkTextSource(): TextLinkTextSource? = this as? Tex inline fun TextSource.requireTextLinkTextSource(): TextLinkTextSource = this as TextLinkTextSource @PreviewFeature -inline fun TextSource.whenTextMentionTextSource(block: (TextMentionTextSource) -> T) = asTextMentionTextSource() ?.let(block) +inline fun TextSource.whenTextMentionTextSource(block: (TextMentionTextSource) -> T) = + asTextMentionTextSource()?.let(block) @PreviewFeature inline fun TextSource.asTextMentionTextSource(): TextMentionTextSource? = this as? TextMentionTextSource @@ -2961,7 +3157,7 @@ inline fun TextSource.asTextMentionTextSource(): TextMentionTextSource? = this a inline fun TextSource.requireTextMentionTextSource(): TextMentionTextSource = this as TextMentionTextSource @PreviewFeature -inline fun TextSource.whenURLTextSource(block: (URLTextSource) -> T) = asURLTextSource() ?.let(block) +inline fun TextSource.whenURLTextSource(block: (URLTextSource) -> T) = asURLTextSource()?.let(block) @PreviewFeature inline fun TextSource.asURLTextSource(): URLTextSource? = this as? URLTextSource @@ -2970,7 +3166,8 @@ inline fun TextSource.asURLTextSource(): URLTextSource? = this as? URLTextSource inline fun TextSource.requireURLTextSource(): URLTextSource = this as URLTextSource @PreviewFeature -inline fun TextSource.whenUnderlineTextSource(block: (UnderlineTextSource) -> T) = asUnderlineTextSource() ?.let(block) +inline fun TextSource.whenUnderlineTextSource(block: (UnderlineTextSource) -> T) = + asUnderlineTextSource()?.let(block) @PreviewFeature inline fun TextSource.asUnderlineTextSource(): UnderlineTextSource? = this as? UnderlineTextSource @@ -2979,7 +3176,8 @@ inline fun TextSource.asUnderlineTextSource(): UnderlineTextSource? = this as? U inline fun TextSource.requireUnderlineTextSource(): UnderlineTextSource = this as UnderlineTextSource @PreviewFeature -inline fun DiceAnimationType.whenBasketballDiceAnimationType(block: (BasketballDiceAnimationType) -> T) = asBasketballDiceAnimationType() ?.let(block) +inline fun DiceAnimationType.whenBasketballDiceAnimationType(block: (BasketballDiceAnimationType) -> T) = + asBasketballDiceAnimationType()?.let(block) @PreviewFeature inline fun DiceAnimationType.asBasketballDiceAnimationType(): BasketballDiceAnimationType? = @@ -2990,7 +3188,8 @@ inline fun DiceAnimationType.requireBasketballDiceAnimationType(): BasketballDic this as BasketballDiceAnimationType @PreviewFeature -inline fun DiceAnimationType.whenBowlingDiceAnimationType(block: (BowlingDiceAnimationType) -> T) = asBowlingDiceAnimationType() ?.let(block) +inline fun DiceAnimationType.whenBowlingDiceAnimationType(block: (BowlingDiceAnimationType) -> T) = + asBowlingDiceAnimationType()?.let(block) @PreviewFeature inline fun DiceAnimationType.asBowlingDiceAnimationType(): BowlingDiceAnimationType? = this as? BowlingDiceAnimationType @@ -3000,7 +3199,8 @@ inline fun DiceAnimationType.requireBowlingDiceAnimationType(): BowlingDiceAnima this as BowlingDiceAnimationType @PreviewFeature -inline fun DiceAnimationType.whenCubeDiceAnimationType(block: (CubeDiceAnimationType) -> T) = asCubeDiceAnimationType() ?.let(block) +inline fun DiceAnimationType.whenCubeDiceAnimationType(block: (CubeDiceAnimationType) -> T) = + asCubeDiceAnimationType()?.let(block) @PreviewFeature inline fun DiceAnimationType.asCubeDiceAnimationType(): CubeDiceAnimationType? = this as? CubeDiceAnimationType @@ -3009,7 +3209,8 @@ inline fun DiceAnimationType.asCubeDiceAnimationType(): CubeDiceAnimationType? = inline fun DiceAnimationType.requireCubeDiceAnimationType(): CubeDiceAnimationType = this as CubeDiceAnimationType @PreviewFeature -inline fun DiceAnimationType.whenCustomDiceAnimationType(block: (CustomDiceAnimationType) -> T) = asCustomDiceAnimationType() ?.let(block) +inline fun DiceAnimationType.whenCustomDiceAnimationType(block: (CustomDiceAnimationType) -> T) = + asCustomDiceAnimationType()?.let(block) @PreviewFeature inline fun DiceAnimationType.asCustomDiceAnimationType(): CustomDiceAnimationType? = this as? CustomDiceAnimationType @@ -3018,7 +3219,8 @@ inline fun DiceAnimationType.asCustomDiceAnimationType(): CustomDiceAnimationTyp inline fun DiceAnimationType.requireCustomDiceAnimationType(): CustomDiceAnimationType = this as CustomDiceAnimationType @PreviewFeature -inline fun DiceAnimationType.whenDartsDiceAnimationType(block: (DartsDiceAnimationType) -> T) = asDartsDiceAnimationType() ?.let(block) +inline fun DiceAnimationType.whenDartsDiceAnimationType(block: (DartsDiceAnimationType) -> T) = + asDartsDiceAnimationType()?.let(block) @PreviewFeature inline fun DiceAnimationType.asDartsDiceAnimationType(): DartsDiceAnimationType? = this as? DartsDiceAnimationType @@ -3027,7 +3229,8 @@ inline fun DiceAnimationType.asDartsDiceAnimationType(): DartsDiceAnimationType? inline fun DiceAnimationType.requireDartsDiceAnimationType(): DartsDiceAnimationType = this as DartsDiceAnimationType @PreviewFeature -inline fun DiceAnimationType.whenFootballDiceAnimationType(block: (FootballDiceAnimationType) -> T) = asFootballDiceAnimationType() ?.let(block) +inline fun DiceAnimationType.whenFootballDiceAnimationType(block: (FootballDiceAnimationType) -> T) = + asFootballDiceAnimationType()?.let(block) @PreviewFeature inline fun DiceAnimationType.asFootballDiceAnimationType(): FootballDiceAnimationType? = @@ -3038,7 +3241,8 @@ inline fun DiceAnimationType.requireFootballDiceAnimationType(): FootballDiceAni this as FootballDiceAnimationType @PreviewFeature -inline fun DiceAnimationType.whenSlotMachineDiceAnimationType(block: (SlotMachineDiceAnimationType) -> T) = asSlotMachineDiceAnimationType() ?.let(block) +inline fun DiceAnimationType.whenSlotMachineDiceAnimationType(block: (SlotMachineDiceAnimationType) -> T) = + asSlotMachineDiceAnimationType()?.let(block) @PreviewFeature inline fun DiceAnimationType.asSlotMachineDiceAnimationType(): SlotMachineDiceAnimationType? = @@ -3049,7 +3253,7 @@ inline fun DiceAnimationType.requireSlotMachineDiceAnimationType(): SlotMachineD this as SlotMachineDiceAnimationType @PreviewFeature -inline fun ChatEvent.whenChannelChatCreated(block: (ChannelChatCreated) -> T) = asChannelChatCreated() ?.let(block) +inline fun ChatEvent.whenChannelChatCreated(block: (ChannelChatCreated) -> T) = asChannelChatCreated()?.let(block) @PreviewFeature inline fun ChatEvent.asChannelChatCreated(): ChannelChatCreated? = this as? ChannelChatCreated @@ -3058,7 +3262,7 @@ inline fun ChatEvent.asChannelChatCreated(): ChannelChatCreated? = this as? Chan inline fun ChatEvent.requireChannelChatCreated(): ChannelChatCreated = this as ChannelChatCreated @PreviewFeature -inline fun ChatEvent.whenDeleteChatPhoto(block: (DeleteChatPhoto) -> T) = asDeleteChatPhoto() ?.let(block) +inline fun ChatEvent.whenDeleteChatPhoto(block: (DeleteChatPhoto) -> T) = asDeleteChatPhoto()?.let(block) @PreviewFeature inline fun ChatEvent.asDeleteChatPhoto(): DeleteChatPhoto? = this as? DeleteChatPhoto @@ -3067,7 +3271,7 @@ inline fun ChatEvent.asDeleteChatPhoto(): DeleteChatPhoto? = this as? DeleteChat inline fun ChatEvent.requireDeleteChatPhoto(): DeleteChatPhoto = this as DeleteChatPhoto @PreviewFeature -inline fun ChatEvent.whenGroupChatCreated(block: (GroupChatCreated) -> T) = asGroupChatCreated() ?.let(block) +inline fun ChatEvent.whenGroupChatCreated(block: (GroupChatCreated) -> T) = asGroupChatCreated()?.let(block) @PreviewFeature inline fun ChatEvent.asGroupChatCreated(): GroupChatCreated? = this as? GroupChatCreated @@ -3076,7 +3280,7 @@ inline fun ChatEvent.asGroupChatCreated(): GroupChatCreated? = this as? GroupCha inline fun ChatEvent.requireGroupChatCreated(): GroupChatCreated = this as GroupChatCreated @PreviewFeature -inline fun ChatEvent.whenLeftChatMember(block: (LeftChatMember) -> T) = asLeftChatMember() ?.let(block) +inline fun ChatEvent.whenLeftChatMember(block: (LeftChatMember) -> T) = asLeftChatMember()?.let(block) @PreviewFeature inline fun ChatEvent.asLeftChatMember(): LeftChatMember? = this as? LeftChatMember @@ -3085,7 +3289,8 @@ inline fun ChatEvent.asLeftChatMember(): LeftChatMember? = this as? LeftChatMemb inline fun ChatEvent.requireLeftChatMember(): LeftChatMember = this as LeftChatMember @PreviewFeature -inline fun ChatEvent.whenMessageAutoDeleteTimerChanged(block: (MessageAutoDeleteTimerChanged) -> T) = asMessageAutoDeleteTimerChanged() ?.let(block) +inline fun ChatEvent.whenMessageAutoDeleteTimerChanged(block: (MessageAutoDeleteTimerChanged) -> T) = + asMessageAutoDeleteTimerChanged()?.let(block) @PreviewFeature inline fun ChatEvent.asMessageAutoDeleteTimerChanged(): MessageAutoDeleteTimerChanged? = @@ -3096,7 +3301,7 @@ inline fun ChatEvent.requireMessageAutoDeleteTimerChanged(): MessageAutoDeleteTi this as MessageAutoDeleteTimerChanged @PreviewFeature -inline fun ChatEvent.whenNewChatMembers(block: (NewChatMembers) -> T) = asNewChatMembers() ?.let(block) +inline fun ChatEvent.whenNewChatMembers(block: (NewChatMembers) -> T) = asNewChatMembers()?.let(block) @PreviewFeature inline fun ChatEvent.asNewChatMembers(): NewChatMembers? = this as? NewChatMembers @@ -3105,7 +3310,7 @@ inline fun ChatEvent.asNewChatMembers(): NewChatMembers? = this as? NewChatMembe inline fun ChatEvent.requireNewChatMembers(): NewChatMembers = this as NewChatMembers @PreviewFeature -inline fun ChatEvent.whenNewChatPhoto(block: (NewChatPhoto) -> T) = asNewChatPhoto() ?.let(block) +inline fun ChatEvent.whenNewChatPhoto(block: (NewChatPhoto) -> T) = asNewChatPhoto()?.let(block) @PreviewFeature inline fun ChatEvent.asNewChatPhoto(): NewChatPhoto? = this as? NewChatPhoto @@ -3114,7 +3319,7 @@ inline fun ChatEvent.asNewChatPhoto(): NewChatPhoto? = this as? NewChatPhoto inline fun ChatEvent.requireNewChatPhoto(): NewChatPhoto = this as NewChatPhoto @PreviewFeature -inline fun ChatEvent.whenNewChatTitle(block: (NewChatTitle) -> T) = asNewChatTitle() ?.let(block) +inline fun ChatEvent.whenNewChatTitle(block: (NewChatTitle) -> T) = asNewChatTitle()?.let(block) @PreviewFeature inline fun ChatEvent.asNewChatTitle(): NewChatTitle? = this as? NewChatTitle @@ -3123,7 +3328,7 @@ inline fun ChatEvent.asNewChatTitle(): NewChatTitle? = this as? NewChatTitle inline fun ChatEvent.requireNewChatTitle(): NewChatTitle = this as NewChatTitle @PreviewFeature -inline fun ChatEvent.whenPinnedMessage(block: (PinnedMessage) -> T) = asPinnedMessage() ?.let(block) +inline fun ChatEvent.whenPinnedMessage(block: (PinnedMessage) -> T) = asPinnedMessage()?.let(block) @PreviewFeature inline fun ChatEvent.asPinnedMessage(): PinnedMessage? = this as? PinnedMessage @@ -3132,7 +3337,8 @@ inline fun ChatEvent.asPinnedMessage(): PinnedMessage? = this as? PinnedMessage inline fun ChatEvent.requirePinnedMessage(): PinnedMessage = this as PinnedMessage @PreviewFeature -inline fun ChatEvent.whenSuccessfulPaymentEvent(block: (SuccessfulPaymentEvent) -> T) = asSuccessfulPaymentEvent() ?.let(block) +inline fun ChatEvent.whenSuccessfulPaymentEvent(block: (SuccessfulPaymentEvent) -> T) = + asSuccessfulPaymentEvent()?.let(block) @PreviewFeature inline fun ChatEvent.asSuccessfulPaymentEvent(): SuccessfulPaymentEvent? = this as? SuccessfulPaymentEvent @@ -3141,7 +3347,8 @@ inline fun ChatEvent.asSuccessfulPaymentEvent(): SuccessfulPaymentEvent? = this inline fun ChatEvent.requireSuccessfulPaymentEvent(): SuccessfulPaymentEvent = this as SuccessfulPaymentEvent @PreviewFeature -inline fun ChatEvent.whenProximityAlertTriggered(block: (ProximityAlertTriggered) -> T) = asProximityAlertTriggered() ?.let(block) +inline fun ChatEvent.whenProximityAlertTriggered(block: (ProximityAlertTriggered) -> T) = + asProximityAlertTriggered()?.let(block) @PreviewFeature inline fun ChatEvent.asProximityAlertTriggered(): ProximityAlertTriggered? = this as? ProximityAlertTriggered @@ -3150,7 +3357,8 @@ inline fun ChatEvent.asProximityAlertTriggered(): ProximityAlertTriggered? = thi inline fun ChatEvent.requireProximityAlertTriggered(): ProximityAlertTriggered = this as ProximityAlertTriggered @PreviewFeature -inline fun ChatEvent.whenSupergroupChatCreated(block: (SupergroupChatCreated) -> T) = asSupergroupChatCreated() ?.let(block) +inline fun ChatEvent.whenSupergroupChatCreated(block: (SupergroupChatCreated) -> T) = + asSupergroupChatCreated()?.let(block) @PreviewFeature inline fun ChatEvent.asSupergroupChatCreated(): SupergroupChatCreated? = this as? SupergroupChatCreated @@ -3159,7 +3367,8 @@ inline fun ChatEvent.asSupergroupChatCreated(): SupergroupChatCreated? = this as inline fun ChatEvent.requireSupergroupChatCreated(): SupergroupChatCreated = this as SupergroupChatCreated @PreviewFeature -inline fun ChatEvent.whenMigratedToSupergroup(block: (MigratedToSupergroup) -> T) = asMigratedToSupergroup() ?.let(block) +inline fun ChatEvent.whenMigratedToSupergroup(block: (MigratedToSupergroup) -> T) = + asMigratedToSupergroup()?.let(block) @PreviewFeature inline fun ChatEvent.asMigratedToSupergroup(): MigratedToSupergroup? = this as? MigratedToSupergroup @@ -3168,7 +3377,7 @@ inline fun ChatEvent.asMigratedToSupergroup(): MigratedToSupergroup? = this as? inline fun ChatEvent.requireMigratedToSupergroup(): MigratedToSupergroup = this as MigratedToSupergroup @PreviewFeature -inline fun ChatEvent.whenChannelEvent(block: (ChannelEvent) -> T) = asChannelEvent() ?.let(block) +inline fun ChatEvent.whenChannelEvent(block: (ChannelEvent) -> T) = asChannelEvent()?.let(block) @PreviewFeature inline fun ChatEvent.asChannelEvent(): ChannelEvent? = this as? ChannelEvent @@ -3177,7 +3386,7 @@ inline fun ChatEvent.asChannelEvent(): ChannelEvent? = this as? ChannelEvent inline fun ChatEvent.requireChannelEvent(): ChannelEvent = this as ChannelEvent @PreviewFeature -inline fun ChatEvent.whenPublicChatEvent(block: (PublicChatEvent) -> T) = asPublicChatEvent() ?.let(block) +inline fun ChatEvent.whenPublicChatEvent(block: (PublicChatEvent) -> T) = asPublicChatEvent()?.let(block) @PreviewFeature inline fun ChatEvent.asPublicChatEvent(): PublicChatEvent? = this as? PublicChatEvent @@ -3186,7 +3395,7 @@ inline fun ChatEvent.asPublicChatEvent(): PublicChatEvent? = this as? PublicChat inline fun ChatEvent.requirePublicChatEvent(): PublicChatEvent = this as PublicChatEvent @PreviewFeature -inline fun ChatEvent.whenCommonEvent(block: (CommonEvent) -> T) = asCommonEvent() ?.let(block) +inline fun ChatEvent.whenCommonEvent(block: (CommonEvent) -> T) = asCommonEvent()?.let(block) @PreviewFeature inline fun ChatEvent.asCommonEvent(): CommonEvent? = this as? CommonEvent @@ -3195,7 +3404,7 @@ inline fun ChatEvent.asCommonEvent(): CommonEvent? = this as? CommonEvent inline fun ChatEvent.requireCommonEvent(): CommonEvent = this as CommonEvent @PreviewFeature -inline fun ChatEvent.whenGroupEvent(block: (GroupEvent) -> T) = asGroupEvent() ?.let(block) +inline fun ChatEvent.whenGroupEvent(block: (GroupEvent) -> T) = asGroupEvent()?.let(block) @PreviewFeature inline fun ChatEvent.asGroupEvent(): GroupEvent? = this as? GroupEvent @@ -3204,7 +3413,7 @@ inline fun ChatEvent.asGroupEvent(): GroupEvent? = this as? GroupEvent inline fun ChatEvent.requireGroupEvent(): GroupEvent = this as GroupEvent @PreviewFeature -inline fun ChatEvent.whenSupergroupEvent(block: (SupergroupEvent) -> T) = asSupergroupEvent() ?.let(block) +inline fun ChatEvent.whenSupergroupEvent(block: (SupergroupEvent) -> T) = asSupergroupEvent()?.let(block) @PreviewFeature inline fun ChatEvent.asSupergroupEvent(): SupergroupEvent? = this as? SupergroupEvent @@ -3213,7 +3422,7 @@ inline fun ChatEvent.asSupergroupEvent(): SupergroupEvent? = this as? Supergroup inline fun ChatEvent.requireSupergroupEvent(): SupergroupEvent = this as SupergroupEvent @PreviewFeature -inline fun ChatEvent.whenVideoChatEvent(block: (VideoChatEvent) -> T) = asVideoChatEvent() ?.let(block) +inline fun ChatEvent.whenVideoChatEvent(block: (VideoChatEvent) -> T) = asVideoChatEvent()?.let(block) @PreviewFeature inline fun ChatEvent.asVideoChatEvent(): VideoChatEvent? = this as? VideoChatEvent @@ -3222,7 +3431,7 @@ inline fun ChatEvent.asVideoChatEvent(): VideoChatEvent? = this as? VideoChatEve inline fun ChatEvent.requireVideoChatEvent(): VideoChatEvent = this as VideoChatEvent @PreviewFeature -inline fun ChatEvent.whenVideoChatEnded(block: (VideoChatEnded) -> T) = asVideoChatEnded() ?.let(block) +inline fun ChatEvent.whenVideoChatEnded(block: (VideoChatEnded) -> T) = asVideoChatEnded()?.let(block) @PreviewFeature inline fun ChatEvent.asVideoChatEnded(): VideoChatEnded? = this as? VideoChatEnded @@ -3231,7 +3440,8 @@ inline fun ChatEvent.asVideoChatEnded(): VideoChatEnded? = this as? VideoChatEnd inline fun ChatEvent.requireVideoChatEnded(): VideoChatEnded = this as VideoChatEnded @PreviewFeature -inline fun ChatEvent.whenVideoChatParticipantsInvited(block: (VideoChatParticipantsInvited) -> T) = asVideoChatParticipantsInvited() ?.let(block) +inline fun ChatEvent.whenVideoChatParticipantsInvited(block: (VideoChatParticipantsInvited) -> T) = + asVideoChatParticipantsInvited()?.let(block) @PreviewFeature inline fun ChatEvent.asVideoChatParticipantsInvited(): VideoChatParticipantsInvited? = @@ -3242,7 +3452,7 @@ inline fun ChatEvent.requireVideoChatParticipantsInvited(): VideoChatParticipant this as VideoChatParticipantsInvited @PreviewFeature -inline fun ChatEvent.whenVideoChatStarted(block: (VideoChatStarted) -> T) = asVideoChatStarted() ?.let(block) +inline fun ChatEvent.whenVideoChatStarted(block: (VideoChatStarted) -> T) = asVideoChatStarted()?.let(block) @PreviewFeature inline fun ChatEvent.asVideoChatStarted(): VideoChatStarted? = this as? VideoChatStarted @@ -3251,7 +3461,7 @@ inline fun ChatEvent.asVideoChatStarted(): VideoChatStarted? = this as? VideoCha inline fun ChatEvent.requireVideoChatStarted(): VideoChatStarted = this as VideoChatStarted @PreviewFeature -inline fun ChatEvent.whenVideoChatScheduled(block: (VideoChatScheduled) -> T) = asVideoChatScheduled() ?.let(block) +inline fun ChatEvent.whenVideoChatScheduled(block: (VideoChatScheduled) -> T) = asVideoChatScheduled()?.let(block) @PreviewFeature inline fun ChatEvent.asVideoChatScheduled(): VideoChatScheduled? = this as? VideoChatScheduled @@ -3260,7 +3470,7 @@ inline fun ChatEvent.asVideoChatScheduled(): VideoChatScheduled? = this as? Vide inline fun ChatEvent.requireVideoChatScheduled(): VideoChatScheduled = this as VideoChatScheduled @PreviewFeature -inline fun ChatEvent.whenUserLoggedIn(block: (UserLoggedIn) -> T) = asUserLoggedIn() ?.let(block) +inline fun ChatEvent.whenUserLoggedIn(block: (UserLoggedIn) -> T) = asUserLoggedIn()?.let(block) @PreviewFeature inline fun ChatEvent.asUserLoggedIn(): UserLoggedIn? = this as? UserLoggedIn @@ -3269,7 +3479,7 @@ inline fun ChatEvent.asUserLoggedIn(): UserLoggedIn? = this as? UserLoggedIn inline fun ChatEvent.requireUserLoggedIn(): UserLoggedIn = this as UserLoggedIn @PreviewFeature -inline fun CommonSendInvoiceData.whenSendInvoice(block: (SendInvoice) -> T) = asSendInvoice() ?.let(block) +inline fun CommonSendInvoiceData.whenSendInvoice(block: (SendInvoice) -> T) = asSendInvoice()?.let(block) @PreviewFeature inline fun CommonSendInvoiceData.asSendInvoice(): SendInvoice? = this as? SendInvoice @@ -3278,7 +3488,8 @@ inline fun CommonSendInvoiceData.asSendInvoice(): SendInvoice? = this as? SendIn inline fun CommonSendInvoiceData.requireSendInvoice(): SendInvoice = this as SendInvoice @PreviewFeature -inline fun CommonSendInvoiceData.whenCreateInvoiceLink(block: (CreateInvoiceLink) -> T) = asCreateInvoiceLink() ?.let(block) +inline fun CommonSendInvoiceData.whenCreateInvoiceLink(block: (CreateInvoiceLink) -> T) = + asCreateInvoiceLink()?.let(block) @PreviewFeature inline fun CommonSendInvoiceData.asCreateInvoiceLink(): CreateInvoiceLink? = this as? CreateInvoiceLink @@ -3287,7 +3498,8 @@ inline fun CommonSendInvoiceData.asCreateInvoiceLink(): CreateInvoiceLink? = thi inline fun CommonSendInvoiceData.requireCreateInvoiceLink(): CreateInvoiceLink = this as CreateInvoiceLink @PreviewFeature -inline fun CommonSendInvoiceData.whenInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T) = asInputInvoiceMessageContent() ?.let(block) +inline fun CommonSendInvoiceData.whenInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T) = + asInputInvoiceMessageContent()?.let(block) @PreviewFeature inline fun CommonSendInvoiceData.asInputInvoiceMessageContent(): InputInvoiceMessageContent? = @@ -3298,7 +3510,7 @@ inline fun CommonSendInvoiceData.requireInputInvoiceMessageContent(): InputInvoi this as InputInvoiceMessageContent @PreviewFeature -inline fun Any.whenFromUser(block: (FromUser) -> T) = asFromUser() ?.let(block) +inline fun Any.whenFromUser(block: (FromUser) -> T) = asFromUser()?.let(block) @PreviewFeature inline fun Any.asFromUser(): FromUser? = this as? FromUser @@ -3307,7 +3519,7 @@ inline fun Any.asFromUser(): FromUser? = this as? FromUser inline fun Any.requireFromUser(): FromUser = this as FromUser @PreviewFeature -inline fun Any.whenWithUser(block: (WithUser) -> T) = asWithUser() ?.let(block) +inline fun Any.whenWithUser(block: (WithUser) -> T) = asWithUser()?.let(block) @PreviewFeature inline fun Any.asWithUser(): WithUser? = this as? WithUser @@ -3316,7 +3528,8 @@ inline fun Any.asWithUser(): WithUser? = this as? WithUser inline fun Any.requireWithUser(): WithUser = this as WithUser @PreviewFeature -inline fun Any.whenWithOptionalLanguageCode(block: (WithOptionalLanguageCode) -> T) = asWithOptionalLanguageCode() ?.let(block) +inline fun Any.whenWithOptionalLanguageCode(block: (WithOptionalLanguageCode) -> T) = + asWithOptionalLanguageCode()?.let(block) @PreviewFeature inline fun Any.asWithOptionalLanguageCode(): WithOptionalLanguageCode? = this as? WithOptionalLanguageCode @@ -3325,7 +3538,7 @@ inline fun Any.asWithOptionalLanguageCode(): WithOptionalLanguageCode? = this as inline fun Any.requireWithOptionalLanguageCode(): WithOptionalLanguageCode = this as WithOptionalLanguageCode @PreviewFeature -inline fun Location.whenStaticLocation(block: (StaticLocation) -> T) = asStaticLocation() ?.let(block) +inline fun Location.whenStaticLocation(block: (StaticLocation) -> T) = asStaticLocation()?.let(block) @PreviewFeature inline fun Location.asStaticLocation(): StaticLocation? = this as? StaticLocation @@ -3334,7 +3547,7 @@ inline fun Location.asStaticLocation(): StaticLocation? = this as? StaticLocatio inline fun Location.requireStaticLocation(): StaticLocation = this as StaticLocation @PreviewFeature -inline fun Location.whenLiveLocation(block: (LiveLocation) -> T) = asLiveLocation() ?.let(block) +inline fun Location.whenLiveLocation(block: (LiveLocation) -> T) = asLiveLocation()?.let(block) @PreviewFeature inline fun Location.asLiveLocation(): LiveLocation? = this as? LiveLocation @@ -3343,7 +3556,7 @@ inline fun Location.asLiveLocation(): LiveLocation? = this as? LiveLocation inline fun Location.requireLiveLocation(): LiveLocation = this as LiveLocation @PreviewFeature -inline fun ChatInviteLink.whenPrimaryInviteLink(block: (PrimaryInviteLink) -> T) = asPrimaryInviteLink() ?.let(block) +inline fun ChatInviteLink.whenPrimaryInviteLink(block: (PrimaryInviteLink) -> T) = asPrimaryInviteLink()?.let(block) @PreviewFeature inline fun ChatInviteLink.asPrimaryInviteLink(): PrimaryInviteLink? = this as? PrimaryInviteLink @@ -3352,7 +3565,8 @@ inline fun ChatInviteLink.asPrimaryInviteLink(): PrimaryInviteLink? = this as? P inline fun ChatInviteLink.requirePrimaryInviteLink(): PrimaryInviteLink = this as PrimaryInviteLink @PreviewFeature -inline fun ChatInviteLink.whenSecondaryChatInviteLink(block: (SecondaryChatInviteLink) -> T) = asSecondaryChatInviteLink() ?.let(block) +inline fun ChatInviteLink.whenSecondaryChatInviteLink(block: (SecondaryChatInviteLink) -> T) = + asSecondaryChatInviteLink()?.let(block) @PreviewFeature inline fun ChatInviteLink.asSecondaryChatInviteLink(): SecondaryChatInviteLink? = this as? SecondaryChatInviteLink @@ -3361,25 +3575,32 @@ inline fun ChatInviteLink.asSecondaryChatInviteLink(): SecondaryChatInviteLink? inline fun ChatInviteLink.requireSecondaryChatInviteLink(): SecondaryChatInviteLink = this as SecondaryChatInviteLink @PreviewFeature -inline fun ChatInviteLink.whenChatInviteLinkWithJoinRequest(block: (ChatInviteLinkWithJoinRequest) -> T) = asChatInviteLinkWithJoinRequest() ?.let(block) +inline fun ChatInviteLink.whenChatInviteLinkWithJoinRequest(block: (ChatInviteLinkWithJoinRequest) -> T) = + asChatInviteLinkWithJoinRequest()?.let(block) @PreviewFeature -inline fun ChatInviteLink.asChatInviteLinkWithJoinRequest(): ChatInviteLinkWithJoinRequest? = this as? ChatInviteLinkWithJoinRequest +inline fun ChatInviteLink.asChatInviteLinkWithJoinRequest(): ChatInviteLinkWithJoinRequest? = + this as? ChatInviteLinkWithJoinRequest @PreviewFeature -inline fun ChatInviteLink.requireChatInviteLinkWithJoinRequest(): ChatInviteLinkWithJoinRequest = this as ChatInviteLinkWithJoinRequest +inline fun ChatInviteLink.requireChatInviteLinkWithJoinRequest(): ChatInviteLinkWithJoinRequest = + this as ChatInviteLinkWithJoinRequest @PreviewFeature -inline fun ChatInviteLink.whenChatInviteLinkWithLimitedMembers(block: (ChatInviteLinkWithLimitedMembers) -> T) = asChatInviteLinkWithLimitedMembers() ?.let(block) +inline fun ChatInviteLink.whenChatInviteLinkWithLimitedMembers(block: (ChatInviteLinkWithLimitedMembers) -> T) = + asChatInviteLinkWithLimitedMembers()?.let(block) @PreviewFeature -inline fun ChatInviteLink.asChatInviteLinkWithLimitedMembers(): ChatInviteLinkWithLimitedMembers? = this as? ChatInviteLinkWithLimitedMembers +inline fun ChatInviteLink.asChatInviteLinkWithLimitedMembers(): ChatInviteLinkWithLimitedMembers? = + this as? ChatInviteLinkWithLimitedMembers @PreviewFeature -inline fun ChatInviteLink.requireChatInviteLinkWithLimitedMembers(): ChatInviteLinkWithLimitedMembers = this as ChatInviteLinkWithLimitedMembers +inline fun ChatInviteLink.requireChatInviteLinkWithLimitedMembers(): ChatInviteLinkWithLimitedMembers = + this as ChatInviteLinkWithLimitedMembers @PreviewFeature -inline fun ChatInviteLink.whenChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T) = asChatInviteLinkUnlimited() ?.let(block) +inline fun ChatInviteLink.whenChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T) = + asChatInviteLinkUnlimited()?.let(block) @PreviewFeature inline fun ChatInviteLink.asChatInviteLinkUnlimited(): ChatInviteLinkUnlimited? = this as? ChatInviteLinkUnlimited @@ -3388,34 +3609,37 @@ inline fun ChatInviteLink.asChatInviteLinkUnlimited(): ChatInviteLinkUnlimited? inline fun ChatInviteLink.requireChatInviteLinkUnlimited(): ChatInviteLinkUnlimited = this as ChatInviteLinkUnlimited @PreviewFeature -inline fun ForwardInfo.whenAnonymousForwardInfo(block: (AnonymousForwardInfo) -> T) = asAnonymousForwardInfo() ?.let(block) +inline fun ForwardInfo.whenAnonymousForwardInfo(block: (ForwardInfo.ByAnonymous) -> T) = + asAnonymousForwardInfo()?.let(block) @PreviewFeature -inline fun ForwardInfo.asAnonymousForwardInfo(): AnonymousForwardInfo? = this as? AnonymousForwardInfo +inline fun ForwardInfo.asAnonymousForwardInfo(): ForwardInfo.ByAnonymous? = this as? ForwardInfo.ByAnonymous @PreviewFeature -inline fun ForwardInfo.requireAnonymousForwardInfo(): AnonymousForwardInfo = this as AnonymousForwardInfo +inline fun ForwardInfo.requireAnonymousForwardInfo(): ForwardInfo.ByAnonymous = this as ForwardInfo.ByAnonymous @PreviewFeature -inline fun ForwardInfo.whenUserForwardInfo(block: (UserForwardInfo) -> T) = asUserForwardInfo() ?.let(block) +inline fun ForwardInfo.whenUserForwardInfo(block: (ForwardInfo.ByUser) -> T) = asUserForwardInfo()?.let(block) @PreviewFeature -inline fun ForwardInfo.asUserForwardInfo(): UserForwardInfo? = this as? UserForwardInfo +inline fun ForwardInfo.asUserForwardInfo(): ForwardInfo.ByUser? = this as? ForwardInfo.ByUser @PreviewFeature -inline fun ForwardInfo.requireUserForwardInfo(): UserForwardInfo = this as UserForwardInfo +inline fun ForwardInfo.requireUserForwardInfo(): ForwardInfo.ByUser = this as ForwardInfo.ByUser @PreviewFeature -inline fun ForwardInfo.whenForwardFromPublicChatInfo(block: (ForwardFromPublicChatInfo) -> T) = asForwardFromPublicChatInfo() ?.let(block) +inline fun ForwardInfo.whenForwardFromPublicChatInfo(block: (ForwardInfo.PublicChat) -> T) = + asForwardFromPublicChatInfo()?.let(block) @PreviewFeature -inline fun ForwardInfo.asForwardFromPublicChatInfo(): ForwardFromPublicChatInfo? = this as? ForwardFromPublicChatInfo +inline fun ForwardInfo.asForwardFromPublicChatInfo(): ForwardInfo.PublicChat? = this as? ForwardInfo.PublicChat @PreviewFeature -inline fun ForwardInfo.requireForwardFromPublicChatInfo(): ForwardFromPublicChatInfo = this as ForwardFromPublicChatInfo +inline fun ForwardInfo.requireForwardFromPublicChatInfo(): ForwardInfo.PublicChat = this as ForwardInfo.PublicChat @PreviewFeature -inline fun ForwardInfo.whenForwardFromChannelInfo(block: (ForwardFromChannelInfo) -> T) = asForwardFromChannelInfo() ?.let(block) +inline fun ForwardInfo.whenForwardFromChannelInfo(block: (ForwardFromChannelInfo) -> T) = + asForwardFromChannelInfo()?.let(block) @PreviewFeature inline fun ForwardInfo.asForwardFromChannelInfo(): ForwardFromChannelInfo? = this as? ForwardFromChannelInfo @@ -3424,7 +3648,8 @@ inline fun ForwardInfo.asForwardFromChannelInfo(): ForwardFromChannelInfo? = thi inline fun ForwardInfo.requireForwardFromChannelInfo(): ForwardFromChannelInfo = this as ForwardFromChannelInfo @PreviewFeature -inline fun ForwardInfo.whenForwardFromSupergroupInfo(block: (ForwardFromSupergroupInfo) -> T) = asForwardFromSupergroupInfo() ?.let(block) +inline fun ForwardInfo.whenForwardFromSupergroupInfo(block: (ForwardFromSupergroupInfo) -> T) = + asForwardFromSupergroupInfo()?.let(block) @PreviewFeature inline fun ForwardInfo.asForwardFromSupergroupInfo(): ForwardFromSupergroupInfo? = this as? ForwardFromSupergroupInfo @@ -3433,7 +3658,7 @@ inline fun ForwardInfo.asForwardFromSupergroupInfo(): ForwardFromSupergroupInfo? inline fun ForwardInfo.requireForwardFromSupergroupInfo(): ForwardFromSupergroupInfo = this as ForwardFromSupergroupInfo @PreviewFeature -inline fun MessageContent.whenTextedInput(block: (TextedInput) -> T) = asTextedInput() ?.let(block) +inline fun MessageContent.whenTextedInput(block: (TextedInput) -> T) = asTextedInput()?.let(block) @PreviewFeature inline fun MessageContent.asTextedInput(): TextedInput? = this as? TextedInput @@ -3442,34 +3667,43 @@ inline fun MessageContent.asTextedInput(): TextedInput? = this as? TextedInput inline fun MessageContent.requireTextedInput(): TextedInput = this as TextedInput @PreviewFeature -inline fun ScheduledCloseInfo.whenExactScheduledCloseInfo(block: (ExactScheduledCloseInfo) -> T) = asExactScheduledCloseInfo() ?.let(block) +inline fun ScheduledCloseInfo.whenExactScheduledCloseInfo(block: (ExactScheduledCloseInfo) -> T) = + asExactScheduledCloseInfo()?.let(block) @PreviewFeature inline fun ScheduledCloseInfo.asExactScheduledCloseInfo(): ExactScheduledCloseInfo? = this as? ExactScheduledCloseInfo @PreviewFeature -inline fun ScheduledCloseInfo.requireExactScheduledCloseInfo(): ExactScheduledCloseInfo = this as ExactScheduledCloseInfo +inline fun ScheduledCloseInfo.requireExactScheduledCloseInfo(): ExactScheduledCloseInfo = + this as ExactScheduledCloseInfo @PreviewFeature -inline fun ScheduledCloseInfo.whenApproximateScheduledCloseInfo(block: (ApproximateScheduledCloseInfo) -> T) = asApproximateScheduledCloseInfo() ?.let(block) +inline fun ScheduledCloseInfo.whenApproximateScheduledCloseInfo(block: (ApproximateScheduledCloseInfo) -> T) = + asApproximateScheduledCloseInfo()?.let(block) @PreviewFeature -inline fun ScheduledCloseInfo.asApproximateScheduledCloseInfo(): ApproximateScheduledCloseInfo? = this as? ApproximateScheduledCloseInfo +inline fun ScheduledCloseInfo.asApproximateScheduledCloseInfo(): ApproximateScheduledCloseInfo? = + this as? ApproximateScheduledCloseInfo @PreviewFeature -inline fun ScheduledCloseInfo.requireApproximateScheduledCloseInfo(): ApproximateScheduledCloseInfo = this as ApproximateScheduledCloseInfo +inline fun ScheduledCloseInfo.requireApproximateScheduledCloseInfo(): ApproximateScheduledCloseInfo = + this as ApproximateScheduledCloseInfo @PreviewFeature -inline fun ChosenInlineResult.whenLocationChosenInlineResult(block: (LocationChosenInlineResult) -> T) = asLocationChosenInlineResult() ?.let(block) +inline fun ChosenInlineResult.whenLocationChosenInlineResult(block: (LocationChosenInlineResult) -> T) = + asLocationChosenInlineResult()?.let(block) @PreviewFeature -inline fun ChosenInlineResult.asLocationChosenInlineResult(): LocationChosenInlineResult? = this as? LocationChosenInlineResult +inline fun ChosenInlineResult.asLocationChosenInlineResult(): LocationChosenInlineResult? = + this as? LocationChosenInlineResult @PreviewFeature -inline fun ChosenInlineResult.requireLocationChosenInlineResult(): LocationChosenInlineResult = this as LocationChosenInlineResult +inline fun ChosenInlineResult.requireLocationChosenInlineResult(): LocationChosenInlineResult = + this as LocationChosenInlineResult @PreviewFeature -inline fun ChosenInlineResult.whenBaseChosenInlineResult(block: (BaseChosenInlineResult) -> T) = asBaseChosenInlineResult() ?.let(block) +inline fun ChosenInlineResult.whenBaseChosenInlineResult(block: (BaseChosenInlineResult) -> T) = + asBaseChosenInlineResult()?.let(block) @PreviewFeature inline fun ChosenInlineResult.asBaseChosenInlineResult(): BaseChosenInlineResult? = this as? BaseChosenInlineResult 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 2f5d0b7f28..ec0a9408f1 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 @@ -67,7 +67,7 @@ import dev.inmo.tgbotapi.types.update.media_group.* import dev.inmo.tgbotapi.utils.PreviewFeature @PreviewFeature -inline fun Chat.ifBot(block: (Bot) -> T) = botOrNull() ?.let(block) +inline fun Chat.ifBot(block: (Bot) -> T) = botOrNull()?.let(block) @PreviewFeature inline fun Chat.botOrNull(): Bot? = this as? Bot @@ -76,7 +76,7 @@ inline fun Chat.botOrNull(): Bot? = this as? Bot inline fun Chat.botOrThrow(): Bot = this as Bot @PreviewFeature -inline fun Chat.ifCommonBot(block: (CommonBot) -> T) = commonBotOrNull() ?.let(block) +inline fun Chat.ifCommonBot(block: (CommonBot) -> T) = commonBotOrNull()?.let(block) @PreviewFeature inline fun Chat.commonBotOrNull(): CommonBot? = this as? CommonBot @@ -85,7 +85,7 @@ inline fun Chat.commonBotOrNull(): CommonBot? = this as? CommonBot inline fun Chat.commonBotOrThrow(): CommonBot = this as CommonBot @PreviewFeature -inline fun Chat.ifCommonUser(block: (CommonUser) -> T) = commonUserOrNull() ?.let(block) +inline fun Chat.ifCommonUser(block: (CommonUser) -> T) = commonUserOrNull()?.let(block) @PreviewFeature inline fun Chat.commonUserOrNull(): CommonUser? = this as? CommonUser @@ -94,7 +94,7 @@ inline fun Chat.commonUserOrNull(): CommonUser? = this as? CommonUser inline fun Chat.commonUserOrThrow(): CommonUser = this as CommonUser @PreviewFeature -inline fun Chat.ifExtendedBot(block: (ExtendedBot) -> T) = extendedBotOrNull() ?.let(block) +inline fun Chat.ifExtendedBot(block: (ExtendedBot) -> T) = extendedBotOrNull()?.let(block) @PreviewFeature inline fun Chat.extendedBotOrNull(): ExtendedBot? = this as? ExtendedBot @@ -103,7 +103,7 @@ inline fun Chat.extendedBotOrNull(): ExtendedBot? = this as? ExtendedBot inline fun Chat.extendedBotOrThrow(): ExtendedBot = this as ExtendedBot @PreviewFeature -inline fun Chat.ifUser(block: (User) -> T) = userOrNull() ?.let(block) +inline fun Chat.ifUser(block: (User) -> T) = userOrNull()?.let(block) @PreviewFeature inline fun Chat.userOrNull(): User? = this as? User @@ -112,7 +112,7 @@ inline fun Chat.userOrNull(): User? = this as? User inline fun Chat.userOrThrow(): User = this as User @PreviewFeature -inline fun Chat.ifChannelChat(block: (ChannelChat) -> T) = channelChatOrNull() ?.let(block) +inline fun Chat.ifChannelChat(block: (ChannelChat) -> T) = channelChatOrNull()?.let(block) @PreviewFeature inline fun Chat.channelChatOrNull(): ChannelChat? = this as? ChannelChat @@ -121,7 +121,7 @@ inline fun Chat.channelChatOrNull(): ChannelChat? = this as? ChannelChat inline fun Chat.channelChatOrThrow(): ChannelChat = this as ChannelChat @PreviewFeature -inline fun Chat.ifGroupChat(block: (GroupChat) -> T) = groupChatOrNull() ?.let(block) +inline fun Chat.ifGroupChat(block: (GroupChat) -> T) = groupChatOrNull()?.let(block) @PreviewFeature inline fun Chat.groupChatOrNull(): GroupChat? = this as? GroupChat @@ -130,7 +130,7 @@ inline fun Chat.groupChatOrNull(): GroupChat? = this as? GroupChat inline fun Chat.groupChatOrThrow(): GroupChat = this as GroupChat @PreviewFeature -inline fun Chat.ifPrivateChat(block: (PrivateChat) -> T) = privateChatOrNull() ?.let(block) +inline fun Chat.ifPrivateChat(block: (PrivateChat) -> T) = privateChatOrNull()?.let(block) @PreviewFeature inline fun Chat.privateChatOrNull(): PrivateChat? = this as? PrivateChat @@ -139,7 +139,7 @@ inline fun Chat.privateChatOrNull(): PrivateChat? = this as? PrivateChat inline fun Chat.privateChatOrThrow(): PrivateChat = this as PrivateChat @PreviewFeature -inline fun Chat.ifPublicChat(block: (PublicChat) -> T) = publicChatOrNull() ?.let(block) +inline fun Chat.ifPublicChat(block: (PublicChat) -> T) = publicChatOrNull()?.let(block) @PreviewFeature inline fun Chat.publicChatOrNull(): PublicChat? = this as? PublicChat @@ -148,7 +148,7 @@ inline fun Chat.publicChatOrNull(): PublicChat? = this as? PublicChat inline fun Chat.publicChatOrThrow(): PublicChat = this as PublicChat @PreviewFeature -inline fun Chat.ifSuperPublicChat(block: (SuperPublicChat) -> T) = superPublicChatOrNull() ?.let(block) +inline fun Chat.ifSuperPublicChat(block: (SuperPublicChat) -> T) = superPublicChatOrNull()?.let(block) @PreviewFeature inline fun Chat.superPublicChatOrNull(): SuperPublicChat? = this as? SuperPublicChat @@ -157,7 +157,7 @@ inline fun Chat.superPublicChatOrNull(): SuperPublicChat? = this as? SuperPublic inline fun Chat.superPublicChatOrThrow(): SuperPublicChat = this as SuperPublicChat @PreviewFeature -inline fun Chat.ifSupergroupChat(block: (SupergroupChat) -> T) = supergroupChatOrNull() ?.let(block) +inline fun Chat.ifSupergroupChat(block: (SupergroupChat) -> T) = supergroupChatOrNull()?.let(block) @PreviewFeature inline fun Chat.supergroupChatOrNull(): SupergroupChat? = this as? SupergroupChat @@ -166,7 +166,7 @@ inline fun Chat.supergroupChatOrNull(): SupergroupChat? = this as? SupergroupCha inline fun Chat.supergroupChatOrThrow(): SupergroupChat = this as SupergroupChat @PreviewFeature -inline fun Chat.ifUnknownChatType(block: (UnknownChatType) -> T) = unknownChatTypeOrNull() ?.let(block) +inline fun Chat.ifUnknownChatType(block: (UnknownChatType) -> T) = unknownChatTypeOrNull()?.let(block) @PreviewFeature inline fun Chat.unknownChatTypeOrNull(): UnknownChatType? = this as? UnknownChatType @@ -175,7 +175,7 @@ inline fun Chat.unknownChatTypeOrNull(): UnknownChatType? = this as? UnknownChat inline fun Chat.unknownChatTypeOrThrow(): UnknownChatType = this as UnknownChatType @PreviewFeature -inline fun Chat.ifUsernameChat(block: (UsernameChat) -> T) = usernameChatOrNull() ?.let(block) +inline fun Chat.ifUsernameChat(block: (UsernameChat) -> T) = usernameChatOrNull()?.let(block) @PreviewFeature inline fun Chat.usernameChatOrNull(): UsernameChat? = this as? UsernameChat @@ -184,7 +184,7 @@ inline fun Chat.usernameChatOrNull(): UsernameChat? = this as? UsernameChat inline fun Chat.usernameChatOrThrow(): UsernameChat = this as UsernameChat @PreviewFeature -inline fun Chat.ifExtendedChannelChat(block: (ExtendedChannelChat) -> T) = extendedChannelChatOrNull() ?.let(block) +inline fun Chat.ifExtendedChannelChat(block: (ExtendedChannelChat) -> T) = extendedChannelChatOrNull()?.let(block) @PreviewFeature inline fun Chat.extendedChannelChatOrNull(): ExtendedChannelChat? = this as? ExtendedChannelChat @@ -193,7 +193,7 @@ inline fun Chat.extendedChannelChatOrNull(): ExtendedChannelChat? = this as? Ext inline fun Chat.extendedChannelChatOrThrow(): ExtendedChannelChat = this as ExtendedChannelChat @PreviewFeature -inline fun Chat.ifExtendedChat(block: (ExtendedChat) -> T) = extendedChatOrNull() ?.let(block) +inline fun Chat.ifExtendedChat(block: (ExtendedChat) -> T) = extendedChatOrNull()?.let(block) @PreviewFeature inline fun Chat.extendedChatOrNull(): ExtendedChat? = this as? ExtendedChat @@ -202,7 +202,7 @@ inline fun Chat.extendedChatOrNull(): ExtendedChat? = this as? ExtendedChat inline fun Chat.extendedChatOrThrow(): ExtendedChat = this as ExtendedChat @PreviewFeature -inline fun Chat.ifExtendedGroupChat(block: (ExtendedGroupChat) -> T) = extendedGroupChatOrNull() ?.let(block) +inline fun Chat.ifExtendedGroupChat(block: (ExtendedGroupChat) -> T) = extendedGroupChatOrNull()?.let(block) @PreviewFeature inline fun Chat.extendedGroupChatOrNull(): ExtendedGroupChat? = this as? ExtendedGroupChat @@ -211,7 +211,7 @@ inline fun Chat.extendedGroupChatOrNull(): ExtendedGroupChat? = this as? Extende inline fun Chat.extendedGroupChatOrThrow(): ExtendedGroupChat = this as ExtendedGroupChat @PreviewFeature -inline fun Chat.ifExtendedPrivateChat(block: (ExtendedPrivateChat) -> T) = extendedPrivateChatOrNull() ?.let(block) +inline fun Chat.ifExtendedPrivateChat(block: (ExtendedPrivateChat) -> T) = extendedPrivateChatOrNull()?.let(block) @PreviewFeature inline fun Chat.extendedPrivateChatOrNull(): ExtendedPrivateChat? = this as? ExtendedPrivateChat @@ -220,7 +220,7 @@ inline fun Chat.extendedPrivateChatOrNull(): ExtendedPrivateChat? = this as? Ext inline fun Chat.extendedPrivateChatOrThrow(): ExtendedPrivateChat = this as ExtendedPrivateChat @PreviewFeature -inline fun Chat.ifExtendedPublicChat(block: (ExtendedPublicChat) -> T) = extendedPublicChatOrNull() ?.let(block) +inline fun Chat.ifExtendedPublicChat(block: (ExtendedPublicChat) -> T) = extendedPublicChatOrNull()?.let(block) @PreviewFeature inline fun Chat.extendedPublicChatOrNull(): ExtendedPublicChat? = this as? ExtendedPublicChat @@ -229,7 +229,8 @@ inline fun Chat.extendedPublicChatOrNull(): ExtendedPublicChat? = this as? Exten inline fun Chat.extendedPublicChatOrThrow(): ExtendedPublicChat = this as ExtendedPublicChat @PreviewFeature -inline fun Chat.ifExtendedSupergroupChat(block: (ExtendedSupergroupChat) -> T) = extendedSupergroupChatOrNull() ?.let(block) +inline fun Chat.ifExtendedSupergroupChat(block: (ExtendedSupergroupChat) -> T) = + extendedSupergroupChatOrNull()?.let(block) @PreviewFeature inline fun Chat.extendedSupergroupChatOrNull(): ExtendedSupergroupChat? = this as? ExtendedSupergroupChat @@ -238,7 +239,7 @@ inline fun Chat.extendedSupergroupChatOrNull(): ExtendedSupergroupChat? = this a inline fun Chat.extendedSupergroupChatOrThrow(): ExtendedSupergroupChat = this as ExtendedSupergroupChat @PreviewFeature -inline fun Chat.ifPossiblyPremiumChat(block: (PossiblyPremiumChat) -> T) = possiblyPremiumChatOrNull() ?.let(block) +inline fun Chat.ifPossiblyPremiumChat(block: (PossiblyPremiumChat) -> T) = possiblyPremiumChatOrNull()?.let(block) @PreviewFeature inline fun Chat.possiblyPremiumChatOrNull(): PossiblyPremiumChat? = this as? PossiblyPremiumChat @@ -247,16 +248,20 @@ inline fun Chat.possiblyPremiumChatOrNull(): PossiblyPremiumChat? = this as? Pos inline fun Chat.possiblyPremiumChatOrThrow(): PossiblyPremiumChat = this as PossiblyPremiumChat @PreviewFeature -inline fun Chat.ifAbleToAddInAttachmentMenuChat(block: (AbleToAddInAttachmentMenuChat) -> T) = ableToAddInAttachmentMenuChatOrNull() ?.let(block) +inline fun Chat.ifAbleToAddInAttachmentMenuChat(block: (AbleToAddInAttachmentMenuChat) -> T) = + ableToAddInAttachmentMenuChatOrNull()?.let(block) @PreviewFeature -inline fun Chat.ableToAddInAttachmentMenuChatOrNull(): AbleToAddInAttachmentMenuChat? = this as? AbleToAddInAttachmentMenuChat +inline fun Chat.ableToAddInAttachmentMenuChatOrNull(): AbleToAddInAttachmentMenuChat? = + this as? AbleToAddInAttachmentMenuChat @PreviewFeature -inline fun Chat.ableToAddInAttachmentMenuChatOrThrow(): AbleToAddInAttachmentMenuChat = this as AbleToAddInAttachmentMenuChat +inline fun Chat.ableToAddInAttachmentMenuChatOrThrow(): AbleToAddInAttachmentMenuChat = + this as AbleToAddInAttachmentMenuChat @PreviewFeature -inline fun CallbackQuery.ifDataCallbackQuery(block: (DataCallbackQuery) -> T) = dataCallbackQueryOrNull() ?.let(block) +inline fun CallbackQuery.ifDataCallbackQuery(block: (DataCallbackQuery) -> T) = + dataCallbackQueryOrNull()?.let(block) @PreviewFeature inline fun CallbackQuery.dataCallbackQueryOrNull(): DataCallbackQuery? = this as? DataCallbackQuery @@ -265,7 +270,8 @@ inline fun CallbackQuery.dataCallbackQueryOrNull(): DataCallbackQuery? = this as inline fun CallbackQuery.dataCallbackQueryOrThrow(): DataCallbackQuery = this as DataCallbackQuery @PreviewFeature -inline fun CallbackQuery.ifGameShortNameCallbackQuery(block: (GameShortNameCallbackQuery) -> T) = gameShortNameCallbackQueryOrNull() ?.let(block) +inline fun CallbackQuery.ifGameShortNameCallbackQuery(block: (GameShortNameCallbackQuery) -> T) = + gameShortNameCallbackQueryOrNull()?.let(block) @PreviewFeature inline fun CallbackQuery.gameShortNameCallbackQueryOrNull(): GameShortNameCallbackQuery? = @@ -276,7 +282,8 @@ inline fun CallbackQuery.gameShortNameCallbackQueryOrThrow(): GameShortNameCallb this as GameShortNameCallbackQuery @PreviewFeature -inline fun CallbackQuery.ifInlineMessageIdCallbackQuery(block: (InlineMessageIdCallbackQuery) -> T) = inlineMessageIdCallbackQueryOrNull() ?.let(block) +inline fun CallbackQuery.ifInlineMessageIdCallbackQuery(block: (InlineMessageIdCallbackQuery) -> T) = + inlineMessageIdCallbackQueryOrNull()?.let(block) @PreviewFeature inline fun CallbackQuery.inlineMessageIdCallbackQueryOrNull(): InlineMessageIdCallbackQuery? = @@ -287,7 +294,8 @@ inline fun CallbackQuery.inlineMessageIdCallbackQueryOrThrow(): InlineMessageIdC this as InlineMessageIdCallbackQuery @PreviewFeature -inline fun CallbackQuery.ifInlineMessageIdDataCallbackQuery(block: (InlineMessageIdDataCallbackQuery) -> T) = inlineMessageIdDataCallbackQueryOrNull() ?.let(block) +inline fun CallbackQuery.ifInlineMessageIdDataCallbackQuery(block: (InlineMessageIdDataCallbackQuery) -> T) = + inlineMessageIdDataCallbackQueryOrNull()?.let(block) @PreviewFeature inline fun CallbackQuery.inlineMessageIdDataCallbackQueryOrNull(): InlineMessageIdDataCallbackQuery? = @@ -298,7 +306,8 @@ inline fun CallbackQuery.inlineMessageIdDataCallbackQueryOrThrow(): InlineMessag this as InlineMessageIdDataCallbackQuery @PreviewFeature -inline fun CallbackQuery.ifInlineMessageIdGameShortNameCallbackQuery(block: (InlineMessageIdGameShortNameCallbackQuery) -> T) = inlineMessageIdGameShortNameCallbackQueryOrNull() ?.let(block) +inline fun CallbackQuery.ifInlineMessageIdGameShortNameCallbackQuery(block: (InlineMessageIdGameShortNameCallbackQuery) -> T) = + inlineMessageIdGameShortNameCallbackQueryOrNull()?.let(block) @PreviewFeature inline fun CallbackQuery.inlineMessageIdGameShortNameCallbackQueryOrNull(): InlineMessageIdGameShortNameCallbackQuery? = @@ -309,7 +318,8 @@ inline fun CallbackQuery.inlineMessageIdGameShortNameCallbackQueryOrThrow(): Inl this as InlineMessageIdGameShortNameCallbackQuery @PreviewFeature -inline fun CallbackQuery.ifMessageCallbackQuery(block: (MessageCallbackQuery) -> T) = messageCallbackQueryOrNull() ?.let(block) +inline fun CallbackQuery.ifMessageCallbackQuery(block: (MessageCallbackQuery) -> T) = + messageCallbackQueryOrNull()?.let(block) @PreviewFeature inline fun CallbackQuery.messageCallbackQueryOrNull(): MessageCallbackQuery? = this as? MessageCallbackQuery @@ -318,7 +328,8 @@ inline fun CallbackQuery.messageCallbackQueryOrNull(): MessageCallbackQuery? = t inline fun CallbackQuery.messageCallbackQueryOrThrow(): MessageCallbackQuery = this as MessageCallbackQuery @PreviewFeature -inline fun CallbackQuery.ifMessageDataCallbackQuery(block: (MessageDataCallbackQuery) -> T) = messageDataCallbackQueryOrNull() ?.let(block) +inline fun CallbackQuery.ifMessageDataCallbackQuery(block: (MessageDataCallbackQuery) -> T) = + messageDataCallbackQueryOrNull()?.let(block) @PreviewFeature inline fun CallbackQuery.messageDataCallbackQueryOrNull(): MessageDataCallbackQuery? = this as? MessageDataCallbackQuery @@ -327,7 +338,8 @@ inline fun CallbackQuery.messageDataCallbackQueryOrNull(): MessageDataCallbackQu inline fun CallbackQuery.messageDataCallbackQueryOrThrow(): MessageDataCallbackQuery = this as MessageDataCallbackQuery @PreviewFeature -inline fun CallbackQuery.ifMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T) = messageGameShortNameCallbackQueryOrNull() ?.let(block) +inline fun CallbackQuery.ifMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T) = + messageGameShortNameCallbackQueryOrNull()?.let(block) @PreviewFeature inline fun CallbackQuery.messageGameShortNameCallbackQueryOrNull(): MessageGameShortNameCallbackQuery? = @@ -338,7 +350,8 @@ inline fun CallbackQuery.messageGameShortNameCallbackQueryOrThrow(): MessageGame this as MessageGameShortNameCallbackQuery @PreviewFeature -inline fun CallbackQuery.ifUnknownCallbackQueryType(block: (UnknownCallbackQueryType) -> T) = unknownCallbackQueryTypeOrNull() ?.let(block) +inline fun CallbackQuery.ifUnknownCallbackQueryType(block: (UnknownCallbackQueryType) -> T) = + unknownCallbackQueryTypeOrNull()?.let(block) @PreviewFeature inline fun CallbackQuery.unknownCallbackQueryTypeOrNull(): UnknownCallbackQueryType? = this as? UnknownCallbackQueryType @@ -347,7 +360,8 @@ inline fun CallbackQuery.unknownCallbackQueryTypeOrNull(): UnknownCallbackQueryT inline fun CallbackQuery.unknownCallbackQueryTypeOrThrow(): UnknownCallbackQueryType = this as UnknownCallbackQueryType @PreviewFeature -inline fun PassportElementError.ifPassportElementErrorDataField(block: (PassportElementErrorDataField) -> T) = passportElementErrorDataFieldOrNull() ?.let(block) +inline fun PassportElementError.ifPassportElementErrorDataField(block: (PassportElementErrorDataField) -> T) = + passportElementErrorDataFieldOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.passportElementErrorDataFieldOrNull(): PassportElementErrorDataField? = @@ -358,7 +372,8 @@ inline fun PassportElementError.passportElementErrorDataFieldOrThrow(): Passport this as PassportElementErrorDataField @PreviewFeature -inline fun PassportElementError.ifPassportElementErrorFile(block: (PassportElementErrorFile) -> T) = passportElementErrorFileOrNull() ?.let(block) +inline fun PassportElementError.ifPassportElementErrorFile(block: (PassportElementErrorFile) -> T) = + passportElementErrorFileOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.passportElementErrorFileOrNull(): PassportElementErrorFile? = @@ -369,7 +384,8 @@ inline fun PassportElementError.passportElementErrorFileOrThrow(): PassportEleme this as PassportElementErrorFile @PreviewFeature -inline fun PassportElementError.ifPassportElementErrorFiles(block: (PassportElementErrorFiles) -> T) = passportElementErrorFilesOrNull() ?.let(block) +inline fun PassportElementError.ifPassportElementErrorFiles(block: (PassportElementErrorFiles) -> T) = + passportElementErrorFilesOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.passportElementErrorFilesOrNull(): PassportElementErrorFiles? = @@ -380,7 +396,8 @@ inline fun PassportElementError.passportElementErrorFilesOrThrow(): PassportElem this as PassportElementErrorFiles @PreviewFeature -inline fun PassportElementError.ifPassportElementErrorFrontSide(block: (PassportElementErrorFrontSide) -> T) = passportElementErrorFrontSideOrNull() ?.let(block) +inline fun PassportElementError.ifPassportElementErrorFrontSide(block: (PassportElementErrorFrontSide) -> T) = + passportElementErrorFrontSideOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.passportElementErrorFrontSideOrNull(): PassportElementErrorFrontSide? = @@ -391,7 +408,8 @@ inline fun PassportElementError.passportElementErrorFrontSideOrThrow(): Passport this as PassportElementErrorFrontSide @PreviewFeature -inline fun PassportElementError.ifPassportElementErrorReverseSide(block: (PassportElementErrorReverseSide) -> T) = passportElementErrorReverseSideOrNull() ?.let(block) +inline fun PassportElementError.ifPassportElementErrorReverseSide(block: (PassportElementErrorReverseSide) -> T) = + passportElementErrorReverseSideOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.passportElementErrorReverseSideOrNull(): PassportElementErrorReverseSide? = @@ -402,7 +420,8 @@ inline fun PassportElementError.passportElementErrorReverseSideOrThrow(): Passpo this as PassportElementErrorReverseSide @PreviewFeature -inline fun PassportElementError.ifPassportElementErrorSelfie(block: (PassportElementErrorSelfie) -> T) = passportElementErrorSelfieOrNull() ?.let(block) +inline fun PassportElementError.ifPassportElementErrorSelfie(block: (PassportElementErrorSelfie) -> T) = + passportElementErrorSelfieOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.passportElementErrorSelfieOrNull(): PassportElementErrorSelfie? = @@ -413,7 +432,8 @@ inline fun PassportElementError.passportElementErrorSelfieOrThrow(): PassportEle this as PassportElementErrorSelfie @PreviewFeature -inline fun PassportElementError.ifPassportElementErrorTranslationFile(block: (PassportElementErrorTranslationFile) -> T) = passportElementErrorTranslationFileOrNull() ?.let(block) +inline fun PassportElementError.ifPassportElementErrorTranslationFile(block: (PassportElementErrorTranslationFile) -> T) = + passportElementErrorTranslationFileOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.passportElementErrorTranslationFileOrNull(): PassportElementErrorTranslationFile? = @@ -424,7 +444,8 @@ inline fun PassportElementError.passportElementErrorTranslationFileOrThrow(): Pa this as PassportElementErrorTranslationFile @PreviewFeature -inline fun PassportElementError.ifPassportElementErrorTranslationFiles(block: (PassportElementErrorTranslationFiles) -> T) = passportElementErrorTranslationFilesOrNull() ?.let(block) +inline fun PassportElementError.ifPassportElementErrorTranslationFiles(block: (PassportElementErrorTranslationFiles) -> T) = + passportElementErrorTranslationFilesOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.passportElementErrorTranslationFilesOrNull(): PassportElementErrorTranslationFiles? = @@ -435,7 +456,8 @@ inline fun PassportElementError.passportElementErrorTranslationFilesOrThrow(): P this as PassportElementErrorTranslationFiles @PreviewFeature -inline fun PassportElementError.ifPassportElementErrorUnspecified(block: (PassportElementErrorUnspecified) -> T) = passportElementErrorUnspecifiedOrNull() ?.let(block) +inline fun PassportElementError.ifPassportElementErrorUnspecified(block: (PassportElementErrorUnspecified) -> T) = + passportElementErrorUnspecifiedOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.passportElementErrorUnspecifiedOrNull(): PassportElementErrorUnspecified? = @@ -446,7 +468,8 @@ inline fun PassportElementError.passportElementErrorUnspecifiedOrThrow(): Passpo this as PassportElementErrorUnspecified @PreviewFeature -inline fun PassportElementError.ifPassportElementFileError(block: (PassportElementFileError) -> T) = passportElementFileErrorOrNull() ?.let(block) +inline fun PassportElementError.ifPassportElementFileError(block: (PassportElementFileError) -> T) = + passportElementFileErrorOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.passportElementFileErrorOrNull(): PassportElementFileError? = @@ -457,7 +480,8 @@ inline fun PassportElementError.passportElementFileErrorOrThrow(): PassportEleme this as PassportElementFileError @PreviewFeature -inline fun PassportElementError.ifPassportElementFilesError(block: (PassportElementFilesError) -> T) = passportElementFilesErrorOrNull() ?.let(block) +inline fun PassportElementError.ifPassportElementFilesError(block: (PassportElementFilesError) -> T) = + passportElementFilesErrorOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.passportElementFilesErrorOrNull(): PassportElementFilesError? = @@ -468,7 +492,8 @@ inline fun PassportElementError.passportElementFilesErrorOrThrow(): PassportElem this as PassportElementFilesError @PreviewFeature -inline fun PassportElementError.ifPassportMultipleElementsError(block: (PassportMultipleElementsError) -> T) = passportMultipleElementsErrorOrNull() ?.let(block) +inline fun PassportElementError.ifPassportMultipleElementsError(block: (PassportMultipleElementsError) -> T) = + passportMultipleElementsErrorOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.passportMultipleElementsErrorOrNull(): PassportMultipleElementsError? = @@ -479,7 +504,8 @@ inline fun PassportElementError.passportMultipleElementsErrorOrThrow(): Passport this as PassportMultipleElementsError @PreviewFeature -inline fun PassportElementError.ifPassportSingleElementError(block: (PassportSingleElementError) -> T) = passportSingleElementErrorOrNull() ?.let(block) +inline fun PassportElementError.ifPassportSingleElementError(block: (PassportSingleElementError) -> T) = + passportSingleElementErrorOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.passportSingleElementErrorOrNull(): PassportSingleElementError? = @@ -490,7 +516,8 @@ inline fun PassportElementError.passportSingleElementErrorOrThrow(): PassportSin this as PassportSingleElementError @PreviewFeature -inline fun PassportElementError.ifUnknownPassportElementError(block: (UnknownPassportElementError) -> T) = unknownPassportElementErrorOrNull() ?.let(block) +inline fun PassportElementError.ifUnknownPassportElementError(block: (UnknownPassportElementError) -> T) = + unknownPassportElementErrorOrNull()?.let(block) @PreviewFeature inline fun PassportElementError.unknownPassportElementErrorOrNull(): UnknownPassportElementError? = @@ -501,7 +528,7 @@ inline fun PassportElementError.unknownPassportElementErrorOrThrow(): UnknownPas this as UnknownPassportElementError @PreviewFeature -inline fun EncryptedPassportElement.ifBankStatement(block: (BankStatement) -> T) = bankStatementOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifBankStatement(block: (BankStatement) -> T) = bankStatementOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.bankStatementOrNull(): BankStatement? = this as? BankStatement @@ -510,7 +537,8 @@ inline fun EncryptedPassportElement.bankStatementOrNull(): BankStatement? = this inline fun EncryptedPassportElement.bankStatementOrThrow(): BankStatement = this as BankStatement @PreviewFeature -inline fun EncryptedPassportElement.ifCommonPassport(block: (CommonPassport) -> T) = commonPassportOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifCommonPassport(block: (CommonPassport) -> T) = + commonPassportOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.commonPassportOrNull(): CommonPassport? = this as? CommonPassport @@ -519,7 +547,7 @@ inline fun EncryptedPassportElement.commonPassportOrNull(): CommonPassport? = th inline fun EncryptedPassportElement.commonPassportOrThrow(): CommonPassport = this as CommonPassport @PreviewFeature -inline fun EncryptedPassportElement.ifDriverLicense(block: (DriverLicense) -> T) = driverLicenseOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifDriverLicense(block: (DriverLicense) -> T) = driverLicenseOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.driverLicenseOrNull(): DriverLicense? = this as? DriverLicense @@ -528,7 +556,7 @@ inline fun EncryptedPassportElement.driverLicenseOrNull(): DriverLicense? = this inline fun EncryptedPassportElement.driverLicenseOrThrow(): DriverLicense = this as DriverLicense @PreviewFeature -inline fun EncryptedPassportElement.ifEmail(block: (Email) -> T) = emailOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifEmail(block: (Email) -> T) = emailOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.emailOrNull(): Email? = this as? Email @@ -537,7 +565,8 @@ inline fun EncryptedPassportElement.emailOrNull(): Email? = this as? Email inline fun EncryptedPassportElement.emailOrThrow(): Email = this as Email @PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedAddress(block: (EncryptedAddress) -> T) = encryptedAddressOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifEncryptedAddress(block: (EncryptedAddress) -> T) = + encryptedAddressOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.encryptedAddressOrNull(): EncryptedAddress? = this as? EncryptedAddress @@ -546,7 +575,8 @@ inline fun EncryptedPassportElement.encryptedAddressOrNull(): EncryptedAddress? inline fun EncryptedPassportElement.encryptedAddressOrThrow(): EncryptedAddress = this as EncryptedAddress @PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPersonalDetails(block: (EncryptedPersonalDetails) -> T) = encryptedPersonalDetailsOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifEncryptedPersonalDetails(block: (EncryptedPersonalDetails) -> T) = + encryptedPersonalDetailsOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.encryptedPersonalDetailsOrNull(): EncryptedPersonalDetails? = @@ -557,7 +587,7 @@ inline fun EncryptedPassportElement.encryptedPersonalDetailsOrThrow(): Encrypted this as EncryptedPersonalDetails @PreviewFeature -inline fun EncryptedPassportElement.ifIdentityCard(block: (IdentityCard) -> T) = identityCardOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifIdentityCard(block: (IdentityCard) -> T) = identityCardOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.identityCardOrNull(): IdentityCard? = this as? IdentityCard @@ -566,7 +596,8 @@ inline fun EncryptedPassportElement.identityCardOrNull(): IdentityCard? = this a inline fun EncryptedPassportElement.identityCardOrThrow(): IdentityCard = this as IdentityCard @PreviewFeature -inline fun EncryptedPassportElement.ifInternalPassport(block: (InternalPassport) -> T) = internalPassportOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifInternalPassport(block: (InternalPassport) -> T) = + internalPassportOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.internalPassportOrNull(): InternalPassport? = this as? InternalPassport @@ -575,7 +606,7 @@ inline fun EncryptedPassportElement.internalPassportOrNull(): InternalPassport? inline fun EncryptedPassportElement.internalPassportOrThrow(): InternalPassport = this as InternalPassport @PreviewFeature -inline fun EncryptedPassportElement.ifPassport(block: (Passport) -> T) = passportOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifPassport(block: (Passport) -> T) = passportOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.passportOrNull(): Passport? = this as? Passport @@ -584,7 +615,8 @@ inline fun EncryptedPassportElement.passportOrNull(): Passport? = this as? Passp inline fun EncryptedPassportElement.passportOrThrow(): Passport = this as Passport @PreviewFeature -inline fun EncryptedPassportElement.ifPassportRegistration(block: (PassportRegistration) -> T) = passportRegistrationOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifPassportRegistration(block: (PassportRegistration) -> T) = + passportRegistrationOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.passportRegistrationOrNull(): PassportRegistration? = this as? PassportRegistration @@ -593,7 +625,7 @@ inline fun EncryptedPassportElement.passportRegistrationOrNull(): PassportRegist inline fun EncryptedPassportElement.passportRegistrationOrThrow(): PassportRegistration = this as PassportRegistration @PreviewFeature -inline fun EncryptedPassportElement.ifPhoneNumber(block: (PhoneNumber) -> T) = phoneNumberOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifPhoneNumber(block: (PhoneNumber) -> T) = phoneNumberOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.phoneNumberOrNull(): PhoneNumber? = this as? PhoneNumber @@ -602,7 +634,8 @@ inline fun EncryptedPassportElement.phoneNumberOrNull(): PhoneNumber? = this as? inline fun EncryptedPassportElement.phoneNumberOrThrow(): PhoneNumber = this as PhoneNumber @PreviewFeature -inline fun EncryptedPassportElement.ifRentalAgreement(block: (RentalAgreement) -> T) = rentalAgreementOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifRentalAgreement(block: (RentalAgreement) -> T) = + rentalAgreementOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.rentalAgreementOrNull(): RentalAgreement? = this as? RentalAgreement @@ -611,17 +644,20 @@ inline fun EncryptedPassportElement.rentalAgreementOrNull(): RentalAgreement? = inline fun EncryptedPassportElement.rentalAgreementOrThrow(): RentalAgreement = this as RentalAgreement @PreviewFeature -inline fun EncryptedPassportElement.ifTemporaryRegistration(block: (TemporaryRegistration) -> T) = temporaryRegistrationOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifTemporaryRegistration(block: (TemporaryRegistration) -> T) = + temporaryRegistrationOrNull()?.let(block) @PreviewFeature -inline fun EncryptedPassportElement.temporaryRegistrationOrNull(): TemporaryRegistration? = this as? TemporaryRegistration +inline fun EncryptedPassportElement.temporaryRegistrationOrNull(): TemporaryRegistration? = + this as? TemporaryRegistration @PreviewFeature inline fun EncryptedPassportElement.temporaryRegistrationOrThrow(): TemporaryRegistration = this as TemporaryRegistration @PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithTranslatableFilesCollection(block: (EncryptedPassportElementWithTranslatableFilesCollection) -> T) = encryptedPassportElementWithTranslatableFilesCollectionOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifEncryptedPassportElementWithTranslatableFilesCollection(block: (EncryptedPassportElementWithTranslatableFilesCollection) -> T) = + encryptedPassportElementWithTranslatableFilesCollectionOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.encryptedPassportElementWithTranslatableFilesCollectionOrNull(): EncryptedPassportElementWithTranslatableFilesCollection? = @@ -632,7 +668,8 @@ inline fun EncryptedPassportElement.encryptedPassportElementWithTranslatableFile this as EncryptedPassportElementWithTranslatableFilesCollection @PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithTranslatableIDDocument(block: (EncryptedPassportElementWithTranslatableIDDocument) -> T) = encryptedPassportElementWithTranslatableIDDocumentOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifEncryptedPassportElementWithTranslatableIDDocument(block: (EncryptedPassportElementWithTranslatableIDDocument) -> T) = + encryptedPassportElementWithTranslatableIDDocumentOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.encryptedPassportElementWithTranslatableIDDocumentOrNull(): EncryptedPassportElementWithTranslatableIDDocument? = @@ -643,7 +680,7 @@ inline fun EncryptedPassportElement.encryptedPassportElementWithTranslatableIDDo this as EncryptedPassportElementWithTranslatableIDDocument @PreviewFeature -inline fun EncryptedPassportElement.ifUtilityBill(block: (UtilityBill) -> T) = utilityBillOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifUtilityBill(block: (UtilityBill) -> T) = utilityBillOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.utilityBillOrNull(): UtilityBill? = this as? UtilityBill @@ -652,7 +689,8 @@ inline fun EncryptedPassportElement.utilityBillOrNull(): UtilityBill? = this as? inline fun EncryptedPassportElement.utilityBillOrThrow(): UtilityBill = this as UtilityBill @PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithFilesCollection(block: (EncryptedPassportElementWithFilesCollection) -> T) = encryptedPassportElementWithFilesCollectionOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifEncryptedPassportElementWithFilesCollection(block: (EncryptedPassportElementWithFilesCollection) -> T) = + encryptedPassportElementWithFilesCollectionOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.encryptedPassportElementWithFilesCollectionOrNull(): EncryptedPassportElementWithFilesCollection? = @@ -663,7 +701,8 @@ inline fun EncryptedPassportElement.encryptedPassportElementWithFilesCollectionO this as EncryptedPassportElementWithFilesCollection @PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementTranslatable(block: (EncryptedPassportElementTranslatable) -> T) = encryptedPassportElementTranslatableOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifEncryptedPassportElementTranslatable(block: (EncryptedPassportElementTranslatable) -> T) = + encryptedPassportElementTranslatableOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.encryptedPassportElementTranslatableOrNull(): EncryptedPassportElementTranslatable? = @@ -674,7 +713,8 @@ inline fun EncryptedPassportElement.encryptedPassportElementTranslatableOrThrow( this as EncryptedPassportElementTranslatable @PreviewFeature -inline fun EncryptedPassportElement.ifUnknownEncryptedPassportElement(block: (UnknownEncryptedPassportElement) -> T) = unknownEncryptedPassportElementOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifUnknownEncryptedPassportElement(block: (UnknownEncryptedPassportElement) -> T) = + unknownEncryptedPassportElementOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.unknownEncryptedPassportElementOrNull(): UnknownEncryptedPassportElement? = @@ -685,7 +725,8 @@ inline fun EncryptedPassportElement.unknownEncryptedPassportElementOrThrow(): Un this as UnknownEncryptedPassportElement @PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithData(block: (EncryptedPassportElementWithData) -> T) = encryptedPassportElementWithDataOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifEncryptedPassportElementWithData(block: (EncryptedPassportElementWithData) -> T) = + encryptedPassportElementWithDataOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.encryptedPassportElementWithDataOrNull(): EncryptedPassportElementWithData? = @@ -696,7 +737,8 @@ inline fun EncryptedPassportElement.encryptedPassportElementWithDataOrThrow(): E this as EncryptedPassportElementWithData @PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithEmail(block: (EncryptedPassportElementWithEmail) -> T) = encryptedPassportElementWithEmailOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifEncryptedPassportElementWithEmail(block: (EncryptedPassportElementWithEmail) -> T) = + encryptedPassportElementWithEmailOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.encryptedPassportElementWithEmailOrNull(): EncryptedPassportElementWithEmail? = @@ -707,7 +749,8 @@ inline fun EncryptedPassportElement.encryptedPassportElementWithEmailOrThrow(): this as EncryptedPassportElementWithEmail @PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithFrontSide(block: (EncryptedPassportElementWithFrontSide) -> T) = encryptedPassportElementWithFrontSideOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifEncryptedPassportElementWithFrontSide(block: (EncryptedPassportElementWithFrontSide) -> T) = + encryptedPassportElementWithFrontSideOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.encryptedPassportElementWithFrontSideOrNull(): EncryptedPassportElementWithFrontSide? = @@ -718,7 +761,8 @@ inline fun EncryptedPassportElement.encryptedPassportElementWithFrontSideOrThrow this as EncryptedPassportElementWithFrontSide @PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithPhoneNumber(block: (EncryptedPassportElementWithPhoneNumber) -> T) = encryptedPassportElementWithPhoneNumberOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifEncryptedPassportElementWithPhoneNumber(block: (EncryptedPassportElementWithPhoneNumber) -> T) = + encryptedPassportElementWithPhoneNumberOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.encryptedPassportElementWithPhoneNumberOrNull(): EncryptedPassportElementWithPhoneNumber? = @@ -729,7 +773,8 @@ inline fun EncryptedPassportElement.encryptedPassportElementWithPhoneNumberOrThr this as EncryptedPassportElementWithPhoneNumber @PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithReverseSide(block: (EncryptedPassportElementWithReverseSide) -> T) = encryptedPassportElementWithReverseSideOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifEncryptedPassportElementWithReverseSide(block: (EncryptedPassportElementWithReverseSide) -> T) = + encryptedPassportElementWithReverseSideOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.encryptedPassportElementWithReverseSideOrNull(): EncryptedPassportElementWithReverseSide? = @@ -740,7 +785,8 @@ inline fun EncryptedPassportElement.encryptedPassportElementWithReverseSideOrThr this as EncryptedPassportElementWithReverseSide @PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithSelfie(block: (EncryptedPassportElementWithSelfie) -> T) = encryptedPassportElementWithSelfieOrNull() ?.let(block) +inline fun EncryptedPassportElement.ifEncryptedPassportElementWithSelfie(block: (EncryptedPassportElementWithSelfie) -> T) = + encryptedPassportElementWithSelfieOrNull()?.let(block) @PreviewFeature inline fun EncryptedPassportElement.encryptedPassportElementWithSelfieOrNull(): EncryptedPassportElementWithSelfie? = @@ -751,7 +797,8 @@ inline fun EncryptedPassportElement.encryptedPassportElementWithSelfieOrThrow(): this as EncryptedPassportElementWithSelfie @PreviewFeature -inline fun SecureValue.ifAddressSecureValue(block: (AddressSecureValue) -> T) = addressSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifAddressSecureValue(block: (AddressSecureValue) -> T) = + addressSecureValueOrNull()?.let(block) @PreviewFeature inline fun SecureValue.addressSecureValueOrNull(): AddressSecureValue? = this as? AddressSecureValue @@ -760,7 +807,8 @@ inline fun SecureValue.addressSecureValueOrNull(): AddressSecureValue? = this as inline fun SecureValue.addressSecureValueOrThrow(): AddressSecureValue = this as AddressSecureValue @PreviewFeature -inline fun SecureValue.ifBankStatementSecureValue(block: (BankStatementSecureValue) -> T) = bankStatementSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifBankStatementSecureValue(block: (BankStatementSecureValue) -> T) = + bankStatementSecureValueOrNull()?.let(block) @PreviewFeature inline fun SecureValue.bankStatementSecureValueOrNull(): BankStatementSecureValue? = this as? BankStatementSecureValue @@ -769,16 +817,19 @@ inline fun SecureValue.bankStatementSecureValueOrNull(): BankStatementSecureValu inline fun SecureValue.bankStatementSecureValueOrThrow(): BankStatementSecureValue = this as BankStatementSecureValue @PreviewFeature -inline fun SecureValue.ifCommonPassportSecureValue(block: (CommonPassportSecureValue) -> T) = commonPassportSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifCommonPassportSecureValue(block: (CommonPassportSecureValue) -> T) = + commonPassportSecureValueOrNull()?.let(block) @PreviewFeature -inline fun SecureValue.commonPassportSecureValueOrNull(): CommonPassportSecureValue? = this as? CommonPassportSecureValue +inline fun SecureValue.commonPassportSecureValueOrNull(): CommonPassportSecureValue? = + this as? CommonPassportSecureValue @PreviewFeature inline fun SecureValue.commonPassportSecureValueOrThrow(): CommonPassportSecureValue = this as CommonPassportSecureValue @PreviewFeature -inline fun SecureValue.ifDriverLicenseSecureValue(block: (DriverLicenseSecureValue) -> T) = driverLicenseSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifDriverLicenseSecureValue(block: (DriverLicenseSecureValue) -> T) = + driverLicenseSecureValueOrNull()?.let(block) @PreviewFeature inline fun SecureValue.driverLicenseSecureValueOrNull(): DriverLicenseSecureValue? = this as? DriverLicenseSecureValue @@ -787,7 +838,8 @@ inline fun SecureValue.driverLicenseSecureValueOrNull(): DriverLicenseSecureValu inline fun SecureValue.driverLicenseSecureValueOrThrow(): DriverLicenseSecureValue = this as DriverLicenseSecureValue @PreviewFeature -inline fun SecureValue.ifIdentityCardSecureValue(block: (IdentityCardSecureValue) -> T) = identityCardSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifIdentityCardSecureValue(block: (IdentityCardSecureValue) -> T) = + identityCardSecureValueOrNull()?.let(block) @PreviewFeature inline fun SecureValue.identityCardSecureValueOrNull(): IdentityCardSecureValue? = this as? IdentityCardSecureValue @@ -796,7 +848,8 @@ inline fun SecureValue.identityCardSecureValueOrNull(): IdentityCardSecureValue? inline fun SecureValue.identityCardSecureValueOrThrow(): IdentityCardSecureValue = this as IdentityCardSecureValue @PreviewFeature -inline fun SecureValue.ifIdentityWithReverseSideSecureValue(block: (IdentityWithReverseSideSecureValue) -> T) = identityWithReverseSideSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifIdentityWithReverseSideSecureValue(block: (IdentityWithReverseSideSecureValue) -> T) = + identityWithReverseSideSecureValueOrNull()?.let(block) @PreviewFeature inline fun SecureValue.identityWithReverseSideSecureValueOrNull(): IdentityWithReverseSideSecureValue? = @@ -807,7 +860,8 @@ inline fun SecureValue.identityWithReverseSideSecureValueOrThrow(): IdentityWith this as IdentityWithReverseSideSecureValue @PreviewFeature -inline fun SecureValue.ifInternalPassportSecureValue(block: (InternalPassportSecureValue) -> T) = internalPassportSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifInternalPassportSecureValue(block: (InternalPassportSecureValue) -> T) = + internalPassportSecureValueOrNull()?.let(block) @PreviewFeature inline fun SecureValue.internalPassportSecureValueOrNull(): InternalPassportSecureValue? = @@ -818,16 +872,19 @@ inline fun SecureValue.internalPassportSecureValueOrThrow(): InternalPassportSec this as InternalPassportSecureValue @PreviewFeature -inline fun SecureValue.ifOtherDocumentsSecureValue(block: (OtherDocumentsSecureValue) -> T) = otherDocumentsSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifOtherDocumentsSecureValue(block: (OtherDocumentsSecureValue) -> T) = + otherDocumentsSecureValueOrNull()?.let(block) @PreviewFeature -inline fun SecureValue.otherDocumentsSecureValueOrNull(): OtherDocumentsSecureValue? = this as? OtherDocumentsSecureValue +inline fun SecureValue.otherDocumentsSecureValueOrNull(): OtherDocumentsSecureValue? = + this as? OtherDocumentsSecureValue @PreviewFeature inline fun SecureValue.otherDocumentsSecureValueOrThrow(): OtherDocumentsSecureValue = this as OtherDocumentsSecureValue @PreviewFeature -inline fun SecureValue.ifPassportRegistrationSecureValue(block: (PassportRegistrationSecureValue) -> T) = passportRegistrationSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifPassportRegistrationSecureValue(block: (PassportRegistrationSecureValue) -> T) = + passportRegistrationSecureValueOrNull()?.let(block) @PreviewFeature inline fun SecureValue.passportRegistrationSecureValueOrNull(): PassportRegistrationSecureValue? = @@ -838,7 +895,8 @@ inline fun SecureValue.passportRegistrationSecureValueOrThrow(): PassportRegistr this as PassportRegistrationSecureValue @PreviewFeature -inline fun SecureValue.ifPassportSecureValue(block: (PassportSecureValue) -> T) = passportSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifPassportSecureValue(block: (PassportSecureValue) -> T) = + passportSecureValueOrNull()?.let(block) @PreviewFeature inline fun SecureValue.passportSecureValueOrNull(): PassportSecureValue? = this as? PassportSecureValue @@ -847,27 +905,32 @@ inline fun SecureValue.passportSecureValueOrNull(): PassportSecureValue? = this inline fun SecureValue.passportSecureValueOrThrow(): PassportSecureValue = this as PassportSecureValue @PreviewFeature -inline fun SecureValue.ifPersonalDetailsSecureValue(block: (PersonalDetailsSecureValue) -> T) = personalDetailsSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifPersonalDetailsSecureValue(block: (PersonalDetailsSecureValue) -> T) = + personalDetailsSecureValueOrNull()?.let(block) @PreviewFeature -inline fun SecureValue.personalDetailsSecureValueOrNull(): PersonalDetailsSecureValue? = this as? PersonalDetailsSecureValue +inline fun SecureValue.personalDetailsSecureValueOrNull(): PersonalDetailsSecureValue? = + this as? PersonalDetailsSecureValue @PreviewFeature inline fun SecureValue.personalDetailsSecureValueOrThrow(): PersonalDetailsSecureValue = this as PersonalDetailsSecureValue @PreviewFeature -inline fun SecureValue.ifRentalAgreementSecureValue(block: (RentalAgreementSecureValue) -> T) = rentalAgreementSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifRentalAgreementSecureValue(block: (RentalAgreementSecureValue) -> T) = + rentalAgreementSecureValueOrNull()?.let(block) @PreviewFeature -inline fun SecureValue.rentalAgreementSecureValueOrNull(): RentalAgreementSecureValue? = this as? RentalAgreementSecureValue +inline fun SecureValue.rentalAgreementSecureValueOrNull(): RentalAgreementSecureValue? = + this as? RentalAgreementSecureValue @PreviewFeature inline fun SecureValue.rentalAgreementSecureValueOrThrow(): RentalAgreementSecureValue = this as RentalAgreementSecureValue @PreviewFeature -inline fun SecureValue.ifTemporalRegistrationSecureValue(block: (TemporalRegistrationSecureValue) -> T) = temporalRegistrationSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifTemporalRegistrationSecureValue(block: (TemporalRegistrationSecureValue) -> T) = + temporalRegistrationSecureValueOrNull()?.let(block) @PreviewFeature inline fun SecureValue.temporalRegistrationSecureValueOrNull(): TemporalRegistrationSecureValue? = @@ -878,7 +941,8 @@ inline fun SecureValue.temporalRegistrationSecureValueOrThrow(): TemporalRegistr this as TemporalRegistrationSecureValue @PreviewFeature -inline fun SecureValue.ifUtilityBillSecureValue(block: (UtilityBillSecureValue) -> T) = utilityBillSecureValueOrNull() ?.let(block) +inline fun SecureValue.ifUtilityBillSecureValue(block: (UtilityBillSecureValue) -> T) = + utilityBillSecureValueOrNull()?.let(block) @PreviewFeature inline fun SecureValue.utilityBillSecureValueOrNull(): UtilityBillSecureValue? = this as? UtilityBillSecureValue @@ -887,7 +951,8 @@ inline fun SecureValue.utilityBillSecureValueOrNull(): UtilityBillSecureValue? = inline fun SecureValue.utilityBillSecureValueOrThrow(): UtilityBillSecureValue = this as UtilityBillSecureValue @PreviewFeature -inline fun SecureValue.ifSecureValueIdentity(block: (SecureValueIdentity) -> T) = secureValueIdentityOrNull() ?.let(block) +inline fun SecureValue.ifSecureValueIdentity(block: (SecureValueIdentity) -> T) = + secureValueIdentityOrNull()?.let(block) @PreviewFeature inline fun SecureValue.secureValueIdentityOrNull(): SecureValueIdentity? = this as? SecureValueIdentity @@ -896,7 +961,8 @@ inline fun SecureValue.secureValueIdentityOrNull(): SecureValueIdentity? = this inline fun SecureValue.secureValueIdentityOrThrow(): SecureValueIdentity = this as SecureValueIdentity @PreviewFeature -inline fun SecureValue.ifSecureValueWithData(block: (SecureValueWithData) -> T) = secureValueWithDataOrNull() ?.let(block) +inline fun SecureValue.ifSecureValueWithData(block: (SecureValueWithData) -> T) = + secureValueWithDataOrNull()?.let(block) @PreviewFeature inline fun SecureValue.secureValueWithDataOrNull(): SecureValueWithData? = this as? SecureValueWithData @@ -905,7 +971,8 @@ inline fun SecureValue.secureValueWithDataOrNull(): SecureValueWithData? = this inline fun SecureValue.secureValueWithDataOrThrow(): SecureValueWithData = this as SecureValueWithData @PreviewFeature -inline fun SecureValue.ifSecureValueWithFiles(block: (SecureValueWithFiles) -> T) = secureValueWithFilesOrNull() ?.let(block) +inline fun SecureValue.ifSecureValueWithFiles(block: (SecureValueWithFiles) -> T) = + secureValueWithFilesOrNull()?.let(block) @PreviewFeature inline fun SecureValue.secureValueWithFilesOrNull(): SecureValueWithFiles? = this as? SecureValueWithFiles @@ -914,17 +981,20 @@ inline fun SecureValue.secureValueWithFilesOrNull(): SecureValueWithFiles? = thi inline fun SecureValue.secureValueWithFilesOrThrow(): SecureValueWithFiles = this as SecureValueWithFiles @PreviewFeature -inline fun SecureValue.ifSecureValueWithReverseSide(block: (SecureValueWithReverseSide) -> T) = secureValueWithReverseSideOrNull() ?.let(block) +inline fun SecureValue.ifSecureValueWithReverseSide(block: (SecureValueWithReverseSide) -> T) = + secureValueWithReverseSideOrNull()?.let(block) @PreviewFeature -inline fun SecureValue.secureValueWithReverseSideOrNull(): SecureValueWithReverseSide? = this as? SecureValueWithReverseSide +inline fun SecureValue.secureValueWithReverseSideOrNull(): SecureValueWithReverseSide? = + this as? SecureValueWithReverseSide @PreviewFeature inline fun SecureValue.secureValueWithReverseSideOrThrow(): SecureValueWithReverseSide = this as SecureValueWithReverseSide @PreviewFeature -inline fun SecureValue.ifSecureValueWithTranslations(block: (SecureValueWithTranslations) -> T) = secureValueWithTranslationsOrNull() ?.let(block) +inline fun SecureValue.ifSecureValueWithTranslations(block: (SecureValueWithTranslations) -> T) = + secureValueWithTranslationsOrNull()?.let(block) @PreviewFeature inline fun SecureValue.secureValueWithTranslationsOrNull(): SecureValueWithTranslations? = @@ -935,7 +1005,8 @@ inline fun SecureValue.secureValueWithTranslationsOrThrow(): SecureValueWithTran this as SecureValueWithTranslations @PreviewFeature -inline fun Message.ifAnonymousGroupContentMessageImpl(block: (AnonymousGroupContentMessageImpl) -> T) = anonymousGroupContentMessageImplOrNull() ?.let(block) +inline fun Message.ifAnonymousGroupContentMessageImpl(block: (AnonymousGroupContentMessageImpl) -> T) = + anonymousGroupContentMessageImplOrNull()?.let(block) @PreviewFeature inline fun Message.anonymousGroupContentMessageImplOrNull(): AnonymousGroupContentMessageImpl? = @@ -946,7 +1017,8 @@ inline fun Message.anonymousGroupContentMessageImplOrThrow(): AnonymousGroupCont this as AnonymousGroupContentMessageImpl @PreviewFeature -inline fun Message.ifChannelContentMessageImpl(block: (UnconnectedFromChannelGroupContentMessageImpl) -> T) = channelContentMessageImplOrNull() ?.let(block) +inline fun Message.ifChannelContentMessageImpl(block: (UnconnectedFromChannelGroupContentMessageImpl) -> T) = + channelContentMessageImplOrNull()?.let(block) @PreviewFeature inline fun Message.channelContentMessageImplOrNull(): UnconnectedFromChannelGroupContentMessageImpl? = @@ -957,7 +1029,7 @@ inline fun Message.channelContentMessageImplOrThrow(): UnconnectedFromChannelGro this as UnconnectedFromChannelGroupContentMessageImpl @PreviewFeature -inline fun Message.ifPassportMessage(block: (PassportMessage) -> T) = passportMessageOrNull() ?.let(block) +inline fun Message.ifPassportMessage(block: (PassportMessage) -> T) = passportMessageOrNull()?.let(block) @PreviewFeature inline fun Message.passportMessageOrNull(): PassportMessage? = this as? PassportMessage @@ -966,7 +1038,8 @@ inline fun Message.passportMessageOrNull(): PassportMessage? = this as? Passport inline fun Message.passportMessageOrThrow(): PassportMessage = this as PassportMessage @PreviewFeature -inline fun Message.ifPrivateContentMessageImpl(block: (PrivateContentMessageImpl) -> T) = privateContentMessageImplOrNull() ?.let(block) +inline fun Message.ifPrivateContentMessageImpl(block: (PrivateContentMessageImpl) -> T) = + privateContentMessageImplOrNull()?.let(block) @PreviewFeature inline fun Message.privateContentMessageImplOrNull(): PrivateContentMessageImpl? = @@ -977,7 +1050,8 @@ inline fun Message.privateContentMessageImplOrThrow(): PrivateContentMessageImpl this as PrivateContentMessageImpl @PreviewFeature -inline fun Message.ifChannelEventMessage(block: (ChannelEventMessage) -> T) = channelEventMessageOrNull() ?.let(block) +inline fun Message.ifChannelEventMessage(block: (ChannelEventMessage) -> T) = + channelEventMessageOrNull()?.let(block) @PreviewFeature inline fun Message.channelEventMessageOrNull(): ChannelEventMessage? = @@ -988,7 +1062,8 @@ inline fun Message.channelEventMessageOrThrow(): ChannelEventMessage @PreviewFeature -inline fun Message.ifChannelMediaGroupMessage(block: (ChannelMediaGroupMessage) -> T) = channelMediaGroupMessageOrNull() ?.let(block) +inline fun Message.ifChannelMediaGroupMessage(block: (ChannelMediaGroupMessage) -> T) = + channelMediaGroupMessageOrNull()?.let(block) @PreviewFeature inline fun Message.channelMediaGroupMessageOrNull(): ChannelMediaGroupMessage? = @@ -999,7 +1074,8 @@ inline fun Message.channelMediaGroupMessageOrThrow(): ChannelMediaGroupMessage @PreviewFeature -inline fun Message.ifCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T) = commonGroupEventMessageOrNull() ?.let(block) +inline fun Message.ifCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T) = + commonGroupEventMessageOrNull()?.let(block) @PreviewFeature inline fun Message.commonGroupEventMessageOrNull(): CommonGroupEventMessage? = @@ -1010,7 +1086,8 @@ inline fun Message.commonGroupEventMessageOrThrow(): CommonGroupEventMessage @PreviewFeature -inline fun Message.ifCommonMediaGroupMessage(block: (CommonMediaGroupMessage) -> T) = commonMediaGroupMessageOrNull() ?.let(block) +inline fun Message.ifCommonMediaGroupMessage(block: (CommonMediaGroupMessage) -> T) = + commonMediaGroupMessageOrNull()?.let(block) @PreviewFeature inline fun Message.commonMediaGroupMessageOrNull(): CommonMediaGroupMessage? = @@ -1021,7 +1098,8 @@ inline fun Message.commonMediaGroupMessageOrThrow(): CommonMediaGroupMessage @PreviewFeature -inline fun Message.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T) = commonSupergroupEventMessageOrNull() ?.let(block) +inline fun Message.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T) = + commonSupergroupEventMessageOrNull()?.let(block) @PreviewFeature inline fun Message.commonSupergroupEventMessageOrNull(): CommonSupergroupEventMessage? = @@ -1032,7 +1110,8 @@ inline fun Message.commonSupergroupEventMessageOrThrow(): CommonSupergroupEventM this as CommonSupergroupEventMessage @PreviewFeature -inline fun Message.ifAnonymousGroupContentMessage(block: (AnonymousGroupContentMessage) -> T) = anonymousGroupContentMessageOrNull() ?.let(block) +inline fun Message.ifAnonymousGroupContentMessage(block: (AnonymousGroupContentMessage) -> T) = + anonymousGroupContentMessageOrNull()?.let(block) @PreviewFeature inline fun Message.anonymousGroupContentMessageOrNull(): AnonymousGroupContentMessage? = @@ -1043,7 +1122,8 @@ inline fun Message.anonymousGroupContentMessageOrThrow(): AnonymousGroupContentM this as AnonymousGroupContentMessage @PreviewFeature -inline fun Message.ifChannelContentMessage(block: (ChannelContentMessage) -> T) = channelContentMessageOrNull() ?.let(block) +inline fun Message.ifChannelContentMessage(block: (ChannelContentMessage) -> T) = + channelContentMessageOrNull()?.let(block) @PreviewFeature inline fun Message.channelContentMessageOrNull(): ChannelContentMessage? = @@ -1054,7 +1134,8 @@ inline fun Message.channelContentMessageOrThrow(): ChannelContentMessage @PreviewFeature -inline fun Message.ifConnectedFromChannelGroupContentMessage(block: (ConnectedFromChannelGroupContentMessage) -> T) = connectedFromChannelGroupContentMessageOrNull() ?.let(block) +inline fun Message.ifConnectedFromChannelGroupContentMessage(block: (ConnectedFromChannelGroupContentMessage) -> T) = + connectedFromChannelGroupContentMessageOrNull()?.let(block) @PreviewFeature inline fun Message.connectedFromChannelGroupContentMessageOrNull(): ConnectedFromChannelGroupContentMessage? = @@ -1065,7 +1146,8 @@ inline fun Message.connectedFromChannelGroupContentMessageOrThrow(): ConnectedFr this as ConnectedFromChannelGroupContentMessage @PreviewFeature -inline fun Message.ifUnconnectedFromChannelGroupContentMessage(block: (UnconnectedFromChannelGroupContentMessage) -> T) = unconnectedFromChannelGroupContentMessageOrNull() ?.let(block) +inline fun Message.ifUnconnectedFromChannelGroupContentMessage(block: (UnconnectedFromChannelGroupContentMessage) -> T) = + unconnectedFromChannelGroupContentMessageOrNull()?.let(block) @PreviewFeature inline fun Message.unconnectedFromChannelGroupContentMessageOrNull(): UnconnectedFromChannelGroupContentMessage? = @@ -1076,7 +1158,8 @@ inline fun Message.unconnectedFromChannelGroupContentMessageOrThrow(): Unconnect this as UnconnectedFromChannelGroupContentMessage @PreviewFeature -inline fun Message.ifChatEventMessage(block: (ChatEventMessage) -> T) = chatEventMessageOrNull() ?.let(block) +inline fun Message.ifChatEventMessage(block: (ChatEventMessage) -> T) = + chatEventMessageOrNull()?.let(block) @PreviewFeature inline fun Message.chatEventMessageOrNull(): ChatEventMessage? = this as? ChatEventMessage @@ -1085,7 +1168,8 @@ inline fun Message.chatEventMessageOrNull(): ChatEventMessage? = this inline fun Message.chatEventMessageOrThrow(): ChatEventMessage = this as ChatEventMessage @PreviewFeature -inline fun Message.ifCommonGroupContentMessage(block: (CommonGroupContentMessage) -> T) = commonGroupContentMessageOrNull() ?.let(block) +inline fun Message.ifCommonGroupContentMessage(block: (CommonGroupContentMessage) -> T) = + commonGroupContentMessageOrNull()?.let(block) @PreviewFeature inline fun Message.commonGroupContentMessageOrNull(): CommonGroupContentMessage? = @@ -1096,7 +1180,7 @@ inline fun Message.commonGroupContentMessageOrThrow(): CommonGroupContentMessage this as CommonGroupContentMessage @PreviewFeature -inline fun Message.ifCommonMessage(block: (CommonMessage) -> T) = commonMessageOrNull() ?.let(block) +inline fun Message.ifCommonMessage(block: (CommonMessage) -> T) = commonMessageOrNull()?.let(block) @PreviewFeature inline fun Message.commonMessageOrNull(): CommonMessage? = this as? CommonMessage @@ -1105,7 +1189,8 @@ inline fun Message.commonMessageOrNull(): CommonMessage? = this inline fun Message.commonMessageOrThrow(): CommonMessage = this as CommonMessage @PreviewFeature -inline fun Message.ifContentMessage(block: (ContentMessage) -> T) = contentMessageOrNull() ?.let(block) +inline fun Message.ifContentMessage(block: (ContentMessage) -> T) = + contentMessageOrNull()?.let(block) @PreviewFeature inline fun Message.contentMessageOrNull(): ContentMessage? = this as? ContentMessage @@ -1114,7 +1199,8 @@ inline fun Message.contentMessageOrNull(): ContentMessage? = thi inline fun Message.contentMessageOrThrow(): ContentMessage = this as ContentMessage @PreviewFeature -inline fun Message.ifFromChannelGroupContentMessage(block: (FromChannelGroupContentMessage) -> T) = fromChannelGroupContentMessageOrNull() ?.let(block) +inline fun Message.ifFromChannelGroupContentMessage(block: (FromChannelGroupContentMessage) -> T) = + fromChannelGroupContentMessageOrNull()?.let(block) @PreviewFeature inline fun Message.fromChannelGroupContentMessageOrNull(): FromChannelGroupContentMessage? = @@ -1125,7 +1211,8 @@ inline fun Message.fromChannelGroupContentMessageOrThrow(): FromChannelGroupCont this as FromChannelGroupContentMessage @PreviewFeature -inline fun Message.ifGroupEventMessage(block: (GroupEventMessage) -> T) = groupEventMessageOrNull() ?.let(block) +inline fun Message.ifGroupEventMessage(block: (GroupEventMessage) -> T) = + groupEventMessageOrNull()?.let(block) @PreviewFeature inline fun Message.groupEventMessageOrNull(): GroupEventMessage? = this as? GroupEventMessage @@ -1134,16 +1221,20 @@ inline fun Message.groupEventMessageOrNull(): GroupEventMessage? = t inline fun Message.groupEventMessageOrThrow(): GroupEventMessage = this as GroupEventMessage @PreviewFeature -inline fun Message.ifPrivateEventMessage(block: (PrivateEventMessage) -> T) = privateEventMessageOrNull() ?.let(block) +inline fun Message.ifPrivateEventMessage(block: (PrivateEventMessage) -> T) = + privateEventMessageOrNull()?.let(block) @PreviewFeature -inline fun Message.privateEventMessageOrNull(): PrivateEventMessage? = this as? PrivateEventMessage +inline fun Message.privateEventMessageOrNull(): PrivateEventMessage? = + this as? PrivateEventMessage @PreviewFeature -inline fun Message.privateEventMessageOrThrow(): PrivateEventMessage = this as PrivateEventMessage +inline fun Message.privateEventMessageOrThrow(): PrivateEventMessage = + this as PrivateEventMessage @PreviewFeature -inline fun Message.ifGroupContentMessage(block: (GroupContentMessage) -> T) = groupContentMessageOrNull() ?.let(block) +inline fun Message.ifGroupContentMessage(block: (GroupContentMessage) -> T) = + groupContentMessageOrNull()?.let(block) @PreviewFeature inline fun Message.groupContentMessageOrNull(): GroupContentMessage? = @@ -1154,7 +1245,8 @@ inline fun Message.groupContentMessageOrThrow(): GroupContentMessage @PreviewFeature -inline fun Message.ifMediaGroupMessage(block: (MediaGroupMessage) -> T) = mediaGroupMessageOrNull() ?.let(block) +inline fun Message.ifMediaGroupMessage(block: (MediaGroupMessage) -> T) = + mediaGroupMessageOrNull()?.let(block) @PreviewFeature inline fun Message.mediaGroupMessageOrNull(): MediaGroupMessage? = @@ -1165,7 +1257,8 @@ inline fun Message.mediaGroupMessageOrThrow(): MediaGroupMessage @PreviewFeature -inline fun Message.ifPossiblyEditedMessage(block: (PossiblyEditedMessage) -> T) = possiblyEditedMessageOrNull() ?.let(block) +inline fun Message.ifPossiblyEditedMessage(block: (PossiblyEditedMessage) -> T) = + possiblyEditedMessageOrNull()?.let(block) @PreviewFeature inline fun Message.possiblyEditedMessageOrNull(): PossiblyEditedMessage? = this as? PossiblyEditedMessage @@ -1174,7 +1267,8 @@ inline fun Message.possiblyEditedMessageOrNull(): PossiblyEditedMessage? = this inline fun Message.possiblyEditedMessageOrThrow(): PossiblyEditedMessage = this as PossiblyEditedMessage @PreviewFeature -inline fun Message.ifPossiblyReplyMessage(block: (PossiblyReplyMessage) -> T) = possiblyReplyMessageOrNull() ?.let(block) +inline fun Message.ifPossiblyReplyMessage(block: (PossiblyReplyMessage) -> T) = + possiblyReplyMessageOrNull()?.let(block) @PreviewFeature inline fun Message.possiblyReplyMessageOrNull(): PossiblyReplyMessage? = this as? PossiblyReplyMessage @@ -1183,7 +1277,8 @@ inline fun Message.possiblyReplyMessageOrNull(): PossiblyReplyMessage? = this as inline fun Message.possiblyReplyMessageOrThrow(): PossiblyReplyMessage = this as PossiblyReplyMessage @PreviewFeature -inline fun Message.ifPossiblyForwardedMessage(block: (PossiblyForwardedMessage) -> T) = possiblyForwardedMessageOrNull() ?.let(block) +inline fun Message.ifPossiblyForwardedMessage(block: (PossiblyForwardedMessage) -> T) = + possiblyForwardedMessageOrNull()?.let(block) @PreviewFeature inline fun Message.possiblyForwardedMessageOrNull(): PossiblyForwardedMessage? = this as? PossiblyForwardedMessage @@ -1192,7 +1287,8 @@ inline fun Message.possiblyForwardedMessageOrNull(): PossiblyForwardedMessage? = inline fun Message.possiblyForwardedMessageOrThrow(): PossiblyForwardedMessage = this as PossiblyForwardedMessage @PreviewFeature -inline fun Message.ifPossiblyPaymentMessage(block: (PossiblyPaymentMessage) -> T) = possiblyPaymentMessageOrNull() ?.let(block) +inline fun Message.ifPossiblyPaymentMessage(block: (PossiblyPaymentMessage) -> T) = + possiblyPaymentMessageOrNull()?.let(block) @PreviewFeature inline fun Message.possiblyPaymentMessageOrNull(): PossiblyPaymentMessage? = this as? PossiblyPaymentMessage @@ -1201,7 +1297,8 @@ inline fun Message.possiblyPaymentMessageOrNull(): PossiblyPaymentMessage? = thi inline fun Message.possiblyPaymentMessageOrThrow(): PossiblyPaymentMessage = this as PossiblyPaymentMessage @PreviewFeature -inline fun Message.ifPrivateContentMessage(block: (PrivateContentMessage) -> T) = privateContentMessageOrNull() ?.let(block) +inline fun Message.ifPrivateContentMessage(block: (PrivateContentMessage) -> T) = + privateContentMessageOrNull()?.let(block) @PreviewFeature inline fun Message.privateContentMessageOrNull(): PrivateContentMessage? = @@ -1212,7 +1309,8 @@ inline fun Message.privateContentMessageOrThrow(): PrivateContentMessage @PreviewFeature -inline fun Message.ifPublicContentMessage(block: (PublicContentMessage) -> T) = publicContentMessageOrNull() ?.let(block) +inline fun Message.ifPublicContentMessage(block: (PublicContentMessage) -> T) = + publicContentMessageOrNull()?.let(block) @PreviewFeature inline fun Message.publicContentMessageOrNull(): PublicContentMessage? = @@ -1223,7 +1321,7 @@ inline fun Message.publicContentMessageOrThrow(): PublicContentMessage @PreviewFeature -inline fun Message.ifSignedMessage(block: (SignedMessage) -> T) = signedMessageOrNull() ?.let(block) +inline fun Message.ifSignedMessage(block: (SignedMessage) -> T) = signedMessageOrNull()?.let(block) @PreviewFeature inline fun Message.signedMessageOrNull(): SignedMessage? = this as? SignedMessage @@ -1232,7 +1330,8 @@ inline fun Message.signedMessageOrNull(): SignedMessage? = this as? SignedMessag inline fun Message.signedMessageOrThrow(): SignedMessage = this as SignedMessage @PreviewFeature -inline fun Message.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T) = supergroupEventMessageOrNull() ?.let(block) +inline fun Message.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T) = + supergroupEventMessageOrNull()?.let(block) @PreviewFeature inline fun Message.supergroupEventMessageOrNull(): SupergroupEventMessage? = @@ -1243,7 +1342,7 @@ inline fun Message.supergroupEventMessageOrThrow(): SupergroupEventMessage @PreviewFeature -inline fun Message.ifUnknownMessageType(block: (UnknownMessageType) -> T) = unknownMessageTypeOrNull() ?.let(block) +inline fun Message.ifUnknownMessageType(block: (UnknownMessageType) -> T) = unknownMessageTypeOrNull()?.let(block) @PreviewFeature inline fun Message.unknownMessageTypeOrNull(): UnknownMessageType? = this as? UnknownMessageType @@ -1252,7 +1351,8 @@ inline fun Message.unknownMessageTypeOrNull(): UnknownMessageType? = this as? Un inline fun Message.unknownMessageTypeOrThrow(): UnknownMessageType = this as UnknownMessageType @PreviewFeature -inline fun Message.ifPossiblySentViaBotCommonMessage(block: (PossiblySentViaBotCommonMessage) -> T) = possiblySentViaBotCommonMessageOrNull() ?.let(block) +inline fun Message.ifPossiblySentViaBotCommonMessage(block: (PossiblySentViaBotCommonMessage) -> T) = + possiblySentViaBotCommonMessageOrNull()?.let(block) @PreviewFeature inline fun Message.possiblySentViaBotCommonMessageOrNull(): PossiblySentViaBotCommonMessage? = @@ -1263,7 +1363,7 @@ inline fun Message.possiblySentViaBotCommonMessageOrThrow(): PossiblySentViaBotC this as PossiblySentViaBotCommonMessage @PreviewFeature -inline fun Message.ifFromUserMessage(block: (FromUserMessage) -> T) = fromUserMessageOrNull() ?.let(block) +inline fun Message.ifFromUserMessage(block: (FromUserMessage) -> T) = fromUserMessageOrNull()?.let(block) @PreviewFeature inline fun Message.fromUserMessageOrNull(): FromUserMessage? = this as? FromUserMessage @@ -1272,7 +1372,7 @@ inline fun Message.fromUserMessageOrNull(): FromUserMessage? = this as? FromUser inline fun Message.fromUserMessageOrThrow(): FromUserMessage = this as FromUserMessage @PreviewFeature -inline fun BotAction.ifFindLocationAction(block: (FindLocationAction) -> T) = findLocationActionOrNull() ?.let(block) +inline fun BotAction.ifFindLocationAction(block: (FindLocationAction) -> T) = findLocationActionOrNull()?.let(block) @PreviewFeature inline fun BotAction.findLocationActionOrNull(): FindLocationAction? = this as? FindLocationAction @@ -1281,7 +1381,7 @@ inline fun BotAction.findLocationActionOrNull(): FindLocationAction? = this as? inline fun BotAction.findLocationActionOrThrow(): FindLocationAction = this as FindLocationAction @PreviewFeature -inline fun BotAction.ifRecordVoiceAction(block: (RecordVoiceAction) -> T) = recordVoiceActionOrNull() ?.let(block) +inline fun BotAction.ifRecordVoiceAction(block: (RecordVoiceAction) -> T) = recordVoiceActionOrNull()?.let(block) @PreviewFeature inline fun BotAction.recordVoiceActionOrNull(): RecordVoiceAction? = this as? RecordVoiceAction @@ -1290,7 +1390,7 @@ inline fun BotAction.recordVoiceActionOrNull(): RecordVoiceAction? = this as? Re inline fun BotAction.recordVoiceActionOrThrow(): RecordVoiceAction = this as RecordVoiceAction @PreviewFeature -inline fun BotAction.ifRecordVideoAction(block: (RecordVideoAction) -> T) = recordVideoActionOrNull() ?.let(block) +inline fun BotAction.ifRecordVideoAction(block: (RecordVideoAction) -> T) = recordVideoActionOrNull()?.let(block) @PreviewFeature inline fun BotAction.recordVideoActionOrNull(): RecordVideoAction? = this as? RecordVideoAction @@ -1299,7 +1399,8 @@ inline fun BotAction.recordVideoActionOrNull(): RecordVideoAction? = this as? Re inline fun BotAction.recordVideoActionOrThrow(): RecordVideoAction = this as RecordVideoAction @PreviewFeature -inline fun BotAction.ifRecordVideoNoteAction(block: (RecordVideoNoteAction) -> T) = recordVideoNoteActionOrNull() ?.let(block) +inline fun BotAction.ifRecordVideoNoteAction(block: (RecordVideoNoteAction) -> T) = + recordVideoNoteActionOrNull()?.let(block) @PreviewFeature inline fun BotAction.recordVideoNoteActionOrNull(): RecordVideoNoteAction? = this as? RecordVideoNoteAction @@ -1308,7 +1409,7 @@ inline fun BotAction.recordVideoNoteActionOrNull(): RecordVideoNoteAction? = thi inline fun BotAction.recordVideoNoteActionOrThrow(): RecordVideoNoteAction = this as RecordVideoNoteAction @PreviewFeature -inline fun BotAction.ifTypingAction(block: (TypingAction) -> T) = typingActionOrNull() ?.let(block) +inline fun BotAction.ifTypingAction(block: (TypingAction) -> T) = typingActionOrNull()?.let(block) @PreviewFeature inline fun BotAction.typingActionOrNull(): TypingAction? = this as? TypingAction @@ -1317,7 +1418,8 @@ inline fun BotAction.typingActionOrNull(): TypingAction? = this as? TypingAction inline fun BotAction.typingActionOrThrow(): TypingAction = this as TypingAction @PreviewFeature -inline fun BotAction.ifChooseStickerAction(block: (ChooseStickerAction) -> T) = chooseStickerActionOrNull() ?.let(block) +inline fun BotAction.ifChooseStickerAction(block: (ChooseStickerAction) -> T) = + chooseStickerActionOrNull()?.let(block) @PreviewFeature inline fun BotAction.chooseStickerActionOrNull(): ChooseStickerAction? = this as? ChooseStickerAction @@ -1326,7 +1428,7 @@ inline fun BotAction.chooseStickerActionOrNull(): ChooseStickerAction? = this as inline fun BotAction.chooseStickerActionOrThrow(): ChooseStickerAction = this as ChooseStickerAction @PreviewFeature -inline fun BotAction.ifUploadVoiceAction(block: (UploadVoiceAction) -> T) = uploadVoiceActionOrNull() ?.let(block) +inline fun BotAction.ifUploadVoiceAction(block: (UploadVoiceAction) -> T) = uploadVoiceActionOrNull()?.let(block) @PreviewFeature inline fun BotAction.uploadVoiceActionOrNull(): UploadVoiceAction? = this as? UploadVoiceAction @@ -1335,7 +1437,8 @@ inline fun BotAction.uploadVoiceActionOrNull(): UploadVoiceAction? = this as? Up inline fun BotAction.uploadVoiceActionOrThrow(): UploadVoiceAction = this as UploadVoiceAction @PreviewFeature -inline fun BotAction.ifUploadDocumentAction(block: (UploadDocumentAction) -> T) = uploadDocumentActionOrNull() ?.let(block) +inline fun BotAction.ifUploadDocumentAction(block: (UploadDocumentAction) -> T) = + uploadDocumentActionOrNull()?.let(block) @PreviewFeature inline fun BotAction.uploadDocumentActionOrNull(): UploadDocumentAction? = this as? UploadDocumentAction @@ -1344,7 +1447,7 @@ inline fun BotAction.uploadDocumentActionOrNull(): UploadDocumentAction? = this inline fun BotAction.uploadDocumentActionOrThrow(): UploadDocumentAction = this as UploadDocumentAction @PreviewFeature -inline fun BotAction.ifUploadPhotoAction(block: (UploadPhotoAction) -> T) = uploadPhotoActionOrNull() ?.let(block) +inline fun BotAction.ifUploadPhotoAction(block: (UploadPhotoAction) -> T) = uploadPhotoActionOrNull()?.let(block) @PreviewFeature inline fun BotAction.uploadPhotoActionOrNull(): UploadPhotoAction? = this as? UploadPhotoAction @@ -1353,7 +1456,7 @@ inline fun BotAction.uploadPhotoActionOrNull(): UploadPhotoAction? = this as? Up inline fun BotAction.uploadPhotoActionOrThrow(): UploadPhotoAction = this as UploadPhotoAction @PreviewFeature -inline fun BotAction.ifUploadVideoAction(block: (UploadVideoAction) -> T) = uploadVideoActionOrNull() ?.let(block) +inline fun BotAction.ifUploadVideoAction(block: (UploadVideoAction) -> T) = uploadVideoActionOrNull()?.let(block) @PreviewFeature inline fun BotAction.uploadVideoActionOrNull(): UploadVideoAction? = this as? UploadVideoAction @@ -1362,7 +1465,8 @@ inline fun BotAction.uploadVideoActionOrNull(): UploadVideoAction? = this as? Up inline fun BotAction.uploadVideoActionOrThrow(): UploadVideoAction = this as UploadVideoAction @PreviewFeature -inline fun BotAction.ifUploadVideoNoteAction(block: (UploadVideoNoteAction) -> T) = uploadVideoNoteActionOrNull() ?.let(block) +inline fun BotAction.ifUploadVideoNoteAction(block: (UploadVideoNoteAction) -> T) = + uploadVideoNoteActionOrNull()?.let(block) @PreviewFeature inline fun BotAction.uploadVideoNoteActionOrNull(): UploadVideoNoteAction? = this as? UploadVideoNoteAction @@ -1371,7 +1475,7 @@ inline fun BotAction.uploadVideoNoteActionOrNull(): UploadVideoNoteAction? = thi inline fun BotAction.uploadVideoNoteActionOrThrow(): UploadVideoNoteAction = this as UploadVideoNoteAction @PreviewFeature -inline fun InlineQuery.ifBaseInlineQuery(block: (BaseInlineQuery) -> T) = baseInlineQueryOrNull() ?.let(block) +inline fun InlineQuery.ifBaseInlineQuery(block: (BaseInlineQuery) -> T) = baseInlineQueryOrNull()?.let(block) @PreviewFeature inline fun InlineQuery.baseInlineQueryOrNull(): BaseInlineQuery? = @@ -1382,7 +1486,8 @@ inline fun InlineQuery.baseInlineQueryOrThrow(): BaseInlineQuery = this as BaseInlineQuery @PreviewFeature -inline fun InlineQuery.ifLocationInlineQuery(block: (LocationInlineQuery) -> T) = locationInlineQueryOrNull() ?.let(block) +inline fun InlineQuery.ifLocationInlineQuery(block: (LocationInlineQuery) -> T) = + locationInlineQueryOrNull()?.let(block) @PreviewFeature inline fun InlineQuery.locationInlineQueryOrNull(): LocationInlineQuery? = @@ -1393,7 +1498,8 @@ inline fun InlineQuery.locationInlineQueryOrThrow(): LocationInlineQuery = this as LocationInlineQuery @PreviewFeature -inline fun InputMessageContent.ifInputContactMessageContent(block: (InputContactMessageContent) -> T) = inputContactMessageContentOrNull() ?.let(block) +inline fun InputMessageContent.ifInputContactMessageContent(block: (InputContactMessageContent) -> T) = + inputContactMessageContentOrNull()?.let(block) @PreviewFeature inline fun InputMessageContent.inputContactMessageContentOrNull(): InputContactMessageContent? = @@ -1404,7 +1510,8 @@ inline fun InputMessageContent.inputContactMessageContentOrThrow(): InputContact this as InputContactMessageContent @PreviewFeature -inline fun InputMessageContent.ifInputLocationMessageContent(block: (InputLocationMessageContent) -> T) = inputLocationMessageContentOrNull() ?.let(block) +inline fun InputMessageContent.ifInputLocationMessageContent(block: (InputLocationMessageContent) -> T) = + inputLocationMessageContentOrNull()?.let(block) @PreviewFeature inline fun InputMessageContent.inputLocationMessageContentOrNull(): InputLocationMessageContent? = @@ -1415,17 +1522,20 @@ inline fun InputMessageContent.inputLocationMessageContentOrThrow(): InputLocati this as InputLocationMessageContent @PreviewFeature -inline fun InputMessageContent.ifInputTextMessageContent(block: (InputTextMessageContent) -> T) = inputTextMessageContentOrNull() ?.let(block) +inline fun InputMessageContent.ifInputTextMessageContent(block: (InputTextMessageContent) -> T) = + inputTextMessageContentOrNull()?.let(block) @PreviewFeature -inline fun InputMessageContent.inputTextMessageContentOrNull(): InputTextMessageContent? = this as? InputTextMessageContent +inline fun InputMessageContent.inputTextMessageContentOrNull(): InputTextMessageContent? = + this as? InputTextMessageContent @PreviewFeature inline fun InputMessageContent.inputTextMessageContentOrThrow(): InputTextMessageContent = this as InputTextMessageContent @PreviewFeature -inline fun InputMessageContent.ifInputVenueMessageContent(block: (InputVenueMessageContent) -> T) = inputVenueMessageContentOrNull() ?.let(block) +inline fun InputMessageContent.ifInputVenueMessageContent(block: (InputVenueMessageContent) -> T) = + inputVenueMessageContentOrNull()?.let(block) @PreviewFeature inline fun InputMessageContent.inputVenueMessageContentOrNull(): InputVenueMessageContent? = @@ -1436,7 +1546,8 @@ inline fun InputMessageContent.inputVenueMessageContentOrThrow(): InputVenueMess this as InputVenueMessageContent @PreviewFeature -inline fun InputMessageContent.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T) = inputInvoiceMessageContentOrNull() ?.let(block) +inline fun InputMessageContent.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T) = + inputInvoiceMessageContentOrNull()?.let(block) @PreviewFeature inline fun InputMessageContent.inputInvoiceMessageContentOrNull(): InputInvoiceMessageContent? = @@ -1447,27 +1558,32 @@ inline fun InputMessageContent.inputInvoiceMessageContentOrThrow(): InputInvoice this as InputInvoiceMessageContent @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultArticle(block: (InlineQueryResultArticle) -> T) = inlineQueryResultArticleOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultArticle(block: (InlineQueryResultArticle) -> T) = + inlineQueryResultArticleOrNull()?.let(block) @PreviewFeature -inline fun InlineQueryResult.inlineQueryResultArticleOrNull(): InlineQueryResultArticle? = this as? InlineQueryResultArticle +inline fun InlineQueryResult.inlineQueryResultArticleOrNull(): InlineQueryResultArticle? = + this as? InlineQueryResultArticle @PreviewFeature inline fun InlineQueryResult.inlineQueryResultArticleOrThrow(): InlineQueryResultArticle = this as InlineQueryResultArticle @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultContact(block: (InlineQueryResultContact) -> T) = inlineQueryResultContactOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultContact(block: (InlineQueryResultContact) -> T) = + inlineQueryResultContactOrNull()?.let(block) @PreviewFeature -inline fun InlineQueryResult.inlineQueryResultContactOrNull(): InlineQueryResultContact? = this as? InlineQueryResultContact +inline fun InlineQueryResult.inlineQueryResultContactOrNull(): InlineQueryResultContact? = + this as? InlineQueryResultContact @PreviewFeature inline fun InlineQueryResult.inlineQueryResultContactOrThrow(): InlineQueryResultContact = this as InlineQueryResultContact @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultGame(block: (InlineQueryResultGame) -> T) = inlineQueryResultGameOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultGame(block: (InlineQueryResultGame) -> T) = + inlineQueryResultGameOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultGameOrNull(): InlineQueryResultGame? = this as? InlineQueryResultGame @@ -1476,7 +1592,8 @@ inline fun InlineQueryResult.inlineQueryResultGameOrNull(): InlineQueryResultGam inline fun InlineQueryResult.inlineQueryResultGameOrThrow(): InlineQueryResultGame = this as InlineQueryResultGame @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultLocation(block: (InlineQueryResultLocation) -> T) = inlineQueryResultLocationOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultLocation(block: (InlineQueryResultLocation) -> T) = + inlineQueryResultLocationOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultLocationOrNull(): InlineQueryResultLocation? = @@ -1487,7 +1604,8 @@ inline fun InlineQueryResult.inlineQueryResultLocationOrThrow(): InlineQueryResu this as InlineQueryResultLocation @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultStickerCached(block: (InlineQueryResultStickerCached) -> T) = inlineQueryResultStickerCachedOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultStickerCached(block: (InlineQueryResultStickerCached) -> T) = + inlineQueryResultStickerCachedOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultStickerCachedOrNull(): InlineQueryResultStickerCached? = @@ -1498,7 +1616,8 @@ inline fun InlineQueryResult.inlineQueryResultStickerCachedOrThrow(): InlineQuer this as InlineQueryResultStickerCached @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVenue(block: (InlineQueryResultVenue) -> T) = inlineQueryResultVenueOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultVenue(block: (InlineQueryResultVenue) -> T) = + inlineQueryResultVenueOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultVenueOrNull(): InlineQueryResultVenue? = this as? InlineQueryResultVenue @@ -1507,7 +1626,8 @@ inline fun InlineQueryResult.inlineQueryResultVenueOrNull(): InlineQueryResultVe inline fun InlineQueryResult.inlineQueryResultVenueOrThrow(): InlineQueryResultVenue = this as InlineQueryResultVenue @PreviewFeature -inline fun InlineQueryResult.ifDescribedInlineQueryResult(block: (DescribedInlineQueryResult) -> T) = describedInlineQueryResultOrNull() ?.let(block) +inline fun InlineQueryResult.ifDescribedInlineQueryResult(block: (DescribedInlineQueryResult) -> T) = + describedInlineQueryResultOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.describedInlineQueryResultOrNull(): DescribedInlineQueryResult? = @@ -1518,7 +1638,8 @@ inline fun InlineQueryResult.describedInlineQueryResultOrThrow(): DescribedInlin this as DescribedInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.ifFileInlineQueryResult(block: (FileInlineQueryResult) -> T) = fileInlineQueryResultOrNull() ?.let(block) +inline fun InlineQueryResult.ifFileInlineQueryResult(block: (FileInlineQueryResult) -> T) = + fileInlineQueryResultOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.fileInlineQueryResultOrNull(): FileInlineQueryResult? = this as? FileInlineQueryResult @@ -1527,7 +1648,8 @@ inline fun InlineQueryResult.fileInlineQueryResultOrNull(): FileInlineQueryResul inline fun InlineQueryResult.fileInlineQueryResultOrThrow(): FileInlineQueryResult = this as FileInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.ifOptionallyTitledInlineQueryResult(block: (OptionallyTitledInlineQueryResult) -> T) = optionallyTitledInlineQueryResultOrNull() ?.let(block) +inline fun InlineQueryResult.ifOptionallyTitledInlineQueryResult(block: (OptionallyTitledInlineQueryResult) -> T) = + optionallyTitledInlineQueryResultOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.optionallyTitledInlineQueryResultOrNull(): OptionallyTitledInlineQueryResult? = @@ -1538,7 +1660,8 @@ inline fun InlineQueryResult.optionallyTitledInlineQueryResultOrThrow(): Optiona this as OptionallyTitledInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.ifSizedInlineQueryResult(block: (SizedInlineQueryResult) -> T) = sizedInlineQueryResultOrNull() ?.let(block) +inline fun InlineQueryResult.ifSizedInlineQueryResult(block: (SizedInlineQueryResult) -> T) = + sizedInlineQueryResultOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.sizedInlineQueryResultOrNull(): SizedInlineQueryResult? = this as? SizedInlineQueryResult @@ -1547,7 +1670,8 @@ inline fun InlineQueryResult.sizedInlineQueryResultOrNull(): SizedInlineQueryRes inline fun InlineQueryResult.sizedInlineQueryResultOrThrow(): SizedInlineQueryResult = this as SizedInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.ifThumbSizedInlineQueryResult(block: (ThumbSizedInlineQueryResult) -> T) = thumbSizedInlineQueryResultOrNull() ?.let(block) +inline fun InlineQueryResult.ifThumbSizedInlineQueryResult(block: (ThumbSizedInlineQueryResult) -> T) = + thumbSizedInlineQueryResultOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.thumbSizedInlineQueryResultOrNull(): ThumbSizedInlineQueryResult? = @@ -1558,17 +1682,20 @@ inline fun InlineQueryResult.thumbSizedInlineQueryResultOrThrow(): ThumbSizedInl this as ThumbSizedInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.ifThumbedInlineQueryResult(block: (ThumbedInlineQueryResult) -> T) = thumbedInlineQueryResultOrNull() ?.let(block) +inline fun InlineQueryResult.ifThumbedInlineQueryResult(block: (ThumbedInlineQueryResult) -> T) = + thumbedInlineQueryResultOrNull()?.let(block) @PreviewFeature -inline fun InlineQueryResult.thumbedInlineQueryResultOrNull(): ThumbedInlineQueryResult? = this as? ThumbedInlineQueryResult +inline fun InlineQueryResult.thumbedInlineQueryResultOrNull(): ThumbedInlineQueryResult? = + this as? ThumbedInlineQueryResult @PreviewFeature inline fun InlineQueryResult.thumbedInlineQueryResultOrThrow(): ThumbedInlineQueryResult = this as ThumbedInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.ifThumbedWithMimeTypeInlineQueryResult(block: (ThumbedWithMimeTypeInlineQueryResult) -> T) = thumbedWithMimeTypeInlineQueryResultOrNull() ?.let(block) +inline fun InlineQueryResult.ifThumbedWithMimeTypeInlineQueryResult(block: (ThumbedWithMimeTypeInlineQueryResult) -> T) = + thumbedWithMimeTypeInlineQueryResultOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.thumbedWithMimeTypeInlineQueryResultOrNull(): ThumbedWithMimeTypeInlineQueryResult? = @@ -1579,16 +1706,19 @@ inline fun InlineQueryResult.thumbedWithMimeTypeInlineQueryResultOrThrow(): Thum this as ThumbedWithMimeTypeInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.ifTitledInlineQueryResult(block: (TitledInlineQueryResult) -> T) = titledInlineQueryResultOrNull() ?.let(block) +inline fun InlineQueryResult.ifTitledInlineQueryResult(block: (TitledInlineQueryResult) -> T) = + titledInlineQueryResultOrNull()?.let(block) @PreviewFeature -inline fun InlineQueryResult.titledInlineQueryResultOrNull(): TitledInlineQueryResult? = this as? TitledInlineQueryResult +inline fun InlineQueryResult.titledInlineQueryResultOrNull(): TitledInlineQueryResult? = + this as? TitledInlineQueryResult @PreviewFeature inline fun InlineQueryResult.titledInlineQueryResultOrThrow(): TitledInlineQueryResult = this as TitledInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.ifUrlInlineQueryResult(block: (UrlInlineQueryResult) -> T) = urlInlineQueryResultOrNull() ?.let(block) +inline fun InlineQueryResult.ifUrlInlineQueryResult(block: (UrlInlineQueryResult) -> T) = + urlInlineQueryResultOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.urlInlineQueryResultOrNull(): UrlInlineQueryResult? = this as? UrlInlineQueryResult @@ -1597,7 +1727,8 @@ inline fun InlineQueryResult.urlInlineQueryResultOrNull(): UrlInlineQueryResult? inline fun InlineQueryResult.urlInlineQueryResultOrThrow(): UrlInlineQueryResult = this as UrlInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.ifWithInputMessageContentInlineQueryResult(block: (WithInputMessageContentInlineQueryResult) -> T) = withInputMessageContentInlineQueryResultOrNull() ?.let(block) +inline fun InlineQueryResult.ifWithInputMessageContentInlineQueryResult(block: (WithInputMessageContentInlineQueryResult) -> T) = + withInputMessageContentInlineQueryResultOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrNull(): WithInputMessageContentInlineQueryResult? = @@ -1608,7 +1739,8 @@ inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrThrow(): this as WithInputMessageContentInlineQueryResult @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultAudio(block: (InlineQueryResultAudio) -> T) = inlineQueryResultAudioOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultAudio(block: (InlineQueryResultAudio) -> T) = + inlineQueryResultAudioOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultAudioOrNull(): InlineQueryResultAudio? = this as? InlineQueryResultAudio @@ -1617,7 +1749,8 @@ inline fun InlineQueryResult.inlineQueryResultAudioOrNull(): InlineQueryResultAu inline fun InlineQueryResult.inlineQueryResultAudioOrThrow(): InlineQueryResultAudio = this as InlineQueryResultAudio @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultAudioCached(block: (InlineQueryResultAudioCached) -> T) = inlineQueryResultAudioCachedOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultAudioCached(block: (InlineQueryResultAudioCached) -> T) = + inlineQueryResultAudioCachedOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultAudioCachedOrNull(): InlineQueryResultAudioCached? = @@ -1628,7 +1761,8 @@ inline fun InlineQueryResult.inlineQueryResultAudioCachedOrThrow(): InlineQueryR this as InlineQueryResultAudioCached @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultAudioCommon(block: (InlineQueryResultAudioCommon) -> T) = inlineQueryResultAudioCommonOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultAudioCommon(block: (InlineQueryResultAudioCommon) -> T) = + inlineQueryResultAudioCommonOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultAudioCommonOrNull(): InlineQueryResultAudioCommon? = @@ -1639,7 +1773,8 @@ inline fun InlineQueryResult.inlineQueryResultAudioCommonOrThrow(): InlineQueryR this as InlineQueryResultAudioCommon @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultDocument(block: (InlineQueryResultDocument) -> T) = inlineQueryResultDocumentOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultDocument(block: (InlineQueryResultDocument) -> T) = + inlineQueryResultDocumentOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultDocumentOrNull(): InlineQueryResultDocument? = @@ -1650,7 +1785,8 @@ inline fun InlineQueryResult.inlineQueryResultDocumentOrThrow(): InlineQueryResu this as InlineQueryResultDocument @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultDocumentCached(block: (InlineQueryResultDocumentCached) -> T) = inlineQueryResultDocumentCachedOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultDocumentCached(block: (InlineQueryResultDocumentCached) -> T) = + inlineQueryResultDocumentCachedOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultDocumentCachedOrNull(): InlineQueryResultDocumentCached? = @@ -1661,7 +1797,8 @@ inline fun InlineQueryResult.inlineQueryResultDocumentCachedOrThrow(): InlineQue this as InlineQueryResultDocumentCached @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultDocumentCommon(block: (InlineQueryResultDocumentCommon) -> T) = inlineQueryResultDocumentCommonOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultDocumentCommon(block: (InlineQueryResultDocumentCommon) -> T) = + inlineQueryResultDocumentCommonOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultDocumentCommonOrNull(): InlineQueryResultDocumentCommon? = @@ -1672,7 +1809,8 @@ inline fun InlineQueryResult.inlineQueryResultDocumentCommonOrThrow(): InlineQue this as InlineQueryResultDocumentCommon @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultGif(block: (InlineQueryResultGif) -> T) = inlineQueryResultGifOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultGif(block: (InlineQueryResultGif) -> T) = + inlineQueryResultGifOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultGifOrNull(): InlineQueryResultGif? = this as? InlineQueryResultGif @@ -1681,7 +1819,8 @@ inline fun InlineQueryResult.inlineQueryResultGifOrNull(): InlineQueryResultGif? inline fun InlineQueryResult.inlineQueryResultGifOrThrow(): InlineQueryResultGif = this as InlineQueryResultGif @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultGifCached(block: (InlineQueryResultGifCached) -> T) = inlineQueryResultGifCachedOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultGifCached(block: (InlineQueryResultGifCached) -> T) = + inlineQueryResultGifCachedOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultGifCachedOrNull(): InlineQueryResultGifCached? = @@ -1692,7 +1831,8 @@ inline fun InlineQueryResult.inlineQueryResultGifCachedOrThrow(): InlineQueryRes this as InlineQueryResultGifCached @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultGifCommon(block: (InlineQueryResultGifCommon) -> T) = inlineQueryResultGifCommonOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultGifCommon(block: (InlineQueryResultGifCommon) -> T) = + inlineQueryResultGifCommonOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultGifCommonOrNull(): InlineQueryResultGifCommon? = @@ -1703,7 +1843,8 @@ inline fun InlineQueryResult.inlineQueryResultGifCommonOrThrow(): InlineQueryRes this as InlineQueryResultGifCommon @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultMpeg4Gif(block: (InlineQueryResultMpeg4Gif) -> T) = inlineQueryResultMpeg4GifOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultMpeg4Gif(block: (InlineQueryResultMpeg4Gif) -> T) = + inlineQueryResultMpeg4GifOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultMpeg4GifOrNull(): InlineQueryResultMpeg4Gif? = @@ -1714,7 +1855,8 @@ inline fun InlineQueryResult.inlineQueryResultMpeg4GifOrThrow(): InlineQueryResu this as InlineQueryResultMpeg4Gif @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultMpeg4GifCached(block: (InlineQueryResultMpeg4GifCached) -> T) = inlineQueryResultMpeg4GifCachedOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultMpeg4GifCached(block: (InlineQueryResultMpeg4GifCached) -> T) = + inlineQueryResultMpeg4GifCachedOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedOrNull(): InlineQueryResultMpeg4GifCached? = @@ -1725,7 +1867,8 @@ inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedOrThrow(): InlineQue this as InlineQueryResultMpeg4GifCached @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultMpeg4GifCommon(block: (InlineQueryResultMpeg4GifCommon) -> T) = inlineQueryResultMpeg4GifCommonOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultMpeg4GifCommon(block: (InlineQueryResultMpeg4GifCommon) -> T) = + inlineQueryResultMpeg4GifCommonOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultMpeg4GifCommonOrNull(): InlineQueryResultMpeg4GifCommon? = @@ -1736,7 +1879,8 @@ inline fun InlineQueryResult.inlineQueryResultMpeg4GifCommonOrThrow(): InlineQue this as InlineQueryResultMpeg4GifCommon @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultPhoto(block: (InlineQueryResultPhoto) -> T) = inlineQueryResultPhotoOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultPhoto(block: (InlineQueryResultPhoto) -> T) = + inlineQueryResultPhotoOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultPhotoOrNull(): InlineQueryResultPhoto? = this as? InlineQueryResultPhoto @@ -1745,7 +1889,8 @@ inline fun InlineQueryResult.inlineQueryResultPhotoOrNull(): InlineQueryResultPh inline fun InlineQueryResult.inlineQueryResultPhotoOrThrow(): InlineQueryResultPhoto = this as InlineQueryResultPhoto @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultPhotoCached(block: (InlineQueryResultPhotoCached) -> T) = inlineQueryResultPhotoCachedOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultPhotoCached(block: (InlineQueryResultPhotoCached) -> T) = + inlineQueryResultPhotoCachedOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultPhotoCachedOrNull(): InlineQueryResultPhotoCached? = @@ -1756,7 +1901,8 @@ inline fun InlineQueryResult.inlineQueryResultPhotoCachedOrThrow(): InlineQueryR this as InlineQueryResultPhotoCached @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultPhotoCommon(block: (InlineQueryResultPhotoCommon) -> T) = inlineQueryResultPhotoCommonOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultPhotoCommon(block: (InlineQueryResultPhotoCommon) -> T) = + inlineQueryResultPhotoCommonOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultPhotoCommonOrNull(): InlineQueryResultPhotoCommon? = @@ -1767,7 +1913,8 @@ inline fun InlineQueryResult.inlineQueryResultPhotoCommonOrThrow(): InlineQueryR this as InlineQueryResultPhotoCommon @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVideo(block: (InlineQueryResultVideo) -> T) = inlineQueryResultVideoOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultVideo(block: (InlineQueryResultVideo) -> T) = + inlineQueryResultVideoOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultVideoOrNull(): InlineQueryResultVideo? = this as? InlineQueryResultVideo @@ -1776,7 +1923,8 @@ inline fun InlineQueryResult.inlineQueryResultVideoOrNull(): InlineQueryResultVi inline fun InlineQueryResult.inlineQueryResultVideoOrThrow(): InlineQueryResultVideo = this as InlineQueryResultVideo @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVideoCached(block: (InlineQueryResultVideoCached) -> T) = inlineQueryResultVideoCachedOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultVideoCached(block: (InlineQueryResultVideoCached) -> T) = + inlineQueryResultVideoCachedOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultVideoCachedOrNull(): InlineQueryResultVideoCached? = @@ -1787,7 +1935,8 @@ inline fun InlineQueryResult.inlineQueryResultVideoCachedOrThrow(): InlineQueryR this as InlineQueryResultVideoCached @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVideoCommon(block: (InlineQueryResultVideoCommon) -> T) = inlineQueryResultVideoCommonOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultVideoCommon(block: (InlineQueryResultVideoCommon) -> T) = + inlineQueryResultVideoCommonOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultVideoCommonOrNull(): InlineQueryResultVideoCommon? = @@ -1798,7 +1947,8 @@ inline fun InlineQueryResult.inlineQueryResultVideoCommonOrThrow(): InlineQueryR this as InlineQueryResultVideoCommon @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVoice(block: (InlineQueryResultVoice) -> T) = inlineQueryResultVoiceOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultVoice(block: (InlineQueryResultVoice) -> T) = + inlineQueryResultVoiceOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultVoiceOrNull(): InlineQueryResultVoice? = this as? InlineQueryResultVoice @@ -1807,7 +1957,8 @@ inline fun InlineQueryResult.inlineQueryResultVoiceOrNull(): InlineQueryResultVo inline fun InlineQueryResult.inlineQueryResultVoiceOrThrow(): InlineQueryResultVoice = this as InlineQueryResultVoice @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVoiceCached(block: (InlineQueryResultVoiceCached) -> T) = inlineQueryResultVoiceCachedOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultVoiceCached(block: (InlineQueryResultVoiceCached) -> T) = + inlineQueryResultVoiceCachedOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultVoiceCachedOrNull(): InlineQueryResultVoiceCached? = @@ -1818,7 +1969,8 @@ inline fun InlineQueryResult.inlineQueryResultVoiceCachedOrThrow(): InlineQueryR this as InlineQueryResultVoiceCached @PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVoiceCommon(block: (InlineQueryResultVoiceCommon) -> T) = inlineQueryResultVoiceCommonOrNull() ?.let(block) +inline fun InlineQueryResult.ifInlineQueryResultVoiceCommon(block: (InlineQueryResultVoiceCommon) -> T) = + inlineQueryResultVoiceCommonOrNull()?.let(block) @PreviewFeature inline fun InlineQueryResult.inlineQueryResultVoiceCommonOrNull(): InlineQueryResultVoiceCommon? = @@ -1829,7 +1981,7 @@ inline fun InlineQueryResult.inlineQueryResultVoiceCommonOrThrow(): InlineQueryR this as InlineQueryResultVoiceCommon @PreviewFeature -inline fun ChatMember.ifOwnerChatMember(block: (OwnerChatMember) -> T) = ownerChatMemberOrNull() ?.let(block) +inline fun ChatMember.ifOwnerChatMember(block: (OwnerChatMember) -> T) = ownerChatMemberOrNull()?.let(block) @PreviewFeature inline fun ChatMember.ownerChatMemberOrNull(): OwnerChatMember? = this as? OwnerChatMember @@ -1838,7 +1990,7 @@ inline fun ChatMember.ownerChatMemberOrNull(): OwnerChatMember? = this as? Owner inline fun ChatMember.ownerChatMemberOrThrow(): OwnerChatMember = this as OwnerChatMember @PreviewFeature -inline fun ChatMember.ifKickedChatMember(block: (KickedChatMember) -> T) = kickedChatMemberOrNull() ?.let(block) +inline fun ChatMember.ifKickedChatMember(block: (KickedChatMember) -> T) = kickedChatMemberOrNull()?.let(block) @PreviewFeature inline fun ChatMember.kickedChatMemberOrNull(): KickedChatMember? = this as? KickedChatMember @@ -1847,7 +1999,7 @@ inline fun ChatMember.kickedChatMemberOrNull(): KickedChatMember? = this as? Kic inline fun ChatMember.kickedChatMemberOrThrow(): KickedChatMember = this as KickedChatMember @PreviewFeature -inline fun ChatMember.ifLeftChatMember(block: (LeftChatMember) -> T) = leftChatMemberOrNull() ?.let(block) +inline fun ChatMember.ifLeftChatMember(block: (LeftChatMember) -> T) = leftChatMemberOrNull()?.let(block) @PreviewFeature inline fun ChatMember.leftChatMemberOrNull(): LeftChatMember? = this as? LeftChatMember @@ -1856,7 +2008,7 @@ inline fun ChatMember.leftChatMemberOrNull(): LeftChatMember? = this as? LeftCha inline fun ChatMember.leftChatMemberOrThrow(): LeftChatMember = this as LeftChatMember @PreviewFeature -inline fun ChatMember.ifMemberChatMember(block: (MemberChatMember) -> T) = memberChatMemberOrNull() ?.let(block) +inline fun ChatMember.ifMemberChatMember(block: (MemberChatMember) -> T) = memberChatMemberOrNull()?.let(block) @PreviewFeature inline fun ChatMember.memberChatMemberOrNull(): MemberChatMember? = this as? MemberChatMember @@ -1865,7 +2017,8 @@ inline fun ChatMember.memberChatMemberOrNull(): MemberChatMember? = this as? Mem inline fun ChatMember.memberChatMemberOrThrow(): MemberChatMember = this as MemberChatMember @PreviewFeature -inline fun ChatMember.ifRestrictedChatMember(block: (RestrictedChatMember) -> T) = restrictedChatMemberOrNull() ?.let(block) +inline fun ChatMember.ifRestrictedChatMember(block: (RestrictedChatMember) -> T) = + restrictedChatMemberOrNull()?.let(block) @PreviewFeature inline fun ChatMember.restrictedChatMemberOrNull(): RestrictedChatMember? = this as? RestrictedChatMember @@ -1874,7 +2027,8 @@ inline fun ChatMember.restrictedChatMemberOrNull(): RestrictedChatMember? = this inline fun ChatMember.restrictedChatMemberOrThrow(): RestrictedChatMember = this as RestrictedChatMember @PreviewFeature -inline fun ChatMember.ifAdministratorChatMember(block: (AdministratorChatMember) -> T) = administratorChatMemberOrNull() ?.let(block) +inline fun ChatMember.ifAdministratorChatMember(block: (AdministratorChatMember) -> T) = + administratorChatMemberOrNull()?.let(block) @PreviewFeature inline fun ChatMember.administratorChatMemberOrNull(): AdministratorChatMember? = this as? AdministratorChatMember @@ -1883,7 +2037,7 @@ inline fun ChatMember.administratorChatMemberOrNull(): AdministratorChatMember? inline fun ChatMember.administratorChatMemberOrThrow(): AdministratorChatMember = this as AdministratorChatMember @PreviewFeature -inline fun ChatMember.ifBannedChatMember(block: (BannedChatMember) -> T) = bannedChatMemberOrNull() ?.let(block) +inline fun ChatMember.ifBannedChatMember(block: (BannedChatMember) -> T) = bannedChatMemberOrNull()?.let(block) @PreviewFeature inline fun ChatMember.bannedChatMemberOrNull(): BannedChatMember? = this as? BannedChatMember @@ -1892,7 +2046,8 @@ inline fun ChatMember.bannedChatMemberOrNull(): BannedChatMember? = this as? Ban inline fun ChatMember.bannedChatMemberOrThrow(): BannedChatMember = this as BannedChatMember @PreviewFeature -inline fun ChatMember.ifSpecialRightsChatMember(block: (SpecialRightsChatMember) -> T) = specialRightsChatMemberOrNull() ?.let(block) +inline fun ChatMember.ifSpecialRightsChatMember(block: (SpecialRightsChatMember) -> T) = + specialRightsChatMemberOrNull()?.let(block) @PreviewFeature inline fun ChatMember.specialRightsChatMemberOrNull(): SpecialRightsChatMember? = this as? SpecialRightsChatMember @@ -1901,7 +2056,8 @@ inline fun ChatMember.specialRightsChatMemberOrNull(): SpecialRightsChatMember? inline fun ChatMember.specialRightsChatMemberOrThrow(): SpecialRightsChatMember = this as SpecialRightsChatMember @PreviewFeature -inline fun TelegramMedia.ifAudioMediaGroupMemberTelegramMedia(block: (AudioMediaGroupMemberTelegramMedia) -> T) = audioMediaGroupMemberTelegramMediaOrNull() ?.let(block) +inline fun TelegramMedia.ifAudioMediaGroupMemberTelegramMedia(block: (AudioMediaGroupMemberTelegramMedia) -> T) = + audioMediaGroupMemberTelegramMediaOrNull()?.let(block) @PreviewFeature inline fun TelegramMedia.audioMediaGroupMemberTelegramMediaOrNull(): AudioMediaGroupMemberTelegramMedia? = @@ -1912,7 +2068,8 @@ inline fun TelegramMedia.audioMediaGroupMemberTelegramMediaOrThrow(): AudioMedia this as AudioMediaGroupMemberTelegramMedia @PreviewFeature -inline fun TelegramMedia.ifDocumentMediaGroupMemberTelegramMedia(block: (DocumentMediaGroupMemberTelegramMedia) -> T) = documentMediaGroupMemberTelegramMediaOrNull() ?.let(block) +inline fun TelegramMedia.ifDocumentMediaGroupMemberTelegramMedia(block: (DocumentMediaGroupMemberTelegramMedia) -> T) = + documentMediaGroupMemberTelegramMediaOrNull()?.let(block) @PreviewFeature inline fun TelegramMedia.documentMediaGroupMemberTelegramMediaOrNull(): DocumentMediaGroupMemberTelegramMedia? = @@ -1923,7 +2080,8 @@ inline fun TelegramMedia.documentMediaGroupMemberTelegramMediaOrThrow(): Documen this as DocumentMediaGroupMemberTelegramMedia @PreviewFeature -inline fun TelegramMedia.ifDuratedTelegramMedia(block: (DuratedTelegramMedia) -> T) = duratedTelegramMediaOrNull() ?.let(block) +inline fun TelegramMedia.ifDuratedTelegramMedia(block: (DuratedTelegramMedia) -> T) = + duratedTelegramMediaOrNull()?.let(block) @PreviewFeature inline fun TelegramMedia.duratedTelegramMediaOrNull(): DuratedTelegramMedia? = this as? DuratedTelegramMedia @@ -1932,7 +2090,8 @@ inline fun TelegramMedia.duratedTelegramMediaOrNull(): DuratedTelegramMedia? = t inline fun TelegramMedia.duratedTelegramMediaOrThrow(): DuratedTelegramMedia = this as DuratedTelegramMedia @PreviewFeature -inline fun TelegramMedia.ifTelegramMediaAnimation(block: (TelegramMediaAnimation) -> T) = telegramMediaAnimationOrNull() ?.let(block) +inline fun TelegramMedia.ifTelegramMediaAnimation(block: (TelegramMediaAnimation) -> T) = + telegramMediaAnimationOrNull()?.let(block) @PreviewFeature inline fun TelegramMedia.telegramMediaAnimationOrNull(): TelegramMediaAnimation? = this as? TelegramMediaAnimation @@ -1941,7 +2100,8 @@ inline fun TelegramMedia.telegramMediaAnimationOrNull(): TelegramMediaAnimation? inline fun TelegramMedia.telegramMediaAnimationOrThrow(): TelegramMediaAnimation = this as TelegramMediaAnimation @PreviewFeature -inline fun TelegramMedia.ifTelegramMediaAudio(block: (TelegramMediaAudio) -> T) = telegramMediaAudioOrNull() ?.let(block) +inline fun TelegramMedia.ifTelegramMediaAudio(block: (TelegramMediaAudio) -> T) = + telegramMediaAudioOrNull()?.let(block) @PreviewFeature inline fun TelegramMedia.telegramMediaAudioOrNull(): TelegramMediaAudio? = this as? TelegramMediaAudio @@ -1950,7 +2110,8 @@ inline fun TelegramMedia.telegramMediaAudioOrNull(): TelegramMediaAudio? = this inline fun TelegramMedia.telegramMediaAudioOrThrow(): TelegramMediaAudio = this as TelegramMediaAudio @PreviewFeature -inline fun TelegramMedia.ifTelegramMediaDocument(block: (TelegramMediaDocument) -> T) = telegramMediaDocumentOrNull() ?.let(block) +inline fun TelegramMedia.ifTelegramMediaDocument(block: (TelegramMediaDocument) -> T) = + telegramMediaDocumentOrNull()?.let(block) @PreviewFeature inline fun TelegramMedia.telegramMediaDocumentOrNull(): TelegramMediaDocument? = this as? TelegramMediaDocument @@ -1959,7 +2120,8 @@ inline fun TelegramMedia.telegramMediaDocumentOrNull(): TelegramMediaDocument? = inline fun TelegramMedia.telegramMediaDocumentOrThrow(): TelegramMediaDocument = this as TelegramMediaDocument @PreviewFeature -inline fun TelegramMedia.ifTelegramMediaPhoto(block: (TelegramMediaPhoto) -> T) = telegramMediaPhotoOrNull() ?.let(block) +inline fun TelegramMedia.ifTelegramMediaPhoto(block: (TelegramMediaPhoto) -> T) = + telegramMediaPhotoOrNull()?.let(block) @PreviewFeature inline fun TelegramMedia.telegramMediaPhotoOrNull(): TelegramMediaPhoto? = this as? TelegramMediaPhoto @@ -1968,7 +2130,8 @@ inline fun TelegramMedia.telegramMediaPhotoOrNull(): TelegramMediaPhoto? = this inline fun TelegramMedia.telegramMediaPhotoOrThrow(): TelegramMediaPhoto = this as TelegramMediaPhoto @PreviewFeature -inline fun TelegramMedia.ifTelegramMediaVideo(block: (TelegramMediaVideo) -> T) = telegramMediaVideoOrNull() ?.let(block) +inline fun TelegramMedia.ifTelegramMediaVideo(block: (TelegramMediaVideo) -> T) = + telegramMediaVideoOrNull()?.let(block) @PreviewFeature inline fun TelegramMedia.telegramMediaVideoOrNull(): TelegramMediaVideo? = this as? TelegramMediaVideo @@ -1977,17 +2140,20 @@ inline fun TelegramMedia.telegramMediaVideoOrNull(): TelegramMediaVideo? = this inline fun TelegramMedia.telegramMediaVideoOrThrow(): TelegramMediaVideo = this as TelegramMediaVideo @PreviewFeature -inline fun TelegramMedia.ifMediaGroupMemberTelegramMedia(block: (MediaGroupMemberTelegramMedia) -> T) = mediaGroupMemberTelegramMediaOrNull() ?.let(block) +inline fun TelegramMedia.ifMediaGroupMemberTelegramMedia(block: (MediaGroupMemberTelegramMedia) -> T) = + mediaGroupMemberTelegramMediaOrNull()?.let(block) @PreviewFeature -inline fun TelegramMedia.mediaGroupMemberTelegramMediaOrNull(): MediaGroupMemberTelegramMedia? = this as? MediaGroupMemberTelegramMedia +inline fun TelegramMedia.mediaGroupMemberTelegramMediaOrNull(): MediaGroupMemberTelegramMedia? = + this as? MediaGroupMemberTelegramMedia @PreviewFeature inline fun TelegramMedia.mediaGroupMemberTelegramMediaOrThrow(): MediaGroupMemberTelegramMedia = this as MediaGroupMemberTelegramMedia @PreviewFeature -inline fun TelegramMedia.ifSizedTelegramMedia(block: (SizedTelegramMedia) -> T) = sizedTelegramMediaOrNull() ?.let(block) +inline fun TelegramMedia.ifSizedTelegramMedia(block: (SizedTelegramMedia) -> T) = + sizedTelegramMediaOrNull()?.let(block) @PreviewFeature inline fun TelegramMedia.sizedTelegramMediaOrNull(): SizedTelegramMedia? = this as? SizedTelegramMedia @@ -1996,7 +2162,8 @@ inline fun TelegramMedia.sizedTelegramMediaOrNull(): SizedTelegramMedia? = this inline fun TelegramMedia.sizedTelegramMediaOrThrow(): SizedTelegramMedia = this as SizedTelegramMedia @PreviewFeature -inline fun TelegramMedia.ifThumbedTelegramMedia(block: (ThumbedTelegramMedia) -> T) = thumbedTelegramMediaOrNull() ?.let(block) +inline fun TelegramMedia.ifThumbedTelegramMedia(block: (ThumbedTelegramMedia) -> T) = + thumbedTelegramMediaOrNull()?.let(block) @PreviewFeature inline fun TelegramMedia.thumbedTelegramMediaOrNull(): ThumbedTelegramMedia? = this as? ThumbedTelegramMedia @@ -2005,7 +2172,8 @@ inline fun TelegramMedia.thumbedTelegramMediaOrNull(): ThumbedTelegramMedia? = t inline fun TelegramMedia.thumbedTelegramMediaOrThrow(): ThumbedTelegramMedia = this as ThumbedTelegramMedia @PreviewFeature -inline fun TelegramMedia.ifTitledTelegramMedia(block: (TitledTelegramMedia) -> T) = titledTelegramMediaOrNull() ?.let(block) +inline fun TelegramMedia.ifTitledTelegramMedia(block: (TitledTelegramMedia) -> T) = + titledTelegramMediaOrNull()?.let(block) @PreviewFeature inline fun TelegramMedia.titledTelegramMediaOrNull(): TitledTelegramMedia? = this as? TitledTelegramMedia @@ -2014,7 +2182,8 @@ inline fun TelegramMedia.titledTelegramMediaOrNull(): TitledTelegramMedia? = thi inline fun TelegramMedia.titledTelegramMediaOrThrow(): TitledTelegramMedia = this as TitledTelegramMedia @PreviewFeature -inline fun TelegramMedia.ifVisualMediaGroupMemberTelegramMedia(block: (VisualMediaGroupMemberTelegramMedia) -> T) = visualMediaGroupMemberTelegramMediaOrNull() ?.let(block) +inline fun TelegramMedia.ifVisualMediaGroupMemberTelegramMedia(block: (VisualMediaGroupMemberTelegramMedia) -> T) = + visualMediaGroupMemberTelegramMediaOrNull()?.let(block) @PreviewFeature inline fun TelegramMedia.visualMediaGroupMemberTelegramMediaOrNull(): VisualMediaGroupMemberTelegramMedia? = @@ -2025,7 +2194,7 @@ inline fun TelegramMedia.visualMediaGroupMemberTelegramMediaOrThrow(): VisualMed this as VisualMediaGroupMemberTelegramMedia @PreviewFeature -inline fun Update.ifCallbackQueryUpdate(block: (CallbackQueryUpdate) -> T) = callbackQueryUpdateOrNull() ?.let(block) +inline fun Update.ifCallbackQueryUpdate(block: (CallbackQueryUpdate) -> T) = callbackQueryUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.callbackQueryUpdateOrNull(): CallbackQueryUpdate? = this as? CallbackQueryUpdate @@ -2034,7 +2203,7 @@ inline fun Update.callbackQueryUpdateOrNull(): CallbackQueryUpdate? = this as? C inline fun Update.callbackQueryUpdateOrThrow(): CallbackQueryUpdate = this as CallbackQueryUpdate @PreviewFeature -inline fun Update.ifChannelPostUpdate(block: (ChannelPostUpdate) -> T) = channelPostUpdateOrNull() ?.let(block) +inline fun Update.ifChannelPostUpdate(block: (ChannelPostUpdate) -> T) = channelPostUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.channelPostUpdateOrNull(): ChannelPostUpdate? = this as? ChannelPostUpdate @@ -2043,7 +2212,8 @@ inline fun Update.channelPostUpdateOrNull(): ChannelPostUpdate? = this as? Chann inline fun Update.channelPostUpdateOrThrow(): ChannelPostUpdate = this as ChannelPostUpdate @PreviewFeature -inline fun Update.ifChosenInlineResultUpdate(block: (ChosenInlineResultUpdate) -> T) = chosenInlineResultUpdateOrNull() ?.let(block) +inline fun Update.ifChosenInlineResultUpdate(block: (ChosenInlineResultUpdate) -> T) = + chosenInlineResultUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.chosenInlineResultUpdateOrNull(): ChosenInlineResultUpdate? = this as? ChosenInlineResultUpdate @@ -2052,7 +2222,8 @@ inline fun Update.chosenInlineResultUpdateOrNull(): ChosenInlineResultUpdate? = inline fun Update.chosenInlineResultUpdateOrThrow(): ChosenInlineResultUpdate = this as ChosenInlineResultUpdate @PreviewFeature -inline fun Update.ifEditChannelPostUpdate(block: (EditChannelPostUpdate) -> T) = editChannelPostUpdateOrNull() ?.let(block) +inline fun Update.ifEditChannelPostUpdate(block: (EditChannelPostUpdate) -> T) = + editChannelPostUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.editChannelPostUpdateOrNull(): EditChannelPostUpdate? = this as? EditChannelPostUpdate @@ -2061,7 +2232,7 @@ inline fun Update.editChannelPostUpdateOrNull(): EditChannelPostUpdate? = this a inline fun Update.editChannelPostUpdateOrThrow(): EditChannelPostUpdate = this as EditChannelPostUpdate @PreviewFeature -inline fun Update.ifEditMessageUpdate(block: (EditMessageUpdate) -> T) = editMessageUpdateOrNull() ?.let(block) +inline fun Update.ifEditMessageUpdate(block: (EditMessageUpdate) -> T) = editMessageUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.editMessageUpdateOrNull(): EditMessageUpdate? = this as? EditMessageUpdate @@ -2070,7 +2241,7 @@ inline fun Update.editMessageUpdateOrNull(): EditMessageUpdate? = this as? EditM inline fun Update.editMessageUpdateOrThrow(): EditMessageUpdate = this as EditMessageUpdate @PreviewFeature -inline fun Update.ifInlineQueryUpdate(block: (InlineQueryUpdate) -> T) = inlineQueryUpdateOrNull() ?.let(block) +inline fun Update.ifInlineQueryUpdate(block: (InlineQueryUpdate) -> T) = inlineQueryUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.inlineQueryUpdateOrNull(): InlineQueryUpdate? = this as? InlineQueryUpdate @@ -2079,17 +2250,20 @@ inline fun Update.inlineQueryUpdateOrNull(): InlineQueryUpdate? = this as? Inlin inline fun Update.inlineQueryUpdateOrThrow(): InlineQueryUpdate = this as InlineQueryUpdate @PreviewFeature -inline fun Update.ifChannelPostMediaGroupUpdate(block: (ChannelPostMediaGroupUpdate) -> T) = channelPostMediaGroupUpdateOrNull() ?.let(block) +inline fun Update.ifChannelPostMediaGroupUpdate(block: (ChannelPostMediaGroupUpdate) -> T) = + channelPostMediaGroupUpdateOrNull()?.let(block) @PreviewFeature -inline fun Update.channelPostMediaGroupUpdateOrNull(): ChannelPostMediaGroupUpdate? = this as? ChannelPostMediaGroupUpdate +inline fun Update.channelPostMediaGroupUpdateOrNull(): ChannelPostMediaGroupUpdate? = + this as? ChannelPostMediaGroupUpdate @PreviewFeature inline fun Update.channelPostMediaGroupUpdateOrThrow(): ChannelPostMediaGroupUpdate = this as ChannelPostMediaGroupUpdate @PreviewFeature -inline fun Update.ifEditChannelPostMediaGroupUpdate(block: (EditChannelPostMediaGroupUpdate) -> T) = editChannelPostMediaGroupUpdateOrNull() ?.let(block) +inline fun Update.ifEditChannelPostMediaGroupUpdate(block: (EditChannelPostMediaGroupUpdate) -> T) = + editChannelPostMediaGroupUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.editChannelPostMediaGroupUpdateOrNull(): EditChannelPostMediaGroupUpdate? = @@ -2100,7 +2274,8 @@ inline fun Update.editChannelPostMediaGroupUpdateOrThrow(): EditChannelPostMedia this as EditChannelPostMediaGroupUpdate @PreviewFeature -inline fun Update.ifEditMediaGroupUpdate(block: (EditMediaGroupUpdate) -> T) = editMediaGroupUpdateOrNull() ?.let(block) +inline fun Update.ifEditMediaGroupUpdate(block: (EditMediaGroupUpdate) -> T) = + editMediaGroupUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.editMediaGroupUpdateOrNull(): EditMediaGroupUpdate? = this as? EditMediaGroupUpdate @@ -2109,17 +2284,19 @@ inline fun Update.editMediaGroupUpdateOrNull(): EditMediaGroupUpdate? = this as? inline fun Update.editMediaGroupUpdateOrThrow(): EditMediaGroupUpdate = this as EditMediaGroupUpdate @PreviewFeature -inline fun Update.ifEditMessageMediaGroupUpdate(block: (EditMessageMediaGroupUpdate) -> T) = editMessageMediaGroupUpdateOrNull() ?.let(block) +inline fun Update.ifEditMessageMediaGroupUpdate(block: (EditMessageMediaGroupUpdate) -> T) = + editMessageMediaGroupUpdateOrNull()?.let(block) @PreviewFeature -inline fun Update.editMessageMediaGroupUpdateOrNull(): EditMessageMediaGroupUpdate? = this as? EditMessageMediaGroupUpdate +inline fun Update.editMessageMediaGroupUpdateOrNull(): EditMessageMediaGroupUpdate? = + this as? EditMessageMediaGroupUpdate @PreviewFeature inline fun Update.editMessageMediaGroupUpdateOrThrow(): EditMessageMediaGroupUpdate = this as EditMessageMediaGroupUpdate @PreviewFeature -inline fun Update.ifMediaGroupUpdate(block: (MediaGroupUpdate) -> T) = mediaGroupUpdateOrNull() ?.let(block) +inline fun Update.ifMediaGroupUpdate(block: (MediaGroupUpdate) -> T) = mediaGroupUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.mediaGroupUpdateOrNull(): MediaGroupUpdate? = this as? MediaGroupUpdate @@ -2128,7 +2305,8 @@ inline fun Update.mediaGroupUpdateOrNull(): MediaGroupUpdate? = this as? MediaGr inline fun Update.mediaGroupUpdateOrThrow(): MediaGroupUpdate = this as MediaGroupUpdate @PreviewFeature -inline fun Update.ifMessageMediaGroupUpdate(block: (MessageMediaGroupUpdate) -> T) = messageMediaGroupUpdateOrNull() ?.let(block) +inline fun Update.ifMessageMediaGroupUpdate(block: (MessageMediaGroupUpdate) -> T) = + messageMediaGroupUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.messageMediaGroupUpdateOrNull(): MessageMediaGroupUpdate? = this as? MessageMediaGroupUpdate @@ -2137,7 +2315,8 @@ inline fun Update.messageMediaGroupUpdateOrNull(): MessageMediaGroupUpdate? = th inline fun Update.messageMediaGroupUpdateOrThrow(): MessageMediaGroupUpdate = this as MessageMediaGroupUpdate @PreviewFeature -inline fun Update.ifSentMediaGroupUpdate(block: (SentMediaGroupUpdate) -> T) = sentMediaGroupUpdateOrNull() ?.let(block) +inline fun Update.ifSentMediaGroupUpdate(block: (SentMediaGroupUpdate) -> T) = + sentMediaGroupUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.sentMediaGroupUpdateOrNull(): SentMediaGroupUpdate? = this as? SentMediaGroupUpdate @@ -2146,7 +2325,7 @@ inline fun Update.sentMediaGroupUpdateOrNull(): SentMediaGroupUpdate? = this as? inline fun Update.sentMediaGroupUpdateOrThrow(): SentMediaGroupUpdate = this as SentMediaGroupUpdate @PreviewFeature -inline fun Update.ifMessageUpdate(block: (MessageUpdate) -> T) = messageUpdateOrNull() ?.let(block) +inline fun Update.ifMessageUpdate(block: (MessageUpdate) -> T) = messageUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.messageUpdateOrNull(): MessageUpdate? = this as? MessageUpdate @@ -2155,7 +2334,7 @@ inline fun Update.messageUpdateOrNull(): MessageUpdate? = this as? MessageUpdate inline fun Update.messageUpdateOrThrow(): MessageUpdate = this as MessageUpdate @PreviewFeature -inline fun Update.ifPollAnswerUpdate(block: (PollAnswerUpdate) -> T) = pollAnswerUpdateOrNull() ?.let(block) +inline fun Update.ifPollAnswerUpdate(block: (PollAnswerUpdate) -> T) = pollAnswerUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.pollAnswerUpdateOrNull(): PollAnswerUpdate? = this as? PollAnswerUpdate @@ -2164,7 +2343,7 @@ inline fun Update.pollAnswerUpdateOrNull(): PollAnswerUpdate? = this as? PollAns inline fun Update.pollAnswerUpdateOrThrow(): PollAnswerUpdate = this as PollAnswerUpdate @PreviewFeature -inline fun Update.ifPollUpdate(block: (PollUpdate) -> T) = pollUpdateOrNull() ?.let(block) +inline fun Update.ifPollUpdate(block: (PollUpdate) -> T) = pollUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.pollUpdateOrNull(): PollUpdate? = this as? PollUpdate @@ -2173,7 +2352,8 @@ inline fun Update.pollUpdateOrNull(): PollUpdate? = this as? PollUpdate inline fun Update.pollUpdateOrThrow(): PollUpdate = this as PollUpdate @PreviewFeature -inline fun Update.ifPreCheckoutQueryUpdate(block: (PreCheckoutQueryUpdate) -> T) = preCheckoutQueryUpdateOrNull() ?.let(block) +inline fun Update.ifPreCheckoutQueryUpdate(block: (PreCheckoutQueryUpdate) -> T) = + preCheckoutQueryUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.preCheckoutQueryUpdateOrNull(): PreCheckoutQueryUpdate? = this as? PreCheckoutQueryUpdate @@ -2182,7 +2362,7 @@ inline fun Update.preCheckoutQueryUpdateOrNull(): PreCheckoutQueryUpdate? = this inline fun Update.preCheckoutQueryUpdateOrThrow(): PreCheckoutQueryUpdate = this as PreCheckoutQueryUpdate @PreviewFeature -inline fun Update.ifShippingQueryUpdate(block: (ShippingQueryUpdate) -> T) = shippingQueryUpdateOrNull() ?.let(block) +inline fun Update.ifShippingQueryUpdate(block: (ShippingQueryUpdate) -> T) = shippingQueryUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.shippingQueryUpdateOrNull(): ShippingQueryUpdate? = this as? ShippingQueryUpdate @@ -2191,7 +2371,8 @@ inline fun Update.shippingQueryUpdateOrNull(): ShippingQueryUpdate? = this as? S inline fun Update.shippingQueryUpdateOrThrow(): ShippingQueryUpdate = this as ShippingQueryUpdate @PreviewFeature -inline fun Update.ifBaseEditMessageUpdate(block: (BaseEditMessageUpdate) -> T) = baseEditMessageUpdateOrNull() ?.let(block) +inline fun Update.ifBaseEditMessageUpdate(block: (BaseEditMessageUpdate) -> T) = + baseEditMessageUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.baseEditMessageUpdateOrNull(): BaseEditMessageUpdate? = this as? BaseEditMessageUpdate @@ -2200,7 +2381,7 @@ inline fun Update.baseEditMessageUpdateOrNull(): BaseEditMessageUpdate? = this a inline fun Update.baseEditMessageUpdateOrThrow(): BaseEditMessageUpdate = this as BaseEditMessageUpdate @PreviewFeature -inline fun Update.ifBaseMessageUpdate(block: (BaseMessageUpdate) -> T) = baseMessageUpdateOrNull() ?.let(block) +inline fun Update.ifBaseMessageUpdate(block: (BaseMessageUpdate) -> T) = baseMessageUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.baseMessageUpdateOrNull(): BaseMessageUpdate? = this as? BaseMessageUpdate @@ -2209,7 +2390,8 @@ inline fun Update.baseMessageUpdateOrNull(): BaseMessageUpdate? = this as? BaseM inline fun Update.baseMessageUpdateOrThrow(): BaseMessageUpdate = this as BaseMessageUpdate @PreviewFeature -inline fun Update.ifBaseSentMessageUpdate(block: (BaseSentMessageUpdate) -> T) = baseSentMessageUpdateOrNull() ?.let(block) +inline fun Update.ifBaseSentMessageUpdate(block: (BaseSentMessageUpdate) -> T) = + baseSentMessageUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.baseSentMessageUpdateOrNull(): BaseSentMessageUpdate? = this as? BaseSentMessageUpdate @@ -2218,7 +2400,7 @@ inline fun Update.baseSentMessageUpdateOrNull(): BaseSentMessageUpdate? = this a inline fun Update.baseSentMessageUpdateOrThrow(): BaseSentMessageUpdate = this as BaseSentMessageUpdate @PreviewFeature -inline fun Update.ifUnknownUpdate(block: (UnknownUpdate) -> T) = unknownUpdateOrNull() ?.let(block) +inline fun Update.ifUnknownUpdate(block: (UnknownUpdate) -> T) = unknownUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.unknownUpdateOrNull(): UnknownUpdate? = this as? UnknownUpdate @@ -2227,7 +2409,8 @@ inline fun Update.unknownUpdateOrNull(): UnknownUpdate? = this as? UnknownUpdate inline fun Update.unknownUpdateOrThrow(): UnknownUpdate = this as UnknownUpdate @PreviewFeature -inline fun Update.ifCommonChatMemberUpdatedUpdate(block: (CommonChatMemberUpdatedUpdate) -> T) = commonChatMemberUpdatedUpdateOrNull() ?.let(block) +inline fun Update.ifCommonChatMemberUpdatedUpdate(block: (CommonChatMemberUpdatedUpdate) -> T) = + commonChatMemberUpdatedUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.commonChatMemberUpdatedUpdateOrNull(): CommonChatMemberUpdatedUpdate? = @@ -2238,7 +2421,8 @@ inline fun Update.commonChatMemberUpdatedUpdateOrThrow(): CommonChatMemberUpdate this as CommonChatMemberUpdatedUpdate @PreviewFeature -inline fun Update.ifMyChatMemberUpdatedUpdate(block: (MyChatMemberUpdatedUpdate) -> T) = myChatMemberUpdatedUpdateOrNull() ?.let(block) +inline fun Update.ifMyChatMemberUpdatedUpdate(block: (MyChatMemberUpdatedUpdate) -> T) = + myChatMemberUpdatedUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.myChatMemberUpdatedUpdateOrNull(): MyChatMemberUpdatedUpdate? = this as? MyChatMemberUpdatedUpdate @@ -2247,7 +2431,8 @@ inline fun Update.myChatMemberUpdatedUpdateOrNull(): MyChatMemberUpdatedUpdate? inline fun Update.myChatMemberUpdatedUpdateOrThrow(): MyChatMemberUpdatedUpdate = this as MyChatMemberUpdatedUpdate @PreviewFeature -inline fun Update.ifChatMemberUpdatedUpdate(block: (ChatMemberUpdatedUpdate) -> T) = chatMemberUpdatedUpdateOrNull() ?.let(block) +inline fun Update.ifChatMemberUpdatedUpdate(block: (ChatMemberUpdatedUpdate) -> T) = + chatMemberUpdatedUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.chatMemberUpdatedUpdateOrNull(): ChatMemberUpdatedUpdate? = this as? ChatMemberUpdatedUpdate @@ -2256,7 +2441,8 @@ inline fun Update.chatMemberUpdatedUpdateOrNull(): ChatMemberUpdatedUpdate? = th inline fun Update.chatMemberUpdatedUpdateOrThrow(): ChatMemberUpdatedUpdate = this as ChatMemberUpdatedUpdate @PreviewFeature -inline fun Update.ifChatJoinRequestUpdate(block: (ChatJoinRequestUpdate) -> T) = chatJoinRequestUpdateOrNull() ?.let(block) +inline fun Update.ifChatJoinRequestUpdate(block: (ChatJoinRequestUpdate) -> T) = + chatJoinRequestUpdateOrNull()?.let(block) @PreviewFeature inline fun Update.chatJoinRequestUpdateOrNull(): ChatJoinRequestUpdate? = this as? ChatJoinRequestUpdate @@ -2265,7 +2451,7 @@ inline fun Update.chatJoinRequestUpdateOrNull(): ChatJoinRequestUpdate? = this a inline fun Update.chatJoinRequestUpdateOrThrow(): ChatJoinRequestUpdate = this as ChatJoinRequestUpdate @PreviewFeature -inline fun TelegramMediaFile.ifAnimationFile(block: (AnimationFile) -> T) = animationFileOrNull() ?.let(block) +inline fun TelegramMediaFile.ifAnimationFile(block: (AnimationFile) -> T) = animationFileOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.animationFileOrNull(): AnimationFile? = this as? AnimationFile @@ -2274,7 +2460,7 @@ inline fun TelegramMediaFile.animationFileOrNull(): AnimationFile? = this as? An inline fun TelegramMediaFile.animationFileOrThrow(): AnimationFile = this as AnimationFile @PreviewFeature -inline fun TelegramMediaFile.ifAudioFile(block: (AudioFile) -> T) = audioFileOrNull() ?.let(block) +inline fun TelegramMediaFile.ifAudioFile(block: (AudioFile) -> T) = audioFileOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.audioFileOrNull(): AudioFile? = this as? AudioFile @@ -2283,7 +2469,7 @@ inline fun TelegramMediaFile.audioFileOrNull(): AudioFile? = this as? AudioFile inline fun TelegramMediaFile.audioFileOrThrow(): AudioFile = this as AudioFile @PreviewFeature -inline fun TelegramMediaFile.ifDocumentFile(block: (DocumentFile) -> T) = documentFileOrNull() ?.let(block) +inline fun TelegramMediaFile.ifDocumentFile(block: (DocumentFile) -> T) = documentFileOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.documentFileOrNull(): DocumentFile? = this as? DocumentFile @@ -2292,7 +2478,7 @@ inline fun TelegramMediaFile.documentFileOrNull(): DocumentFile? = this as? Docu inline fun TelegramMediaFile.documentFileOrThrow(): DocumentFile = this as DocumentFile @PreviewFeature -inline fun TelegramMediaFile.ifFile(block: (File) -> T) = fileOrNull() ?.let(block) +inline fun TelegramMediaFile.ifFile(block: (File) -> T) = fileOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.fileOrNull(): File? = this as? File @@ -2301,7 +2487,7 @@ inline fun TelegramMediaFile.fileOrNull(): File? = this as? File inline fun TelegramMediaFile.fileOrThrow(): File = this as File @PreviewFeature -inline fun TelegramMediaFile.ifPathedFile(block: (PathedFile) -> T) = pathedFileOrNull() ?.let(block) +inline fun TelegramMediaFile.ifPathedFile(block: (PathedFile) -> T) = pathedFileOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.pathedFileOrNull(): PathedFile? = this as? PathedFile @@ -2310,7 +2496,7 @@ inline fun TelegramMediaFile.pathedFileOrNull(): PathedFile? = this as? PathedFi inline fun TelegramMediaFile.pathedFileOrThrow(): PathedFile = this as PathedFile @PreviewFeature -inline fun TelegramMediaFile.ifPhotoSize(block: (PhotoSize) -> T) = photoSizeOrNull() ?.let(block) +inline fun TelegramMediaFile.ifPhotoSize(block: (PhotoSize) -> T) = photoSizeOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.photoSizeOrNull(): PhotoSize? = this as? PhotoSize @@ -2319,7 +2505,7 @@ inline fun TelegramMediaFile.photoSizeOrNull(): PhotoSize? = this as? PhotoSize inline fun TelegramMediaFile.photoSizeOrThrow(): PhotoSize = this as PhotoSize @PreviewFeature -inline fun TelegramMediaFile.ifSticker(block: (Sticker) -> T) = stickerOrNull() ?.let(block) +inline fun TelegramMediaFile.ifSticker(block: (Sticker) -> T) = stickerOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.stickerOrNull(): Sticker? = this as? Sticker @@ -2328,7 +2514,7 @@ inline fun TelegramMediaFile.stickerOrNull(): Sticker? = this as? Sticker inline fun TelegramMediaFile.stickerOrThrow(): Sticker = this as Sticker @PreviewFeature -inline fun TelegramMediaFile.ifSimpleSticker(block: (SimpleSticker) -> T) = simpleStickerOrNull() ?.let(block) +inline fun TelegramMediaFile.ifSimpleSticker(block: (SimpleSticker) -> T) = simpleStickerOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.simpleStickerOrNull(): SimpleSticker? = this as? SimpleSticker @@ -2337,7 +2523,7 @@ inline fun TelegramMediaFile.simpleStickerOrNull(): SimpleSticker? = this as? Si inline fun TelegramMediaFile.simpleStickerOrThrow(): SimpleSticker = this as SimpleSticker @PreviewFeature -inline fun TelegramMediaFile.ifAnimatedSticker(block: (AnimatedSticker) -> T) = animatedStickerOrNull() ?.let(block) +inline fun TelegramMediaFile.ifAnimatedSticker(block: (AnimatedSticker) -> T) = animatedStickerOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.animatedStickerOrNull(): AnimatedSticker? = this as? AnimatedSticker @@ -2346,7 +2532,7 @@ inline fun TelegramMediaFile.animatedStickerOrNull(): AnimatedSticker? = this as inline fun TelegramMediaFile.animatedStickerOrThrow(): AnimatedSticker = this as AnimatedSticker @PreviewFeature -inline fun TelegramMediaFile.ifVideoSticker(block: (VideoSticker) -> T) = videoStickerOrNull() ?.let(block) +inline fun TelegramMediaFile.ifVideoSticker(block: (VideoSticker) -> T) = videoStickerOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.videoStickerOrNull(): VideoSticker? = this as? VideoSticker @@ -2355,7 +2541,7 @@ inline fun TelegramMediaFile.videoStickerOrNull(): VideoSticker? = this as? Vide inline fun TelegramMediaFile.videoStickerOrThrow(): VideoSticker = this as VideoSticker @PreviewFeature -inline fun TelegramMediaFile.ifVideoFile(block: (VideoFile) -> T) = videoFileOrNull() ?.let(block) +inline fun TelegramMediaFile.ifVideoFile(block: (VideoFile) -> T) = videoFileOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.videoFileOrNull(): VideoFile? = this as? VideoFile @@ -2364,7 +2550,7 @@ inline fun TelegramMediaFile.videoFileOrNull(): VideoFile? = this as? VideoFile inline fun TelegramMediaFile.videoFileOrThrow(): VideoFile = this as VideoFile @PreviewFeature -inline fun TelegramMediaFile.ifVideoNoteFile(block: (VideoNoteFile) -> T) = videoNoteFileOrNull() ?.let(block) +inline fun TelegramMediaFile.ifVideoNoteFile(block: (VideoNoteFile) -> T) = videoNoteFileOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.videoNoteFileOrNull(): VideoNoteFile? = this as? VideoNoteFile @@ -2373,7 +2559,7 @@ inline fun TelegramMediaFile.videoNoteFileOrNull(): VideoNoteFile? = this as? Vi inline fun TelegramMediaFile.videoNoteFileOrThrow(): VideoNoteFile = this as VideoNoteFile @PreviewFeature -inline fun TelegramMediaFile.ifVoiceFile(block: (VoiceFile) -> T) = voiceFileOrNull() ?.let(block) +inline fun TelegramMediaFile.ifVoiceFile(block: (VoiceFile) -> T) = voiceFileOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.voiceFileOrNull(): VoiceFile? = this as? VoiceFile @@ -2382,7 +2568,7 @@ inline fun TelegramMediaFile.voiceFileOrNull(): VoiceFile? = this as? VoiceFile inline fun TelegramMediaFile.voiceFileOrThrow(): VoiceFile = this as VoiceFile @PreviewFeature -inline fun TelegramMediaFile.ifMimedMediaFile(block: (MimedMediaFile) -> T) = mimedMediaFileOrNull() ?.let(block) +inline fun TelegramMediaFile.ifMimedMediaFile(block: (MimedMediaFile) -> T) = mimedMediaFileOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.mimedMediaFileOrNull(): MimedMediaFile? = this as? MimedMediaFile @@ -2391,7 +2577,8 @@ inline fun TelegramMediaFile.mimedMediaFileOrNull(): MimedMediaFile? = this as? inline fun TelegramMediaFile.mimedMediaFileOrThrow(): MimedMediaFile = this as MimedMediaFile @PreviewFeature -inline fun TelegramMediaFile.ifPlayableMediaFile(block: (PlayableMediaFile) -> T) = playableMediaFileOrNull() ?.let(block) +inline fun TelegramMediaFile.ifPlayableMediaFile(block: (PlayableMediaFile) -> T) = + playableMediaFileOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.playableMediaFileOrNull(): PlayableMediaFile? = this as? PlayableMediaFile @@ -2400,7 +2587,7 @@ inline fun TelegramMediaFile.playableMediaFileOrNull(): PlayableMediaFile? = thi inline fun TelegramMediaFile.playableMediaFileOrThrow(): PlayableMediaFile = this as PlayableMediaFile @PreviewFeature -inline fun TelegramMediaFile.ifSizedMediaFile(block: (SizedMediaFile) -> T) = sizedMediaFileOrNull() ?.let(block) +inline fun TelegramMediaFile.ifSizedMediaFile(block: (SizedMediaFile) -> T) = sizedMediaFileOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.sizedMediaFileOrNull(): SizedMediaFile? = this as? SizedMediaFile @@ -2409,7 +2596,8 @@ inline fun TelegramMediaFile.sizedMediaFileOrNull(): SizedMediaFile? = this as? inline fun TelegramMediaFile.sizedMediaFileOrThrow(): SizedMediaFile = this as SizedMediaFile @PreviewFeature -inline fun TelegramMediaFile.ifThumbedMediaFile(block: (ThumbedMediaFile) -> T) = thumbedMediaFileOrNull() ?.let(block) +inline fun TelegramMediaFile.ifThumbedMediaFile(block: (ThumbedMediaFile) -> T) = + thumbedMediaFileOrNull()?.let(block) @PreviewFeature inline fun TelegramMediaFile.thumbedMediaFileOrNull(): ThumbedMediaFile? = this as? ThumbedMediaFile @@ -2418,7 +2606,7 @@ inline fun TelegramMediaFile.thumbedMediaFileOrNull(): ThumbedMediaFile? = this inline fun TelegramMediaFile.thumbedMediaFileOrThrow(): ThumbedMediaFile = this as ThumbedMediaFile @PreviewFeature -inline fun KeyboardMarkup.ifForceReply(block: (ReplyForce) -> T) = forceReplyOrNull() ?.let(block) +inline fun KeyboardMarkup.ifForceReply(block: (ReplyForce) -> T) = forceReplyOrNull()?.let(block) @PreviewFeature inline fun KeyboardMarkup.forceReplyOrNull(): ReplyForce? = this as? ReplyForce @@ -2427,7 +2615,8 @@ inline fun KeyboardMarkup.forceReplyOrNull(): ReplyForce? = this as? ReplyForce inline fun KeyboardMarkup.forceReplyOrThrow(): ReplyForce = this as ReplyForce @PreviewFeature -inline fun KeyboardMarkup.ifInlineKeyboardMarkup(block: (InlineKeyboardMarkup) -> T) = inlineKeyboardMarkupOrNull() ?.let(block) +inline fun KeyboardMarkup.ifInlineKeyboardMarkup(block: (InlineKeyboardMarkup) -> T) = + inlineKeyboardMarkupOrNull()?.let(block) @PreviewFeature inline fun KeyboardMarkup.inlineKeyboardMarkupOrNull(): InlineKeyboardMarkup? = this as? InlineKeyboardMarkup @@ -2436,7 +2625,8 @@ inline fun KeyboardMarkup.inlineKeyboardMarkupOrNull(): InlineKeyboardMarkup? = inline fun KeyboardMarkup.inlineKeyboardMarkupOrThrow(): InlineKeyboardMarkup = this as InlineKeyboardMarkup @PreviewFeature -inline fun KeyboardMarkup.ifReplyKeyboardMarkup(block: (ReplyKeyboardMarkup) -> T) = replyKeyboardMarkupOrNull() ?.let(block) +inline fun KeyboardMarkup.ifReplyKeyboardMarkup(block: (ReplyKeyboardMarkup) -> T) = + replyKeyboardMarkupOrNull()?.let(block) @PreviewFeature inline fun KeyboardMarkup.replyKeyboardMarkupOrNull(): ReplyKeyboardMarkup? = this as? ReplyKeyboardMarkup @@ -2445,7 +2635,8 @@ inline fun KeyboardMarkup.replyKeyboardMarkupOrNull(): ReplyKeyboardMarkup? = th inline fun KeyboardMarkup.replyKeyboardMarkupOrThrow(): ReplyKeyboardMarkup = this as ReplyKeyboardMarkup @PreviewFeature -inline fun KeyboardMarkup.ifReplyKeyboardRemove(block: (ReplyKeyboardRemove) -> T) = replyKeyboardRemoveOrNull() ?.let(block) +inline fun KeyboardMarkup.ifReplyKeyboardRemove(block: (ReplyKeyboardRemove) -> T) = + replyKeyboardRemoveOrNull()?.let(block) @PreviewFeature inline fun KeyboardMarkup.replyKeyboardRemoveOrNull(): ReplyKeyboardRemove? = this as? ReplyKeyboardRemove @@ -2454,7 +2645,8 @@ inline fun KeyboardMarkup.replyKeyboardRemoveOrNull(): ReplyKeyboardRemove? = th inline fun KeyboardMarkup.replyKeyboardRemoveOrThrow(): ReplyKeyboardRemove = this as ReplyKeyboardRemove @PreviewFeature -inline fun InlineKeyboardButton.ifCallbackDataInlineKeyboardButton(block: (CallbackDataInlineKeyboardButton) -> T) = callbackDataInlineKeyboardButtonOrNull() ?.let(block) +inline fun InlineKeyboardButton.ifCallbackDataInlineKeyboardButton(block: (CallbackDataInlineKeyboardButton) -> T) = + callbackDataInlineKeyboardButtonOrNull()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.callbackDataInlineKeyboardButtonOrNull(): CallbackDataInlineKeyboardButton? = @@ -2465,7 +2657,8 @@ inline fun InlineKeyboardButton.callbackDataInlineKeyboardButtonOrThrow(): Callb this as CallbackDataInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.ifCallbackGameInlineKeyboardButton(block: (CallbackGameInlineKeyboardButton) -> T) = callbackGameInlineKeyboardButtonOrNull() ?.let(block) +inline fun InlineKeyboardButton.ifCallbackGameInlineKeyboardButton(block: (CallbackGameInlineKeyboardButton) -> T) = + callbackGameInlineKeyboardButtonOrNull()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.callbackGameInlineKeyboardButtonOrNull(): CallbackGameInlineKeyboardButton? = @@ -2476,7 +2669,8 @@ inline fun InlineKeyboardButton.callbackGameInlineKeyboardButtonOrThrow(): Callb this as CallbackGameInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.ifLoginURLInlineKeyboardButton(block: (LoginURLInlineKeyboardButton) -> T) = loginURLInlineKeyboardButtonOrNull() ?.let(block) +inline fun InlineKeyboardButton.ifLoginURLInlineKeyboardButton(block: (LoginURLInlineKeyboardButton) -> T) = + loginURLInlineKeyboardButtonOrNull()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.loginURLInlineKeyboardButtonOrNull(): LoginURLInlineKeyboardButton? = @@ -2487,17 +2681,20 @@ inline fun InlineKeyboardButton.loginURLInlineKeyboardButtonOrThrow(): LoginURLI this as LoginURLInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.ifPayInlineKeyboardButton(block: (PayInlineKeyboardButton) -> T) = payInlineKeyboardButtonOrNull() ?.let(block) +inline fun InlineKeyboardButton.ifPayInlineKeyboardButton(block: (PayInlineKeyboardButton) -> T) = + payInlineKeyboardButtonOrNull()?.let(block) @PreviewFeature -inline fun InlineKeyboardButton.payInlineKeyboardButtonOrNull(): PayInlineKeyboardButton? = this as? PayInlineKeyboardButton +inline fun InlineKeyboardButton.payInlineKeyboardButtonOrNull(): PayInlineKeyboardButton? = + this as? PayInlineKeyboardButton @PreviewFeature inline fun InlineKeyboardButton.payInlineKeyboardButtonOrThrow(): PayInlineKeyboardButton = this as PayInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.ifSwitchInlineQueryCurrentChatInlineKeyboardButton(block: (SwitchInlineQueryCurrentChatInlineKeyboardButton) -> T) = switchInlineQueryCurrentChatInlineKeyboardButtonOrNull() ?.let(block) +inline fun InlineKeyboardButton.ifSwitchInlineQueryCurrentChatInlineKeyboardButton(block: (SwitchInlineQueryCurrentChatInlineKeyboardButton) -> T) = + switchInlineQueryCurrentChatInlineKeyboardButtonOrNull()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.switchInlineQueryCurrentChatInlineKeyboardButtonOrNull(): SwitchInlineQueryCurrentChatInlineKeyboardButton? = @@ -2508,7 +2705,8 @@ inline fun InlineKeyboardButton.switchInlineQueryCurrentChatInlineKeyboardButton this as SwitchInlineQueryCurrentChatInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.ifSwitchInlineQueryInlineKeyboardButton(block: (SwitchInlineQueryInlineKeyboardButton) -> T) = switchInlineQueryInlineKeyboardButtonOrNull() ?.let(block) +inline fun InlineKeyboardButton.ifSwitchInlineQueryInlineKeyboardButton(block: (SwitchInlineQueryInlineKeyboardButton) -> T) = + switchInlineQueryInlineKeyboardButtonOrNull()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.switchInlineQueryInlineKeyboardButtonOrNull(): SwitchInlineQueryInlineKeyboardButton? = @@ -2519,17 +2717,20 @@ inline fun InlineKeyboardButton.switchInlineQueryInlineKeyboardButtonOrThrow(): this as SwitchInlineQueryInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.ifURLInlineKeyboardButton(block: (URLInlineKeyboardButton) -> T) = uRLInlineKeyboardButtonOrNull() ?.let(block) +inline fun InlineKeyboardButton.ifURLInlineKeyboardButton(block: (URLInlineKeyboardButton) -> T) = + uRLInlineKeyboardButtonOrNull()?.let(block) @PreviewFeature -inline fun InlineKeyboardButton.uRLInlineKeyboardButtonOrNull(): URLInlineKeyboardButton? = this as? URLInlineKeyboardButton +inline fun InlineKeyboardButton.uRLInlineKeyboardButtonOrNull(): URLInlineKeyboardButton? = + this as? URLInlineKeyboardButton @PreviewFeature inline fun InlineKeyboardButton.uRLInlineKeyboardButtonOrThrow(): URLInlineKeyboardButton = this as URLInlineKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.ifWebAppKeyboardButton(block: (WebAppKeyboardButton) -> T) = webAppKeyboardButtonOrNull() ?.let(block) +inline fun InlineKeyboardButton.ifWebAppKeyboardButton(block: (WebAppKeyboardButton) -> T) = + webAppKeyboardButtonOrNull()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.webAppKeyboardButtonOrNull(): WebAppKeyboardButton? = this as? WebAppKeyboardButton @@ -2539,7 +2740,8 @@ inline fun InlineKeyboardButton.webAppKeyboardButtonOrThrow(): WebAppKeyboardBut this as WebAppKeyboardButton @PreviewFeature -inline fun InlineKeyboardButton.ifUnknownInlineKeyboardButton(block: (UnknownInlineKeyboardButton) -> T) = unknownInlineKeyboardButtonOrNull() ?.let(block) +inline fun InlineKeyboardButton.ifUnknownInlineKeyboardButton(block: (UnknownInlineKeyboardButton) -> T) = + unknownInlineKeyboardButtonOrNull()?.let(block) @PreviewFeature inline fun InlineKeyboardButton.unknownInlineKeyboardButtonOrNull(): UnknownInlineKeyboardButton? = @@ -2550,7 +2752,7 @@ inline fun InlineKeyboardButton.unknownInlineKeyboardButtonOrThrow(): UnknownInl this as UnknownInlineKeyboardButton @PreviewFeature -inline fun Poll.ifMultipleAnswersPoll(block: (MultipleAnswersPoll) -> T) = multipleAnswersPollOrNull() ?.let(block) +inline fun Poll.ifMultipleAnswersPoll(block: (MultipleAnswersPoll) -> T) = multipleAnswersPollOrNull()?.let(block) @PreviewFeature inline fun Poll.multipleAnswersPollOrNull(): MultipleAnswersPoll? = this as? MultipleAnswersPoll @@ -2559,7 +2761,7 @@ inline fun Poll.multipleAnswersPollOrNull(): MultipleAnswersPoll? = this as? Mul inline fun Poll.multipleAnswersPollOrThrow(): MultipleAnswersPoll = this as MultipleAnswersPoll @PreviewFeature -inline fun Poll.ifQuizPoll(block: (QuizPoll) -> T) = quizPollOrNull() ?.let(block) +inline fun Poll.ifQuizPoll(block: (QuizPoll) -> T) = quizPollOrNull()?.let(block) @PreviewFeature inline fun Poll.quizPollOrNull(): QuizPoll? = this as? QuizPoll @@ -2568,7 +2770,7 @@ inline fun Poll.quizPollOrNull(): QuizPoll? = this as? QuizPoll inline fun Poll.quizPollOrThrow(): QuizPoll = this as QuizPoll @PreviewFeature -inline fun Poll.ifRegularPoll(block: (RegularPoll) -> T) = regularPollOrNull() ?.let(block) +inline fun Poll.ifRegularPoll(block: (RegularPoll) -> T) = regularPollOrNull()?.let(block) @PreviewFeature inline fun Poll.regularPollOrNull(): RegularPoll? = this as? RegularPoll @@ -2577,7 +2779,7 @@ inline fun Poll.regularPollOrNull(): RegularPoll? = this as? RegularPoll inline fun Poll.regularPollOrThrow(): RegularPoll = this as RegularPoll @PreviewFeature -inline fun Poll.ifUnknownPollType(block: (UnknownPollType) -> T) = unknownPollTypeOrNull() ?.let(block) +inline fun Poll.ifUnknownPollType(block: (UnknownPollType) -> T) = unknownPollTypeOrNull()?.let(block) @PreviewFeature inline fun Poll.unknownPollTypeOrNull(): UnknownPollType? = this as? UnknownPollType @@ -2586,7 +2788,7 @@ inline fun Poll.unknownPollTypeOrNull(): UnknownPollType? = this as? UnknownPoll inline fun Poll.unknownPollTypeOrThrow(): UnknownPollType = this as UnknownPollType @PreviewFeature -inline fun ResendableContent.ifContactContent(block: (ContactContent) -> T) = contactContentOrNull() ?.let(block) +inline fun ResendableContent.ifContactContent(block: (ContactContent) -> T) = contactContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.contactContentOrNull(): ContactContent? = this as? ContactContent @@ -2595,7 +2797,7 @@ inline fun ResendableContent.contactContentOrNull(): ContactContent? = this as? inline fun ResendableContent.contactContentOrThrow(): ContactContent = this as ContactContent @PreviewFeature -inline fun ResendableContent.ifDiceContent(block: (DiceContent) -> T) = diceContentOrNull() ?.let(block) +inline fun ResendableContent.ifDiceContent(block: (DiceContent) -> T) = diceContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.diceContentOrNull(): DiceContent? = this as? DiceContent @@ -2604,7 +2806,7 @@ inline fun ResendableContent.diceContentOrNull(): DiceContent? = this as? DiceCo inline fun ResendableContent.diceContentOrThrow(): DiceContent = this as DiceContent @PreviewFeature -inline fun ResendableContent.ifGameContent(block: (GameContent) -> T) = gameContentOrNull() ?.let(block) +inline fun ResendableContent.ifGameContent(block: (GameContent) -> T) = gameContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.gameContentOrNull(): GameContent? = this as? GameContent @@ -2613,7 +2815,7 @@ inline fun ResendableContent.gameContentOrNull(): GameContent? = this as? GameCo inline fun ResendableContent.gameContentOrThrow(): GameContent = this as GameContent @PreviewFeature -inline fun ResendableContent.ifLocationContent(block: (LocationContent) -> T) = locationContentOrNull() ?.let(block) +inline fun ResendableContent.ifLocationContent(block: (LocationContent) -> T) = locationContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.locationContentOrNull(): LocationContent? = this as? LocationContent @@ -2622,7 +2824,8 @@ inline fun ResendableContent.locationContentOrNull(): LocationContent? = this as inline fun ResendableContent.locationContentOrThrow(): LocationContent = this as LocationContent @PreviewFeature -inline fun ResendableContent.ifLiveLocationContent(block: (LiveLocationContent) -> T) = liveLocationContentOrNull() ?.let(block) +inline fun ResendableContent.ifLiveLocationContent(block: (LiveLocationContent) -> T) = + liveLocationContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.liveLocationContentOrNull(): LiveLocationContent? = this as? LiveLocationContent @@ -2631,7 +2834,8 @@ inline fun ResendableContent.liveLocationContentOrNull(): LiveLocationContent? = inline fun ResendableContent.liveLocationContentOrThrow(): LiveLocationContent = this as LiveLocationContent @PreviewFeature -inline fun ResendableContent.ifStaticLocationContent(block: (StaticLocationContent) -> T) = staticLocationContentOrNull() ?.let(block) +inline fun ResendableContent.ifStaticLocationContent(block: (StaticLocationContent) -> T) = + staticLocationContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.staticLocationContentOrNull(): StaticLocationContent? = this as? StaticLocationContent @@ -2640,7 +2844,7 @@ inline fun ResendableContent.staticLocationContentOrNull(): StaticLocationConten inline fun ResendableContent.staticLocationContentOrThrow(): StaticLocationContent = this as StaticLocationContent @PreviewFeature -inline fun ResendableContent.ifPollContent(block: (PollContent) -> T) = pollContentOrNull() ?.let(block) +inline fun ResendableContent.ifPollContent(block: (PollContent) -> T) = pollContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.pollContentOrNull(): PollContent? = this as? PollContent @@ -2649,7 +2853,7 @@ inline fun ResendableContent.pollContentOrNull(): PollContent? = this as? PollCo inline fun ResendableContent.pollContentOrThrow(): PollContent = this as PollContent @PreviewFeature -inline fun ResendableContent.ifTextContent(block: (TextContent) -> T) = textContentOrNull() ?.let(block) +inline fun ResendableContent.ifTextContent(block: (TextContent) -> T) = textContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.textContentOrNull(): TextContent? = this as? TextContent @@ -2658,7 +2862,7 @@ inline fun ResendableContent.textContentOrNull(): TextContent? = this as? TextCo inline fun ResendableContent.textContentOrThrow(): TextContent = this as TextContent @PreviewFeature -inline fun ResendableContent.ifVenueContent(block: (VenueContent) -> T) = venueContentOrNull() ?.let(block) +inline fun ResendableContent.ifVenueContent(block: (VenueContent) -> T) = venueContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.venueContentOrNull(): VenueContent? = this as? VenueContent @@ -2667,7 +2871,8 @@ inline fun ResendableContent.venueContentOrNull(): VenueContent? = this as? Venu inline fun ResendableContent.venueContentOrThrow(): VenueContent = this as VenueContent @PreviewFeature -inline fun ResendableContent.ifAudioMediaGroupContent(block: (AudioMediaGroupContent) -> T) = audioMediaGroupContentOrNull() ?.let(block) +inline fun ResendableContent.ifAudioMediaGroupContent(block: (AudioMediaGroupContent) -> T) = + audioMediaGroupContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.audioMediaGroupContentOrNull(): AudioMediaGroupContent? = this as? AudioMediaGroupContent @@ -2676,7 +2881,8 @@ inline fun ResendableContent.audioMediaGroupContentOrNull(): AudioMediaGroupCont inline fun ResendableContent.audioMediaGroupContentOrThrow(): AudioMediaGroupContent = this as AudioMediaGroupContent @PreviewFeature -inline fun ResendableContent.ifDocumentMediaGroupContent(block: (DocumentMediaGroupContent) -> T) = documentMediaGroupContentOrNull() ?.let(block) +inline fun ResendableContent.ifDocumentMediaGroupContent(block: (DocumentMediaGroupContent) -> T) = + documentMediaGroupContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.documentMediaGroupContentOrNull(): DocumentMediaGroupContent? = @@ -2687,7 +2893,8 @@ inline fun ResendableContent.documentMediaGroupContentOrThrow(): DocumentMediaGr this as DocumentMediaGroupContent @PreviewFeature -inline fun ResendableContent.ifMediaCollectionContent(block: (MediaCollectionContent) -> T) = mediaCollectionContentOrNull() ?.let(block) +inline fun ResendableContent.ifMediaCollectionContent(block: (MediaCollectionContent) -> T) = + mediaCollectionContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.mediaCollectionContentOrNull(): MediaCollectionContent? = @@ -2698,7 +2905,8 @@ inline fun ResendableContent.mediaCollectionContentOrThrow(): MediaCollectionCon this as MediaCollectionContent @PreviewFeature -inline fun ResendableContent.ifTextedMediaContent(block: (TextedMediaContent) -> T) = textedMediaContentOrNull() ?.let(block) +inline fun ResendableContent.ifTextedMediaContent(block: (TextedMediaContent) -> T) = + textedMediaContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.textedMediaContentOrNull(): TextedMediaContent? = @@ -2709,7 +2917,7 @@ inline fun ResendableContent.textedMediaContentOrThrow(): TextedMediaContent = this as TextedMediaContent @PreviewFeature -inline fun ResendableContent.ifMediaContent(block: (MediaContent) -> T) = mediaContentOrNull() ?.let(block) +inline fun ResendableContent.ifMediaContent(block: (MediaContent) -> T) = mediaContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.mediaContentOrNull(): MediaContent? = this as? MediaContent @@ -2718,7 +2926,8 @@ inline fun ResendableContent.mediaContentOrNull(): MediaContent? = this as? Medi inline fun ResendableContent.mediaContentOrThrow(): MediaContent = this as MediaContent @PreviewFeature -inline fun ResendableContent.ifMediaGroupContent(block: (MediaGroupContent) -> T) = mediaGroupContentOrNull() ?.let(block) +inline fun ResendableContent.ifMediaGroupContent(block: (MediaGroupContent) -> T) = + mediaGroupContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.mediaGroupContentOrNull(): MediaGroupContent? = this as? MediaGroupContent @@ -2727,7 +2936,7 @@ inline fun ResendableContent.mediaGroupContentOrNull(): MediaGroupContent? = thi inline fun ResendableContent.mediaGroupContentOrThrow(): MediaGroupContent = this as MediaGroupContent @PreviewFeature -inline fun ResendableContent.ifMessageContent(block: (MessageContent) -> T) = messageContentOrNull() ?.let(block) +inline fun ResendableContent.ifMessageContent(block: (MessageContent) -> T) = messageContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.messageContentOrNull(): MessageContent? = this as? MessageContent @@ -2736,16 +2945,19 @@ inline fun ResendableContent.messageContentOrNull(): MessageContent? = this as? inline fun ResendableContent.messageContentOrThrow(): MessageContent = this as MessageContent @PreviewFeature -inline fun ResendableContent.ifVisualMediaGroupContent(block: (VisualMediaGroupContent) -> T) = visualMediaGroupContentOrNull() ?.let(block) +inline fun ResendableContent.ifVisualMediaGroupContent(block: (VisualMediaGroupContent) -> T) = + visualMediaGroupContentOrNull()?.let(block) @PreviewFeature -inline fun ResendableContent.visualMediaGroupContentOrNull(): VisualMediaGroupContent? = this as? VisualMediaGroupContent +inline fun ResendableContent.visualMediaGroupContentOrNull(): VisualMediaGroupContent? = + this as? VisualMediaGroupContent @PreviewFeature inline fun ResendableContent.visualMediaGroupContentOrThrow(): VisualMediaGroupContent = this as VisualMediaGroupContent @PreviewFeature -inline fun ResendableContent.ifAnimationContent(block: (AnimationContent) -> T) = animationContentOrNull() ?.let(block) +inline fun ResendableContent.ifAnimationContent(block: (AnimationContent) -> T) = + animationContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.animationContentOrNull(): AnimationContent? = this as? AnimationContent @@ -2754,7 +2966,7 @@ inline fun ResendableContent.animationContentOrNull(): AnimationContent? = this inline fun ResendableContent.animationContentOrThrow(): AnimationContent = this as AnimationContent @PreviewFeature -inline fun ResendableContent.ifAudioContent(block: (AudioContent) -> T) = audioContentOrNull() ?.let(block) +inline fun ResendableContent.ifAudioContent(block: (AudioContent) -> T) = audioContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.audioContentOrNull(): AudioContent? = this as? AudioContent @@ -2763,7 +2975,7 @@ inline fun ResendableContent.audioContentOrNull(): AudioContent? = this as? Audi inline fun ResendableContent.audioContentOrThrow(): AudioContent = this as AudioContent @PreviewFeature -inline fun ResendableContent.ifDocumentContent(block: (DocumentContent) -> T) = documentContentOrNull() ?.let(block) +inline fun ResendableContent.ifDocumentContent(block: (DocumentContent) -> T) = documentContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.documentContentOrNull(): DocumentContent? = this as? DocumentContent @@ -2772,7 +2984,7 @@ inline fun ResendableContent.documentContentOrNull(): DocumentContent? = this as inline fun ResendableContent.documentContentOrThrow(): DocumentContent = this as DocumentContent @PreviewFeature -inline fun ResendableContent.ifPhotoContent(block: (PhotoContent) -> T) = photoContentOrNull() ?.let(block) +inline fun ResendableContent.ifPhotoContent(block: (PhotoContent) -> T) = photoContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.photoContentOrNull(): PhotoContent? = this as? PhotoContent @@ -2781,7 +2993,7 @@ inline fun ResendableContent.photoContentOrNull(): PhotoContent? = this as? Phot inline fun ResendableContent.photoContentOrThrow(): PhotoContent = this as PhotoContent @PreviewFeature -inline fun ResendableContent.ifStickerContent(block: (StickerContent) -> T) = stickerContentOrNull() ?.let(block) +inline fun ResendableContent.ifStickerContent(block: (StickerContent) -> T) = stickerContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.stickerContentOrNull(): StickerContent? = this as? StickerContent @@ -2790,7 +3002,7 @@ inline fun ResendableContent.stickerContentOrNull(): StickerContent? = this as? inline fun ResendableContent.stickerContentOrThrow(): StickerContent = this as StickerContent @PreviewFeature -inline fun ResendableContent.ifVideoContent(block: (VideoContent) -> T) = videoContentOrNull() ?.let(block) +inline fun ResendableContent.ifVideoContent(block: (VideoContent) -> T) = videoContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.videoContentOrNull(): VideoContent? = this as? VideoContent @@ -2799,7 +3011,8 @@ inline fun ResendableContent.videoContentOrNull(): VideoContent? = this as? Vide inline fun ResendableContent.videoContentOrThrow(): VideoContent = this as VideoContent @PreviewFeature -inline fun ResendableContent.ifVideoNoteContent(block: (VideoNoteContent) -> T) = videoNoteContentOrNull() ?.let(block) +inline fun ResendableContent.ifVideoNoteContent(block: (VideoNoteContent) -> T) = + videoNoteContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.videoNoteContentOrNull(): VideoNoteContent? = this as? VideoNoteContent @@ -2808,7 +3021,7 @@ inline fun ResendableContent.videoNoteContentOrNull(): VideoNoteContent? = this inline fun ResendableContent.videoNoteContentOrThrow(): VideoNoteContent = this as VideoNoteContent @PreviewFeature -inline fun ResendableContent.ifVoiceContent(block: (VoiceContent) -> T) = voiceContentOrNull() ?.let(block) +inline fun ResendableContent.ifVoiceContent(block: (VoiceContent) -> T) = voiceContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.voiceContentOrNull(): VoiceContent? = this as? VoiceContent @@ -2817,7 +3030,7 @@ inline fun ResendableContent.voiceContentOrNull(): VoiceContent? = this as? Voic inline fun ResendableContent.voiceContentOrThrow(): VoiceContent = this as VoiceContent @PreviewFeature -inline fun ResendableContent.ifInvoiceContent(block: (InvoiceContent) -> T) = invoiceContentOrNull() ?.let(block) +inline fun ResendableContent.ifInvoiceContent(block: (InvoiceContent) -> T) = invoiceContentOrNull()?.let(block) @PreviewFeature inline fun ResendableContent.invoiceContentOrNull(): InvoiceContent? = this as? InvoiceContent @@ -2826,7 +3039,8 @@ inline fun ResendableContent.invoiceContentOrNull(): InvoiceContent? = this as? inline fun ResendableContent.invoiceContentOrThrow(): InvoiceContent = this as InvoiceContent @PreviewFeature -inline fun TextSource.ifMultilevelTextSource(block: (MultilevelTextSource) -> T) = multilevelTextSourceOrNull() ?.let(block) +inline fun TextSource.ifMultilevelTextSource(block: (MultilevelTextSource) -> T) = + multilevelTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.multilevelTextSourceOrNull(): MultilevelTextSource? = this as? MultilevelTextSource @@ -2835,7 +3049,7 @@ inline fun TextSource.multilevelTextSourceOrNull(): MultilevelTextSource? = this inline fun TextSource.multilevelTextSourceOrThrow(): MultilevelTextSource = this as MultilevelTextSource @PreviewFeature -inline fun TextSource.ifBoldTextSource(block: (BoldTextSource) -> T) = boldTextSourceOrNull() ?.let(block) +inline fun TextSource.ifBoldTextSource(block: (BoldTextSource) -> T) = boldTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.boldTextSourceOrNull(): BoldTextSource? = this as? BoldTextSource @@ -2844,7 +3058,8 @@ inline fun TextSource.boldTextSourceOrNull(): BoldTextSource? = this as? BoldTex inline fun TextSource.boldTextSourceOrThrow(): BoldTextSource = this as BoldTextSource @PreviewFeature -inline fun TextSource.ifBotCommandTextSource(block: (BotCommandTextSource) -> T) = botCommandTextSourceOrNull() ?.let(block) +inline fun TextSource.ifBotCommandTextSource(block: (BotCommandTextSource) -> T) = + botCommandTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.botCommandTextSourceOrNull(): BotCommandTextSource? = this as? BotCommandTextSource @@ -2853,7 +3068,7 @@ inline fun TextSource.botCommandTextSourceOrNull(): BotCommandTextSource? = this inline fun TextSource.botCommandTextSourceOrThrow(): BotCommandTextSource = this as BotCommandTextSource @PreviewFeature -inline fun TextSource.ifCashTagTextSource(block: (CashTagTextSource) -> T) = cashTagTextSourceOrNull() ?.let(block) +inline fun TextSource.ifCashTagTextSource(block: (CashTagTextSource) -> T) = cashTagTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.cashTagTextSourceOrNull(): CashTagTextSource? = this as? CashTagTextSource @@ -2862,7 +3077,7 @@ inline fun TextSource.cashTagTextSourceOrNull(): CashTagTextSource? = this as? C inline fun TextSource.cashTagTextSourceOrThrow(): CashTagTextSource = this as CashTagTextSource @PreviewFeature -inline fun TextSource.ifCodeTextSource(block: (CodeTextSource) -> T) = codeTextSourceOrNull() ?.let(block) +inline fun TextSource.ifCodeTextSource(block: (CodeTextSource) -> T) = codeTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.codeTextSourceOrNull(): CodeTextSource? = this as? CodeTextSource @@ -2871,7 +3086,7 @@ inline fun TextSource.codeTextSourceOrNull(): CodeTextSource? = this as? CodeTex inline fun TextSource.codeTextSourceOrThrow(): CodeTextSource = this as CodeTextSource @PreviewFeature -inline fun TextSource.ifEMailTextSource(block: (EMailTextSource) -> T) = eMailTextSourceOrNull() ?.let(block) +inline fun TextSource.ifEMailTextSource(block: (EMailTextSource) -> T) = eMailTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.eMailTextSourceOrNull(): EMailTextSource? = this as? EMailTextSource @@ -2880,7 +3095,7 @@ inline fun TextSource.eMailTextSourceOrNull(): EMailTextSource? = this as? EMail inline fun TextSource.eMailTextSourceOrThrow(): EMailTextSource = this as EMailTextSource @PreviewFeature -inline fun TextSource.ifHashTagTextSource(block: (HashTagTextSource) -> T) = hashTagTextSourceOrNull() ?.let(block) +inline fun TextSource.ifHashTagTextSource(block: (HashTagTextSource) -> T) = hashTagTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.hashTagTextSourceOrNull(): HashTagTextSource? = this as? HashTagTextSource @@ -2889,7 +3104,7 @@ inline fun TextSource.hashTagTextSourceOrNull(): HashTagTextSource? = this as? H inline fun TextSource.hashTagTextSourceOrThrow(): HashTagTextSource = this as HashTagTextSource @PreviewFeature -inline fun TextSource.ifItalicTextSource(block: (ItalicTextSource) -> T) = italicTextSourceOrNull() ?.let(block) +inline fun TextSource.ifItalicTextSource(block: (ItalicTextSource) -> T) = italicTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.italicTextSourceOrNull(): ItalicTextSource? = this as? ItalicTextSource @@ -2898,7 +3113,7 @@ inline fun TextSource.italicTextSourceOrNull(): ItalicTextSource? = this as? Ita inline fun TextSource.italicTextSourceOrThrow(): ItalicTextSource = this as ItalicTextSource @PreviewFeature -inline fun TextSource.ifMentionTextSource(block: (MentionTextSource) -> T) = mentionTextSourceOrNull() ?.let(block) +inline fun TextSource.ifMentionTextSource(block: (MentionTextSource) -> T) = mentionTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.mentionTextSourceOrNull(): MentionTextSource? = this as? MentionTextSource @@ -2907,7 +3122,8 @@ inline fun TextSource.mentionTextSourceOrNull(): MentionTextSource? = this as? M inline fun TextSource.mentionTextSourceOrThrow(): MentionTextSource = this as MentionTextSource @PreviewFeature -inline fun TextSource.ifPhoneNumberTextSource(block: (PhoneNumberTextSource) -> T) = phoneNumberTextSourceOrNull() ?.let(block) +inline fun TextSource.ifPhoneNumberTextSource(block: (PhoneNumberTextSource) -> T) = + phoneNumberTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.phoneNumberTextSourceOrNull(): PhoneNumberTextSource? = this as? PhoneNumberTextSource @@ -2916,7 +3132,7 @@ inline fun TextSource.phoneNumberTextSourceOrNull(): PhoneNumberTextSource? = th inline fun TextSource.phoneNumberTextSourceOrThrow(): PhoneNumberTextSource = this as PhoneNumberTextSource @PreviewFeature -inline fun TextSource.ifPreTextSource(block: (PreTextSource) -> T) = preTextSourceOrNull() ?.let(block) +inline fun TextSource.ifPreTextSource(block: (PreTextSource) -> T) = preTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.preTextSourceOrNull(): PreTextSource? = this as? PreTextSource @@ -2925,7 +3141,7 @@ inline fun TextSource.preTextSourceOrNull(): PreTextSource? = this as? PreTextSo inline fun TextSource.preTextSourceOrThrow(): PreTextSource = this as PreTextSource @PreviewFeature -inline fun TextSource.ifRegularTextSource(block: (RegularTextSource) -> T) = regularTextSourceOrNull() ?.let(block) +inline fun TextSource.ifRegularTextSource(block: (RegularTextSource) -> T) = regularTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.regularTextSourceOrNull(): RegularTextSource? = this as? RegularTextSource @@ -2934,7 +3150,8 @@ inline fun TextSource.regularTextSourceOrNull(): RegularTextSource? = this as? R inline fun TextSource.regularTextSourceOrThrow(): RegularTextSource = this as RegularTextSource @PreviewFeature -inline fun TextSource.ifStrikethroughTextSource(block: (StrikethroughTextSource) -> T) = strikethroughTextSourceOrNull() ?.let(block) +inline fun TextSource.ifStrikethroughTextSource(block: (StrikethroughTextSource) -> T) = + strikethroughTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.strikethroughTextSourceOrNull(): StrikethroughTextSource? = this as? StrikethroughTextSource @@ -2943,7 +3160,8 @@ inline fun TextSource.strikethroughTextSourceOrNull(): StrikethroughTextSource? inline fun TextSource.strikethroughTextSourceOrThrow(): StrikethroughTextSource = this as StrikethroughTextSource @PreviewFeature -inline fun TextSource.ifTextLinkTextSource(block: (TextLinkTextSource) -> T) = textLinkTextSourceOrNull() ?.let(block) +inline fun TextSource.ifTextLinkTextSource(block: (TextLinkTextSource) -> T) = + textLinkTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.textLinkTextSourceOrNull(): TextLinkTextSource? = this as? TextLinkTextSource @@ -2952,7 +3170,8 @@ inline fun TextSource.textLinkTextSourceOrNull(): TextLinkTextSource? = this as? inline fun TextSource.textLinkTextSourceOrThrow(): TextLinkTextSource = this as TextLinkTextSource @PreviewFeature -inline fun TextSource.ifTextMentionTextSource(block: (TextMentionTextSource) -> T) = textMentionTextSourceOrNull() ?.let(block) +inline fun TextSource.ifTextMentionTextSource(block: (TextMentionTextSource) -> T) = + textMentionTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.textMentionTextSourceOrNull(): TextMentionTextSource? = this as? TextMentionTextSource @@ -2961,7 +3180,7 @@ inline fun TextSource.textMentionTextSourceOrNull(): TextMentionTextSource? = th inline fun TextSource.textMentionTextSourceOrThrow(): TextMentionTextSource = this as TextMentionTextSource @PreviewFeature -inline fun TextSource.ifURLTextSource(block: (URLTextSource) -> T) = uRLTextSourceOrNull() ?.let(block) +inline fun TextSource.ifURLTextSource(block: (URLTextSource) -> T) = uRLTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.uRLTextSourceOrNull(): URLTextSource? = this as? URLTextSource @@ -2970,7 +3189,8 @@ inline fun TextSource.uRLTextSourceOrNull(): URLTextSource? = this as? URLTextSo inline fun TextSource.uRLTextSourceOrThrow(): URLTextSource = this as URLTextSource @PreviewFeature -inline fun TextSource.ifUnderlineTextSource(block: (UnderlineTextSource) -> T) = underlineTextSourceOrNull() ?.let(block) +inline fun TextSource.ifUnderlineTextSource(block: (UnderlineTextSource) -> T) = + underlineTextSourceOrNull()?.let(block) @PreviewFeature inline fun TextSource.underlineTextSourceOrNull(): UnderlineTextSource? = this as? UnderlineTextSource @@ -2979,7 +3199,8 @@ inline fun TextSource.underlineTextSourceOrNull(): UnderlineTextSource? = this a inline fun TextSource.underlineTextSourceOrThrow(): UnderlineTextSource = this as UnderlineTextSource @PreviewFeature -inline fun DiceAnimationType.ifBasketballDiceAnimationType(block: (BasketballDiceAnimationType) -> T) = basketballDiceAnimationTypeOrNull() ?.let(block) +inline fun DiceAnimationType.ifBasketballDiceAnimationType(block: (BasketballDiceAnimationType) -> T) = + basketballDiceAnimationTypeOrNull()?.let(block) @PreviewFeature inline fun DiceAnimationType.basketballDiceAnimationTypeOrNull(): BasketballDiceAnimationType? = @@ -2990,17 +3211,20 @@ inline fun DiceAnimationType.basketballDiceAnimationTypeOrThrow(): BasketballDic this as BasketballDiceAnimationType @PreviewFeature -inline fun DiceAnimationType.ifBowlingDiceAnimationType(block: (BowlingDiceAnimationType) -> T) = bowlingDiceAnimationTypeOrNull() ?.let(block) +inline fun DiceAnimationType.ifBowlingDiceAnimationType(block: (BowlingDiceAnimationType) -> T) = + bowlingDiceAnimationTypeOrNull()?.let(block) @PreviewFeature -inline fun DiceAnimationType.bowlingDiceAnimationTypeOrNull(): BowlingDiceAnimationType? = this as? BowlingDiceAnimationType +inline fun DiceAnimationType.bowlingDiceAnimationTypeOrNull(): BowlingDiceAnimationType? = + this as? BowlingDiceAnimationType @PreviewFeature inline fun DiceAnimationType.bowlingDiceAnimationTypeOrThrow(): BowlingDiceAnimationType = this as BowlingDiceAnimationType @PreviewFeature -inline fun DiceAnimationType.ifCubeDiceAnimationType(block: (CubeDiceAnimationType) -> T) = cubeDiceAnimationTypeOrNull() ?.let(block) +inline fun DiceAnimationType.ifCubeDiceAnimationType(block: (CubeDiceAnimationType) -> T) = + cubeDiceAnimationTypeOrNull()?.let(block) @PreviewFeature inline fun DiceAnimationType.cubeDiceAnimationTypeOrNull(): CubeDiceAnimationType? = this as? CubeDiceAnimationType @@ -3009,16 +3233,19 @@ inline fun DiceAnimationType.cubeDiceAnimationTypeOrNull(): CubeDiceAnimationTyp inline fun DiceAnimationType.cubeDiceAnimationTypeOrThrow(): CubeDiceAnimationType = this as CubeDiceAnimationType @PreviewFeature -inline fun DiceAnimationType.ifCustomDiceAnimationType(block: (CustomDiceAnimationType) -> T) = customDiceAnimationTypeOrNull() ?.let(block) +inline fun DiceAnimationType.ifCustomDiceAnimationType(block: (CustomDiceAnimationType) -> T) = + customDiceAnimationTypeOrNull()?.let(block) @PreviewFeature -inline fun DiceAnimationType.customDiceAnimationTypeOrNull(): CustomDiceAnimationType? = this as? CustomDiceAnimationType +inline fun DiceAnimationType.customDiceAnimationTypeOrNull(): CustomDiceAnimationType? = + this as? CustomDiceAnimationType @PreviewFeature inline fun DiceAnimationType.customDiceAnimationTypeOrThrow(): CustomDiceAnimationType = this as CustomDiceAnimationType @PreviewFeature -inline fun DiceAnimationType.ifDartsDiceAnimationType(block: (DartsDiceAnimationType) -> T) = dartsDiceAnimationTypeOrNull() ?.let(block) +inline fun DiceAnimationType.ifDartsDiceAnimationType(block: (DartsDiceAnimationType) -> T) = + dartsDiceAnimationTypeOrNull()?.let(block) @PreviewFeature inline fun DiceAnimationType.dartsDiceAnimationTypeOrNull(): DartsDiceAnimationType? = this as? DartsDiceAnimationType @@ -3027,7 +3254,8 @@ inline fun DiceAnimationType.dartsDiceAnimationTypeOrNull(): DartsDiceAnimationT inline fun DiceAnimationType.dartsDiceAnimationTypeOrThrow(): DartsDiceAnimationType = this as DartsDiceAnimationType @PreviewFeature -inline fun DiceAnimationType.ifFootballDiceAnimationType(block: (FootballDiceAnimationType) -> T) = footballDiceAnimationTypeOrNull() ?.let(block) +inline fun DiceAnimationType.ifFootballDiceAnimationType(block: (FootballDiceAnimationType) -> T) = + footballDiceAnimationTypeOrNull()?.let(block) @PreviewFeature inline fun DiceAnimationType.footballDiceAnimationTypeOrNull(): FootballDiceAnimationType? = @@ -3038,7 +3266,8 @@ inline fun DiceAnimationType.footballDiceAnimationTypeOrThrow(): FootballDiceAni this as FootballDiceAnimationType @PreviewFeature -inline fun DiceAnimationType.ifSlotMachineDiceAnimationType(block: (SlotMachineDiceAnimationType) -> T) = slotMachineDiceAnimationTypeOrNull() ?.let(block) +inline fun DiceAnimationType.ifSlotMachineDiceAnimationType(block: (SlotMachineDiceAnimationType) -> T) = + slotMachineDiceAnimationTypeOrNull()?.let(block) @PreviewFeature inline fun DiceAnimationType.slotMachineDiceAnimationTypeOrNull(): SlotMachineDiceAnimationType? = @@ -3049,7 +3278,7 @@ inline fun DiceAnimationType.slotMachineDiceAnimationTypeOrThrow(): SlotMachineD this as SlotMachineDiceAnimationType @PreviewFeature -inline fun ChatEvent.ifChannelChatCreated(block: (ChannelChatCreated) -> T) = channelChatCreatedOrNull() ?.let(block) +inline fun ChatEvent.ifChannelChatCreated(block: (ChannelChatCreated) -> T) = channelChatCreatedOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.channelChatCreatedOrNull(): ChannelChatCreated? = this as? ChannelChatCreated @@ -3058,7 +3287,7 @@ inline fun ChatEvent.channelChatCreatedOrNull(): ChannelChatCreated? = this as? inline fun ChatEvent.channelChatCreatedOrThrow(): ChannelChatCreated = this as ChannelChatCreated @PreviewFeature -inline fun ChatEvent.ifDeleteChatPhoto(block: (DeleteChatPhoto) -> T) = deleteChatPhotoOrNull() ?.let(block) +inline fun ChatEvent.ifDeleteChatPhoto(block: (DeleteChatPhoto) -> T) = deleteChatPhotoOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.deleteChatPhotoOrNull(): DeleteChatPhoto? = this as? DeleteChatPhoto @@ -3067,7 +3296,7 @@ inline fun ChatEvent.deleteChatPhotoOrNull(): DeleteChatPhoto? = this as? Delete inline fun ChatEvent.deleteChatPhotoOrThrow(): DeleteChatPhoto = this as DeleteChatPhoto @PreviewFeature -inline fun ChatEvent.ifGroupChatCreated(block: (GroupChatCreated) -> T) = groupChatCreatedOrNull() ?.let(block) +inline fun ChatEvent.ifGroupChatCreated(block: (GroupChatCreated) -> T) = groupChatCreatedOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.groupChatCreatedOrNull(): GroupChatCreated? = this as? GroupChatCreated @@ -3076,7 +3305,7 @@ inline fun ChatEvent.groupChatCreatedOrNull(): GroupChatCreated? = this as? Grou inline fun ChatEvent.groupChatCreatedOrThrow(): GroupChatCreated = this as GroupChatCreated @PreviewFeature -inline fun ChatEvent.ifLeftChatMember(block: (LeftChatMember) -> T) = leftChatMemberOrNull() ?.let(block) +inline fun ChatEvent.ifLeftChatMember(block: (LeftChatMember) -> T) = leftChatMemberOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.leftChatMemberOrNull(): LeftChatMember? = this as? LeftChatMember @@ -3085,7 +3314,8 @@ inline fun ChatEvent.leftChatMemberOrNull(): LeftChatMember? = this as? LeftChat inline fun ChatEvent.leftChatMemberOrThrow(): LeftChatMember = this as LeftChatMember @PreviewFeature -inline fun ChatEvent.ifMessageAutoDeleteTimerChanged(block: (MessageAutoDeleteTimerChanged) -> T) = messageAutoDeleteTimerChangedOrNull() ?.let(block) +inline fun ChatEvent.ifMessageAutoDeleteTimerChanged(block: (MessageAutoDeleteTimerChanged) -> T) = + messageAutoDeleteTimerChangedOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.messageAutoDeleteTimerChangedOrNull(): MessageAutoDeleteTimerChanged? = @@ -3096,7 +3326,7 @@ inline fun ChatEvent.messageAutoDeleteTimerChangedOrThrow(): MessageAutoDeleteTi this as MessageAutoDeleteTimerChanged @PreviewFeature -inline fun ChatEvent.ifNewChatMembers(block: (NewChatMembers) -> T) = newChatMembersOrNull() ?.let(block) +inline fun ChatEvent.ifNewChatMembers(block: (NewChatMembers) -> T) = newChatMembersOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.newChatMembersOrNull(): NewChatMembers? = this as? NewChatMembers @@ -3105,7 +3335,7 @@ inline fun ChatEvent.newChatMembersOrNull(): NewChatMembers? = this as? NewChatM inline fun ChatEvent.newChatMembersOrThrow(): NewChatMembers = this as NewChatMembers @PreviewFeature -inline fun ChatEvent.ifNewChatPhoto(block: (NewChatPhoto) -> T) = newChatPhotoOrNull() ?.let(block) +inline fun ChatEvent.ifNewChatPhoto(block: (NewChatPhoto) -> T) = newChatPhotoOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.newChatPhotoOrNull(): NewChatPhoto? = this as? NewChatPhoto @@ -3114,7 +3344,7 @@ inline fun ChatEvent.newChatPhotoOrNull(): NewChatPhoto? = this as? NewChatPhoto inline fun ChatEvent.newChatPhotoOrThrow(): NewChatPhoto = this as NewChatPhoto @PreviewFeature -inline fun ChatEvent.ifNewChatTitle(block: (NewChatTitle) -> T) = newChatTitleOrNull() ?.let(block) +inline fun ChatEvent.ifNewChatTitle(block: (NewChatTitle) -> T) = newChatTitleOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.newChatTitleOrNull(): NewChatTitle? = this as? NewChatTitle @@ -3123,7 +3353,7 @@ inline fun ChatEvent.newChatTitleOrNull(): NewChatTitle? = this as? NewChatTitle inline fun ChatEvent.newChatTitleOrThrow(): NewChatTitle = this as NewChatTitle @PreviewFeature -inline fun ChatEvent.ifPinnedMessage(block: (PinnedMessage) -> T) = pinnedMessageOrNull() ?.let(block) +inline fun ChatEvent.ifPinnedMessage(block: (PinnedMessage) -> T) = pinnedMessageOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.pinnedMessageOrNull(): PinnedMessage? = this as? PinnedMessage @@ -3132,7 +3362,8 @@ inline fun ChatEvent.pinnedMessageOrNull(): PinnedMessage? = this as? PinnedMess inline fun ChatEvent.pinnedMessageOrThrow(): PinnedMessage = this as PinnedMessage @PreviewFeature -inline fun ChatEvent.ifSuccessfulPaymentEvent(block: (SuccessfulPaymentEvent) -> T) = successfulPaymentEventOrNull() ?.let(block) +inline fun ChatEvent.ifSuccessfulPaymentEvent(block: (SuccessfulPaymentEvent) -> T) = + successfulPaymentEventOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.successfulPaymentEventOrNull(): SuccessfulPaymentEvent? = this as? SuccessfulPaymentEvent @@ -3141,7 +3372,8 @@ inline fun ChatEvent.successfulPaymentEventOrNull(): SuccessfulPaymentEvent? = t inline fun ChatEvent.successfulPaymentEventOrThrow(): SuccessfulPaymentEvent = this as SuccessfulPaymentEvent @PreviewFeature -inline fun ChatEvent.ifProximityAlertTriggered(block: (ProximityAlertTriggered) -> T) = proximityAlertTriggeredOrNull() ?.let(block) +inline fun ChatEvent.ifProximityAlertTriggered(block: (ProximityAlertTriggered) -> T) = + proximityAlertTriggeredOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.proximityAlertTriggeredOrNull(): ProximityAlertTriggered? = this as? ProximityAlertTriggered @@ -3150,7 +3382,8 @@ inline fun ChatEvent.proximityAlertTriggeredOrNull(): ProximityAlertTriggered? = inline fun ChatEvent.proximityAlertTriggeredOrThrow(): ProximityAlertTriggered = this as ProximityAlertTriggered @PreviewFeature -inline fun ChatEvent.ifSupergroupChatCreated(block: (SupergroupChatCreated) -> T) = supergroupChatCreatedOrNull() ?.let(block) +inline fun ChatEvent.ifSupergroupChatCreated(block: (SupergroupChatCreated) -> T) = + supergroupChatCreatedOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.supergroupChatCreatedOrNull(): SupergroupChatCreated? = this as? SupergroupChatCreated @@ -3159,7 +3392,8 @@ inline fun ChatEvent.supergroupChatCreatedOrNull(): SupergroupChatCreated? = thi inline fun ChatEvent.supergroupChatCreatedOrThrow(): SupergroupChatCreated = this as SupergroupChatCreated @PreviewFeature -inline fun ChatEvent.ifMigratedToSupergroup(block: (MigratedToSupergroup) -> T) = migratedToSupergroupOrNull() ?.let(block) +inline fun ChatEvent.ifMigratedToSupergroup(block: (MigratedToSupergroup) -> T) = + migratedToSupergroupOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.migratedToSupergroupOrNull(): MigratedToSupergroup? = this as? MigratedToSupergroup @@ -3168,7 +3402,7 @@ inline fun ChatEvent.migratedToSupergroupOrNull(): MigratedToSupergroup? = this inline fun ChatEvent.migratedToSupergroupOrThrow(): MigratedToSupergroup = this as MigratedToSupergroup @PreviewFeature -inline fun ChatEvent.ifChannelEvent(block: (ChannelEvent) -> T) = channelEventOrNull() ?.let(block) +inline fun ChatEvent.ifChannelEvent(block: (ChannelEvent) -> T) = channelEventOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.channelEventOrNull(): ChannelEvent? = this as? ChannelEvent @@ -3177,7 +3411,7 @@ inline fun ChatEvent.channelEventOrNull(): ChannelEvent? = this as? ChannelEvent inline fun ChatEvent.channelEventOrThrow(): ChannelEvent = this as ChannelEvent @PreviewFeature -inline fun ChatEvent.ifPublicChatEvent(block: (PublicChatEvent) -> T) = publicChatEventOrNull() ?.let(block) +inline fun ChatEvent.ifPublicChatEvent(block: (PublicChatEvent) -> T) = publicChatEventOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.publicChatEventOrNull(): PublicChatEvent? = this as? PublicChatEvent @@ -3186,7 +3420,7 @@ inline fun ChatEvent.publicChatEventOrNull(): PublicChatEvent? = this as? Public inline fun ChatEvent.publicChatEventOrThrow(): PublicChatEvent = this as PublicChatEvent @PreviewFeature -inline fun ChatEvent.ifCommonEvent(block: (CommonEvent) -> T) = commonEventOrNull() ?.let(block) +inline fun ChatEvent.ifCommonEvent(block: (CommonEvent) -> T) = commonEventOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.commonEventOrNull(): CommonEvent? = this as? CommonEvent @@ -3195,7 +3429,7 @@ inline fun ChatEvent.commonEventOrNull(): CommonEvent? = this as? CommonEvent inline fun ChatEvent.commonEventOrThrow(): CommonEvent = this as CommonEvent @PreviewFeature -inline fun ChatEvent.ifGroupEvent(block: (GroupEvent) -> T) = groupEventOrNull() ?.let(block) +inline fun ChatEvent.ifGroupEvent(block: (GroupEvent) -> T) = groupEventOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.groupEventOrNull(): GroupEvent? = this as? GroupEvent @@ -3204,7 +3438,7 @@ inline fun ChatEvent.groupEventOrNull(): GroupEvent? = this as? GroupEvent inline fun ChatEvent.groupEventOrThrow(): GroupEvent = this as GroupEvent @PreviewFeature -inline fun ChatEvent.ifSupergroupEvent(block: (SupergroupEvent) -> T) = supergroupEventOrNull() ?.let(block) +inline fun ChatEvent.ifSupergroupEvent(block: (SupergroupEvent) -> T) = supergroupEventOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.supergroupEventOrNull(): SupergroupEvent? = this as? SupergroupEvent @@ -3213,7 +3447,7 @@ inline fun ChatEvent.supergroupEventOrNull(): SupergroupEvent? = this as? Superg inline fun ChatEvent.supergroupEventOrThrow(): SupergroupEvent = this as SupergroupEvent @PreviewFeature -inline fun ChatEvent.ifVideoChatEvent(block: (VideoChatEvent) -> T) = videoChatEventOrNull() ?.let(block) +inline fun ChatEvent.ifVideoChatEvent(block: (VideoChatEvent) -> T) = videoChatEventOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.videoChatEventOrNull(): VideoChatEvent? = this as? VideoChatEvent @@ -3222,7 +3456,7 @@ inline fun ChatEvent.videoChatEventOrNull(): VideoChatEvent? = this as? VideoCha inline fun ChatEvent.videoChatEventOrThrow(): VideoChatEvent = this as VideoChatEvent @PreviewFeature -inline fun ChatEvent.ifVideoChatEnded(block: (VideoChatEnded) -> T) = videoChatEndedOrNull() ?.let(block) +inline fun ChatEvent.ifVideoChatEnded(block: (VideoChatEnded) -> T) = videoChatEndedOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.videoChatEndedOrNull(): VideoChatEnded? = this as? VideoChatEnded @@ -3231,7 +3465,8 @@ inline fun ChatEvent.videoChatEndedOrNull(): VideoChatEnded? = this as? VideoCha inline fun ChatEvent.videoChatEndedOrThrow(): VideoChatEnded = this as VideoChatEnded @PreviewFeature -inline fun ChatEvent.ifVideoChatParticipantsInvited(block: (VideoChatParticipantsInvited) -> T) = videoChatParticipantsInvitedOrNull() ?.let(block) +inline fun ChatEvent.ifVideoChatParticipantsInvited(block: (VideoChatParticipantsInvited) -> T) = + videoChatParticipantsInvitedOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.videoChatParticipantsInvitedOrNull(): VideoChatParticipantsInvited? = @@ -3242,7 +3477,7 @@ inline fun ChatEvent.videoChatParticipantsInvitedOrThrow(): VideoChatParticipant this as VideoChatParticipantsInvited @PreviewFeature -inline fun ChatEvent.ifVideoChatStarted(block: (VideoChatStarted) -> T) = videoChatStartedOrNull() ?.let(block) +inline fun ChatEvent.ifVideoChatStarted(block: (VideoChatStarted) -> T) = videoChatStartedOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.videoChatStartedOrNull(): VideoChatStarted? = this as? VideoChatStarted @@ -3251,7 +3486,7 @@ inline fun ChatEvent.videoChatStartedOrNull(): VideoChatStarted? = this as? Vide inline fun ChatEvent.videoChatStartedOrThrow(): VideoChatStarted = this as VideoChatStarted @PreviewFeature -inline fun ChatEvent.ifVideoChatScheduled(block: (VideoChatScheduled) -> T) = videoChatScheduledOrNull() ?.let(block) +inline fun ChatEvent.ifVideoChatScheduled(block: (VideoChatScheduled) -> T) = videoChatScheduledOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.videoChatScheduledOrNull(): VideoChatScheduled? = this as? VideoChatScheduled @@ -3260,7 +3495,7 @@ inline fun ChatEvent.videoChatScheduledOrNull(): VideoChatScheduled? = this as? inline fun ChatEvent.videoChatScheduledOrThrow(): VideoChatScheduled = this as VideoChatScheduled @PreviewFeature -inline fun ChatEvent.ifUserLoggedIn(block: (UserLoggedIn) -> T) = userLoggedInOrNull() ?.let(block) +inline fun ChatEvent.ifUserLoggedIn(block: (UserLoggedIn) -> T) = userLoggedInOrNull()?.let(block) @PreviewFeature inline fun ChatEvent.userLoggedInOrNull(): UserLoggedIn? = this as? UserLoggedIn @@ -3269,7 +3504,7 @@ inline fun ChatEvent.userLoggedInOrNull(): UserLoggedIn? = this as? UserLoggedIn inline fun ChatEvent.userLoggedInOrThrow(): UserLoggedIn = this as UserLoggedIn @PreviewFeature -inline fun CommonSendInvoiceData.ifSendInvoice(block: (SendInvoice) -> T) = sendInvoiceOrNull() ?.let(block) +inline fun CommonSendInvoiceData.ifSendInvoice(block: (SendInvoice) -> T) = sendInvoiceOrNull()?.let(block) @PreviewFeature inline fun CommonSendInvoiceData.sendInvoiceOrNull(): SendInvoice? = this as? SendInvoice @@ -3278,7 +3513,8 @@ inline fun CommonSendInvoiceData.sendInvoiceOrNull(): SendInvoice? = this as? Se inline fun CommonSendInvoiceData.sendInvoiceOrThrow(): SendInvoice = this as SendInvoice @PreviewFeature -inline fun CommonSendInvoiceData.ifCreateInvoiceLink(block: (CreateInvoiceLink) -> T) = createInvoiceLinkOrNull() ?.let(block) +inline fun CommonSendInvoiceData.ifCreateInvoiceLink(block: (CreateInvoiceLink) -> T) = + createInvoiceLinkOrNull()?.let(block) @PreviewFeature inline fun CommonSendInvoiceData.createInvoiceLinkOrNull(): CreateInvoiceLink? = this as? CreateInvoiceLink @@ -3287,7 +3523,8 @@ inline fun CommonSendInvoiceData.createInvoiceLinkOrNull(): CreateInvoiceLink? = inline fun CommonSendInvoiceData.createInvoiceLinkOrThrow(): CreateInvoiceLink = this as CreateInvoiceLink @PreviewFeature -inline fun CommonSendInvoiceData.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T) = inputInvoiceMessageContentOrNull() ?.let(block) +inline fun CommonSendInvoiceData.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T) = + inputInvoiceMessageContentOrNull()?.let(block) @PreviewFeature inline fun CommonSendInvoiceData.inputInvoiceMessageContentOrNull(): InputInvoiceMessageContent? = @@ -3298,7 +3535,7 @@ inline fun CommonSendInvoiceData.inputInvoiceMessageContentOrThrow(): InputInvoi this as InputInvoiceMessageContent @PreviewFeature -inline fun Any.ifFromUser(block: (FromUser) -> T) = fromUserOrNull() ?.let(block) +inline fun Any.ifFromUser(block: (FromUser) -> T) = fromUserOrNull()?.let(block) @PreviewFeature inline fun Any.fromUserOrNull(): FromUser? = this as? FromUser @@ -3307,7 +3544,7 @@ inline fun Any.fromUserOrNull(): FromUser? = this as? FromUser inline fun Any.fromUserOrThrow(): FromUser = this as FromUser @PreviewFeature -inline fun Any.ifWithUser(block: (WithUser) -> T) = withUserOrNull() ?.let(block) +inline fun Any.ifWithUser(block: (WithUser) -> T) = withUserOrNull()?.let(block) @PreviewFeature inline fun Any.withUserOrNull(): WithUser? = this as? WithUser @@ -3316,7 +3553,8 @@ inline fun Any.withUserOrNull(): WithUser? = this as? WithUser inline fun Any.withUserOrThrow(): WithUser = this as WithUser @PreviewFeature -inline fun Any.ifWithOptionalLanguageCode(block: (WithOptionalLanguageCode) -> T) = withOptionalLanguageCodeOrNull() ?.let(block) +inline fun Any.ifWithOptionalLanguageCode(block: (WithOptionalLanguageCode) -> T) = + withOptionalLanguageCodeOrNull()?.let(block) @PreviewFeature inline fun Any.withOptionalLanguageCodeOrNull(): WithOptionalLanguageCode? = this as? WithOptionalLanguageCode @@ -3325,7 +3563,7 @@ inline fun Any.withOptionalLanguageCodeOrNull(): WithOptionalLanguageCode? = thi inline fun Any.withOptionalLanguageCodeOrThrow(): WithOptionalLanguageCode = this as WithOptionalLanguageCode @PreviewFeature -inline fun Location.ifStaticLocation(block: (StaticLocation) -> T) = staticLocationOrNull() ?.let(block) +inline fun Location.ifStaticLocation(block: (StaticLocation) -> T) = staticLocationOrNull()?.let(block) @PreviewFeature inline fun Location.staticLocationOrNull(): StaticLocation? = this as? StaticLocation @@ -3334,7 +3572,7 @@ inline fun Location.staticLocationOrNull(): StaticLocation? = this as? StaticLoc inline fun Location.staticLocationOrThrow(): StaticLocation = this as StaticLocation @PreviewFeature -inline fun Location.ifLiveLocation(block: (LiveLocation) -> T) = liveLocationOrNull() ?.let(block) +inline fun Location.ifLiveLocation(block: (LiveLocation) -> T) = liveLocationOrNull()?.let(block) @PreviewFeature inline fun Location.liveLocationOrNull(): LiveLocation? = this as? LiveLocation @@ -3343,7 +3581,8 @@ inline fun Location.liveLocationOrNull(): LiveLocation? = this as? LiveLocation inline fun Location.liveLocationOrThrow(): LiveLocation = this as LiveLocation @PreviewFeature -inline fun ChatInviteLink.ifPrimaryInviteLink(block: (PrimaryInviteLink) -> T) = primaryInviteLinkOrNull() ?.let(block) +inline fun ChatInviteLink.ifPrimaryInviteLink(block: (PrimaryInviteLink) -> T) = + primaryInviteLinkOrNull()?.let(block) @PreviewFeature inline fun ChatInviteLink.primaryInviteLinkOrNull(): PrimaryInviteLink? = this as? PrimaryInviteLink @@ -3352,7 +3591,8 @@ inline fun ChatInviteLink.primaryInviteLinkOrNull(): PrimaryInviteLink? = this a inline fun ChatInviteLink.primaryInviteLinkOrThrow(): PrimaryInviteLink = this as PrimaryInviteLink @PreviewFeature -inline fun ChatInviteLink.ifSecondaryChatInviteLink(block: (SecondaryChatInviteLink) -> T) = secondaryChatInviteLinkOrNull() ?.let(block) +inline fun ChatInviteLink.ifSecondaryChatInviteLink(block: (SecondaryChatInviteLink) -> T) = + secondaryChatInviteLinkOrNull()?.let(block) @PreviewFeature inline fun ChatInviteLink.secondaryChatInviteLinkOrNull(): SecondaryChatInviteLink? = this as? SecondaryChatInviteLink @@ -3361,25 +3601,32 @@ inline fun ChatInviteLink.secondaryChatInviteLinkOrNull(): SecondaryChatInviteLi inline fun ChatInviteLink.secondaryChatInviteLinkOrThrow(): SecondaryChatInviteLink = this as SecondaryChatInviteLink @PreviewFeature -inline fun ChatInviteLink.ifChatInviteLinkWithJoinRequest(block: (ChatInviteLinkWithJoinRequest) -> T) = chatInviteLinkWithJoinRequestOrNull() ?.let(block) +inline fun ChatInviteLink.ifChatInviteLinkWithJoinRequest(block: (ChatInviteLinkWithJoinRequest) -> T) = + chatInviteLinkWithJoinRequestOrNull()?.let(block) @PreviewFeature -inline fun ChatInviteLink.chatInviteLinkWithJoinRequestOrNull(): ChatInviteLinkWithJoinRequest? = this as? ChatInviteLinkWithJoinRequest +inline fun ChatInviteLink.chatInviteLinkWithJoinRequestOrNull(): ChatInviteLinkWithJoinRequest? = + this as? ChatInviteLinkWithJoinRequest @PreviewFeature -inline fun ChatInviteLink.chatInviteLinkWithJoinRequestOrThrow(): ChatInviteLinkWithJoinRequest = this as ChatInviteLinkWithJoinRequest +inline fun ChatInviteLink.chatInviteLinkWithJoinRequestOrThrow(): ChatInviteLinkWithJoinRequest = + this as ChatInviteLinkWithJoinRequest @PreviewFeature -inline fun ChatInviteLink.ifChatInviteLinkWithLimitedMembers(block: (ChatInviteLinkWithLimitedMembers) -> T) = chatInviteLinkWithLimitedMembersOrNull() ?.let(block) +inline fun ChatInviteLink.ifChatInviteLinkWithLimitedMembers(block: (ChatInviteLinkWithLimitedMembers) -> T) = + chatInviteLinkWithLimitedMembersOrNull()?.let(block) @PreviewFeature -inline fun ChatInviteLink.chatInviteLinkWithLimitedMembersOrNull(): ChatInviteLinkWithLimitedMembers? = this as? ChatInviteLinkWithLimitedMembers +inline fun ChatInviteLink.chatInviteLinkWithLimitedMembersOrNull(): ChatInviteLinkWithLimitedMembers? = + this as? ChatInviteLinkWithLimitedMembers @PreviewFeature -inline fun ChatInviteLink.chatInviteLinkWithLimitedMembersOrThrow(): ChatInviteLinkWithLimitedMembers = this as ChatInviteLinkWithLimitedMembers +inline fun ChatInviteLink.chatInviteLinkWithLimitedMembersOrThrow(): ChatInviteLinkWithLimitedMembers = + this as ChatInviteLinkWithLimitedMembers @PreviewFeature -inline fun ChatInviteLink.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T) = chatInviteLinkUnlimitedOrNull() ?.let(block) +inline fun ChatInviteLink.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T) = + chatInviteLinkUnlimitedOrNull()?.let(block) @PreviewFeature inline fun ChatInviteLink.chatInviteLinkUnlimitedOrNull(): ChatInviteLinkUnlimited? = this as? ChatInviteLinkUnlimited @@ -3388,61 +3635,73 @@ inline fun ChatInviteLink.chatInviteLinkUnlimitedOrNull(): ChatInviteLinkUnlimit inline fun ChatInviteLink.chatInviteLinkUnlimitedOrThrow(): ChatInviteLinkUnlimited = this as ChatInviteLinkUnlimited @PreviewFeature -inline fun ForwardInfo.ifAnonymousForwardInfo(block: (AnonymousForwardInfo) -> T) = anonymousForwardInfoOrNull() ?.let(block) +inline fun ForwardInfo.ifAnonymousForwardInfo(block: (ForwardInfo.ByAnonymous) -> T) = + anonymousForwardInfoOrNull()?.let(block) @PreviewFeature -inline fun ForwardInfo.anonymousForwardInfoOrNull(): AnonymousForwardInfo? = this as? AnonymousForwardInfo +inline fun ForwardInfo.anonymousForwardInfoOrNull(): ForwardInfo.ByAnonymous? = this as? ForwardInfo.ByAnonymous @PreviewFeature -inline fun ForwardInfo.anonymousForwardInfoOrThrow(): AnonymousForwardInfo = this as AnonymousForwardInfo +inline fun ForwardInfo.anonymousForwardInfoOrThrow(): ForwardInfo.ByAnonymous = this as ForwardInfo.ByAnonymous @PreviewFeature -inline fun ForwardInfo.ifUserForwardInfo(block: (UserForwardInfo) -> T) = userForwardInfoOrNull() ?.let(block) +inline fun ForwardInfo.ifUserForwardInfo(block: (ForwardInfo.ByUser) -> T) = userForwardInfoOrNull()?.let(block) @PreviewFeature -inline fun ForwardInfo.userForwardInfoOrNull(): UserForwardInfo? = this as? UserForwardInfo +inline fun ForwardInfo.userForwardInfoOrNull(): ForwardInfo.ByUser? = this as? ForwardInfo.ByUser @PreviewFeature -inline fun ForwardInfo.userForwardInfoOrThrow(): UserForwardInfo = this as UserForwardInfo +inline fun ForwardInfo.userForwardInfoOrThrow(): ForwardInfo.ByUser = this as ForwardInfo.ByUser @PreviewFeature -inline fun ForwardInfo.ifForwardFromPublicChatInfo(block: (ForwardFromPublicChatInfo) -> T) = forwardFromPublicChatInfoOrNull() ?.let(block) +inline fun ForwardInfo.ifForwardFromPublicChatInfo(block: (ForwardInfo.PublicChat) -> T) = + forwardFromPublicChatInfoOrNull()?.let(block) @PreviewFeature -inline fun ForwardInfo.forwardFromPublicChatInfoOrNull(): ForwardFromPublicChatInfo? = this as? ForwardFromPublicChatInfo +inline fun ForwardInfo.forwardFromPublicChatInfoOrNull(): ForwardInfo.PublicChat? = + this as? ForwardInfo.PublicChat @PreviewFeature -inline fun ForwardInfo.forwardFromPublicChatInfoOrThrow(): ForwardFromPublicChatInfo = this as ForwardFromPublicChatInfo +inline fun ForwardInfo.forwardFromPublicChatInfoOrThrow(): ForwardInfo.PublicChat = this as ForwardInfo.PublicChat @PreviewFeature -inline fun ForwardInfo.ifForwardFromChannelInfo(block: (ForwardFromPublicChatInfo.FromChannel) -> T) = forwardFromChannelInfoOrNull() ?.let(block) +inline fun ForwardInfo.ifForwardFromChannelInfo(block: (ForwardInfo.PublicChat.FromChannel) -> T) = + forwardFromChannelInfoOrNull()?.let(block) @PreviewFeature -inline fun ForwardInfo.forwardFromChannelInfoOrNull(): ForwardFromPublicChatInfo.FromChannel? = this as? ForwardFromPublicChatInfo.FromChannel +inline fun ForwardInfo.forwardFromChannelInfoOrNull(): ForwardInfo.PublicChat.FromChannel? = + this as? ForwardInfo.PublicChat.FromChannel @PreviewFeature -inline fun ForwardInfo.forwardFromChannelInfoOrThrow(): ForwardFromPublicChatInfo.FromChannel = this as ForwardFromPublicChatInfo.FromChannel +inline fun ForwardInfo.forwardFromChannelInfoOrThrow(): ForwardInfo.PublicChat.FromChannel = + this as ForwardInfo.PublicChat.FromChannel @PreviewFeature -inline fun ForwardInfo.ifForwardSentByChannelInfo(block: (ForwardFromPublicChatInfo.SentByChannel) -> T) = forwardSentByChannelInfoOrNull() ?.let(block) +inline fun ForwardInfo.ifForwardSentByChannelInfo(block: (ForwardInfo.PublicChat.SentByChannel) -> T) = + forwardSentByChannelInfoOrNull()?.let(block) @PreviewFeature -inline fun ForwardInfo.forwardSentByChannelInfoOrNull(): ForwardFromPublicChatInfo.SentByChannel? = this as? ForwardFromPublicChatInfo.SentByChannel +inline fun ForwardInfo.forwardSentByChannelInfoOrNull(): ForwardInfo.PublicChat.SentByChannel? = + this as? ForwardInfo.PublicChat.SentByChannel @PreviewFeature -inline fun ForwardInfo.forwardSentByChannelInfoOrThrow(): ForwardFromPublicChatInfo.SentByChannel = this as ForwardFromPublicChatInfo.SentByChannel +inline fun ForwardInfo.forwardSentByChannelInfoOrThrow(): ForwardInfo.PublicChat.SentByChannel = + this as ForwardInfo.PublicChat.SentByChannel @PreviewFeature -inline fun ForwardInfo.ifForwardFromSupergroupInfo(block: (ForwardFromPublicChatInfo.FromSupergroup) -> T) = forwardFromSupergroupInfoOrNull() ?.let(block) +inline fun ForwardInfo.ifForwardFromSupergroupInfo(block: (ForwardInfo.PublicChat.FromSupergroup) -> T) = + forwardFromSupergroupInfoOrNull()?.let(block) @PreviewFeature -inline fun ForwardInfo.forwardFromSupergroupInfoOrNull(): ForwardFromPublicChatInfo.FromSupergroup? = this as? ForwardFromPublicChatInfo.FromSupergroup +inline fun ForwardInfo.forwardFromSupergroupInfoOrNull(): ForwardInfo.PublicChat.FromSupergroup? = + this as? ForwardInfo.PublicChat.FromSupergroup @PreviewFeature -inline fun ForwardInfo.forwardFromSupergroupInfoOrThrow(): ForwardFromPublicChatInfo.FromSupergroup = this as ForwardFromPublicChatInfo.FromSupergroup +inline fun ForwardInfo.forwardFromSupergroupInfoOrThrow(): ForwardInfo.PublicChat.FromSupergroup = + this as ForwardInfo.PublicChat.FromSupergroup @PreviewFeature -inline fun MessageContent.ifTextedInput(block: (TextedInput) -> T) = textedInputOrNull() ?.let(block) +inline fun MessageContent.ifTextedInput(block: (TextedInput) -> T) = textedInputOrNull()?.let(block) @PreviewFeature inline fun MessageContent.textedInputOrNull(): TextedInput? = this as? TextedInput @@ -3451,34 +3710,44 @@ inline fun MessageContent.textedInputOrNull(): TextedInput? = this as? TextedInp inline fun MessageContent.textedInputOrThrow(): TextedInput = this as TextedInput @PreviewFeature -inline fun ScheduledCloseInfo.ifExactScheduledCloseInfo(block: (ExactScheduledCloseInfo) -> T) = exactScheduledCloseInfoOrNull() ?.let(block) +inline fun ScheduledCloseInfo.ifExactScheduledCloseInfo(block: (ExactScheduledCloseInfo) -> T) = + exactScheduledCloseInfoOrNull()?.let(block) @PreviewFeature -inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrNull(): ExactScheduledCloseInfo? = this as? ExactScheduledCloseInfo +inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrNull(): ExactScheduledCloseInfo? = + this as? ExactScheduledCloseInfo @PreviewFeature -inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrThrow(): ExactScheduledCloseInfo = this as ExactScheduledCloseInfo +inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrThrow(): ExactScheduledCloseInfo = + this as ExactScheduledCloseInfo @PreviewFeature -inline fun ScheduledCloseInfo.ifApproximateScheduledCloseInfo(block: (ApproximateScheduledCloseInfo) -> T) = approximateScheduledCloseInfoOrNull() ?.let(block) +inline fun ScheduledCloseInfo.ifApproximateScheduledCloseInfo(block: (ApproximateScheduledCloseInfo) -> T) = + approximateScheduledCloseInfoOrNull()?.let(block) @PreviewFeature -inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrNull(): ApproximateScheduledCloseInfo? = this as? ApproximateScheduledCloseInfo +inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrNull(): ApproximateScheduledCloseInfo? = + this as? ApproximateScheduledCloseInfo @PreviewFeature -inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrThrow(): ApproximateScheduledCloseInfo = this as ApproximateScheduledCloseInfo +inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrThrow(): ApproximateScheduledCloseInfo = + this as ApproximateScheduledCloseInfo @PreviewFeature -inline fun ChosenInlineResult.ifLocationChosenInlineResult(block: (LocationChosenInlineResult) -> T) = locationChosenInlineResultOrNull() ?.let(block) +inline fun ChosenInlineResult.ifLocationChosenInlineResult(block: (LocationChosenInlineResult) -> T) = + locationChosenInlineResultOrNull()?.let(block) @PreviewFeature -inline fun ChosenInlineResult.locationChosenInlineResultOrNull(): LocationChosenInlineResult? = this as? LocationChosenInlineResult +inline fun ChosenInlineResult.locationChosenInlineResultOrNull(): LocationChosenInlineResult? = + this as? LocationChosenInlineResult @PreviewFeature -inline fun ChosenInlineResult.locationChosenInlineResultOrThrow(): LocationChosenInlineResult = this as LocationChosenInlineResult +inline fun ChosenInlineResult.locationChosenInlineResultOrThrow(): LocationChosenInlineResult = + this as LocationChosenInlineResult @PreviewFeature -inline fun ChosenInlineResult.ifBaseChosenInlineResult(block: (BaseChosenInlineResult) -> T) = baseChosenInlineResultOrNull() ?.let(block) +inline fun ChosenInlineResult.ifBaseChosenInlineResult(block: (BaseChosenInlineResult) -> T) = + baseChosenInlineResultOrNull()?.let(block) @PreviewFeature inline fun ChosenInlineResult.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this as? BaseChosenInlineResult From be74249b67866e1cd24ace57890d3260a2573766 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 5 Aug 2022 01:48:44 +0600 Subject: [PATCH 09/17] Update README.md --- README.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cdc25d9127..57749cc97f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,17 @@ # TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-6.1-blue)](https://core.telegram.org/bots/api-changelog#june-20-2022) -| [![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin) [![Build Status](https://github.com/InsanusMokrassar/TelegramBotAPI/workflows/Build/badge.svg)](https://github.com/InsanusMokrassar/TelegramBotAPI/actions) [![Small survey](https://img.shields.io/static/v1?label=Google&message=Survey&color=blue&logo=google-sheets)](https://docs.google.com/forms/d/e/1FAIpQLSctdJHT_aEniyYT0-IUAEfo1hsIlezX2owlkEAYX4KPl2V2_A/viewform?usp=sf_link) [![Chat in Telegram](https://img.shields.io/static/v1?label=Telegram&message=Chat&color=blue&logo=telegram)](https://t.me/InMoTelegramBotAPI) | -|:---:| -| [![Create bot](https://img.shields.io/static/v1?label=Github&message=Template&color=blue&logo=github)](https://github.com/InsanusMokrassar/TelegramBotAPI-bot_template/generate) [![Examples](https://img.shields.io/static/v1?label=Github&message=Examples&color=blue&logo=github)](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/) [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Bookstack&message=Tutorial&color=blue&logo=bookstack)](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) | -| [![Telegram Channel](./resources/tg_channel_qr.jpg)](https://t.me/InMoTelegramBotAPI) | +| Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Bookstack&message=Tutorial&color=blue&logo=bookstack)](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) | +|:---:|:---:| +| Useful repos | [![Create bot](https://img.shields.io/static/v1?label=Github&message=Template&color=blue&logo=github)](https://github.com/InsanusMokrassar/TelegramBotAPI-bot_template/generate) [![Examples](https://img.shields.io/static/v1?label=Github&message=Examples&color=blue&logo=github)](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/) | +| Misc | [![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin) [![Small survey](https://img.shields.io/static/v1?label=Google&message=Survey&color=blue&logo=google-sheets)](https://docs.google.com/forms/d/e/1FAIpQLSctdJHT_aEniyYT0-IUAEfo1hsIlezX2owlkEAYX4KPl2V2_A/viewform?usp=sf_link) | + + + +

+ + + +

Hello! This is a set of libraries for working with Telegram Bot API. From d8f6429385f7d987d503d68a6c0260f4e97cc8a4 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 5 Aug 2022 11:47:39 +0600 Subject: [PATCH 10/17] solution for #636 --- CHANGELOG.md | 4 + .../extensions/api/LiveFlowLocation.kt | 151 +++++++++++++ .../tgbotapi/extensions/api/send/Replies.kt | 80 +++++++ .../extensions/api/send/SendLiveLocation.kt | 212 ++++++++++++++++++ ...{SendLocation.kt => SendStaticLocation.kt} | 9 +- .../tgbotapi/abstracts/types/ReplyMarkup.kt | 7 - .../abstracts/types/WithReplyMarkup.kt | 9 + .../dev/inmo/tgbotapi/requests/StopPoll.kt | 4 +- .../edit/abstracts/EditReplyMessage.kt | 4 +- .../ReplyingMarkupSendMessageRequest.kt | 4 +- .../tgbotapi/requests/send/games/SendGame.kt | 4 +- .../requests/send/payments/SendInvoice.kt | 2 +- 12 files changed, 470 insertions(+), 20 deletions(-) create mode 100644 tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt create mode 100644 tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLiveLocation.kt rename tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/{SendLocation.kt => SendStaticLocation.kt} (97%) delete mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/ReplyMarkup.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/WithReplyMarkup.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index cca4e68fe3..3595948b27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ ## 2.2.2 +* `Core`: + * Interface `ReplyMakrup` has been renamed to `WithReplyMarkup` to correspond its purpose +* `API`: + * New API (`handleLiveLocation`) for live location streaming using `Flow` * `Utils`: * `buildEntities` now is inline * `Behaviour Builder`: diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt new file mode 100644 index 0000000000..6caa782d64 --- /dev/null +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt @@ -0,0 +1,151 @@ +package dev.inmo.tgbotapi.extensions.api + +import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob +import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions +import dev.inmo.tgbotapi.abstracts.* +import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup +import dev.inmo.tgbotapi.bot.TelegramBot +import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation +import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation +import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup +import dev.inmo.tgbotapi.types.location.LiveLocation +import dev.inmo.tgbotapi.types.location.Location +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.content.LocationContent +import kotlinx.coroutines.* +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.map +import kotlinx.serialization.Serializable +import kotlin.js.JsName +import kotlin.jvm.JvmName +import kotlin.math.ceil + +@Serializable +data class EditLiveLocationInfo( + override val latitude: Double, + override val longitude: Double, + override val horizontalAccuracy: Meters? = null, + override val heading: Degrees? = null, + override val proximityAlertRadius: Meters? = null, + override val replyMarkup: InlineKeyboardMarkup? = null +) : Locationed, HorizontallyAccured, ProximityAlertable, Headed, WithReplyMarkup + +/** + * Will [sendLiveLocation] with the first [EditLiveLocationInfo] data and update than. Each [liveTimeMillis] passing, + * the message will be sent again and new edits will be applied to the new message + */ +suspend fun TelegramBot.handleLiveLocation( + chatId: ChatIdentifier, + locationsFlow: Flow, + liveTimeMillis: Long = defaultLivePeriodDelayMillis, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null +) { + var currentLiveLocationMessage: ContentMessage? = null + val updateMessageJob = CoroutineScope(currentCoroutineContext().LinkedSupervisorJob()).launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) { + while (isActive) { + delay(liveTimeMillis) + // Remove previous location message info to resend live location message + currentLiveLocationMessage = null + } + } + locationsFlow.collect { + val capturedLiveLocationMessage = currentLiveLocationMessage + if (capturedLiveLocationMessage == null) { + updateMessageJob.start() + currentLiveLocationMessage = sendLiveLocation( + chatId, + it.latitude, + it.longitude, + ceil(liveTimeMillis.toDouble() / 1000).toInt(), + it.horizontalAccuracy, + it.heading, + it.proximityAlertRadius, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply, + it.replyMarkup + ) + } else { + editLiveLocation( + capturedLiveLocationMessage, + it.latitude, + it.longitude, + it.horizontalAccuracy, + it.heading, + it.proximityAlertRadius, + it.replyMarkup + ) + } + } +} + +/** + * Will apply [Flow.map] to the [locationsFlow] to create [EditLiveLocationInfo] and pass the result flow to the + * [handleLiveLocation] with [Flow] typed by [EditLiveLocationInfo] + */ +@JvmName("handleLiveLocationWithLocation") +@JsName("handleLiveLocationWithLocation") +suspend fun TelegramBot.handleLiveLocation( + chatId: ChatIdentifier, + locationsFlow: Flow, + liveTimeMillis: Long = defaultLivePeriodDelayMillis, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null +) { + handleLiveLocation( + chatId, + locationsFlow.map { + EditLiveLocationInfo( + it.latitude, + it.longitude, + it.horizontalAccuracy, + (it as? LiveLocation) ?.heading, + (it as? LiveLocation) ?.proximityAlertRadius, + (it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup + ) + }, + liveTimeMillis, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply + ) +} + +/** + * Will apply [Flow.map] to the [locationsFlow] to create [EditLiveLocationInfo] and pass the result flow to the + * [handleLiveLocation] with [Flow] typed by [EditLiveLocationInfo] + */ +@JvmName("handleLiveLocationWithLatLong") +@JsName("handleLiveLocationWithLatLong") +suspend fun TelegramBot.handleLiveLocation( + chatId: ChatIdentifier, + locationsFlow: Flow>, + liveTimeMillis: Long = defaultLivePeriodDelayMillis, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null +) { + handleLiveLocation( + chatId, + locationsFlow.map { (lat, long) -> + EditLiveLocationInfo( + lat, + long + ) + }, + liveTimeMillis, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply + ) +} diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt index 0bd006aeec..116c1e5387 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/Replies.kt @@ -1,6 +1,8 @@ package dev.inmo.tgbotapi.extensions.api.send +import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup import dev.inmo.tgbotapi.bot.TelegramBot +import dev.inmo.tgbotapi.extensions.api.* import dev.inmo.tgbotapi.extensions.api.send.games.sendGame import dev.inmo.tgbotapi.extensions.api.send.media.* import dev.inmo.tgbotapi.extensions.api.send.payments.sendInvoice @@ -29,6 +31,10 @@ import dev.inmo.tgbotapi.types.payments.abstracts.Currency import dev.inmo.tgbotapi.types.polls.* import dev.inmo.tgbotapi.types.venue.Venue import dev.inmo.tgbotapi.utils.RiskFeature +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.map +import kotlin.js.JsName +import kotlin.jvm.JvmName // Contact @@ -1006,6 +1012,80 @@ suspend fun TelegramBot.reply( ) } +/** + * Will use [handleLiveLocation] with replying to [message] each time new message will be sent by live location update + * + * @see handleLiveLocation + */ +suspend fun TelegramBot.reply( + message: Message, + locationsFlow: Flow, + liveTimeMillis: Long = defaultLivePeriodDelayMillis, + disableNotification: Boolean = false, + protectContent: Boolean = false, + allowSendingWithoutReply: Boolean? = null +) = handleLiveLocation( + message.chat.id, + locationsFlow, + liveTimeMillis, + disableNotification, + protectContent, + message.messageId, + allowSendingWithoutReply +) + +/** + * Will use [handleLiveLocation] with replying to [message] each time new message will be sent by live location update + * + * @see handleLiveLocation + */ +@JvmName("replyLiveLocationWithLocation") +@JsName("replyLiveLocationWithLocation") +suspend fun TelegramBot.reply( + message: Message, + locationsFlow: Flow, + liveTimeMillis: Long = defaultLivePeriodDelayMillis, + disableNotification: Boolean = false, + protectContent: Boolean = false, + allowSendingWithoutReply: Boolean? = null +) { + handleLiveLocation( + message.chat.id, + locationsFlow, + liveTimeMillis, + disableNotification, + protectContent, + message.messageId, + allowSendingWithoutReply + ) +} + +/** + * Will use [handleLiveLocation] with replying to [message] each time new message will be sent by live location update + * + * @see handleLiveLocation + */ +@JvmName("replyLiveLocationWithLatLong") +@JsName("replyLiveLocationWithLatLong") +suspend fun TelegramBot.reply( + message: Message, + locationsFlow: Flow>, + liveTimeMillis: Long = defaultLivePeriodDelayMillis, + disableNotification: Boolean = false, + protectContent: Boolean = false, + allowSendingWithoutReply: Boolean? = null +) { + handleLiveLocation( + message.chat.id, + locationsFlow, + liveTimeMillis, + disableNotification, + protectContent, + message.messageId, + allowSendingWithoutReply + ) +} + suspend fun TelegramBot.reply( to: Message, mediaFile: TelegramMediaFile, diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLiveLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLiveLocation.kt new file mode 100644 index 0000000000..c96e676325 --- /dev/null +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLiveLocation.kt @@ -0,0 +1,212 @@ +package dev.inmo.tgbotapi.extensions.api.send + +import dev.inmo.tgbotapi.bot.TelegramBot +import dev.inmo.tgbotapi.requests.send.SendLiveLocation +import dev.inmo.tgbotapi.requests.send.SendStaticLocation +import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup +import dev.inmo.tgbotapi.types.chat.Chat +import dev.inmo.tgbotapi.types.location.Location +import dev.inmo.tgbotapi.types.location.StaticLocation + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend fun TelegramBot.sendLocation( + chatId: ChatIdentifier, + latitude: Double, + longitude: Double, + livePeriod: Seconds, + horizontalAccuracy: Meters? = null, + heading: Degrees? = null, + proximityAlertRadius: Meters? = null, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendLiveLocation( + chatId, + latitude, + longitude, + livePeriod, + horizontalAccuracy, + heading, + proximityAlertRadius, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup + ) +) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend fun TelegramBot.sendLocation( + chatId: ChatIdentifier, + location: Location, + livePeriod: Seconds, + horizontalAccuracy: Meters? = null, + heading: Degrees? = null, + proximityAlertRadius: Meters? = null, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = sendLocation( + chatId, + location.latitude, + location.longitude, + livePeriod, + horizontalAccuracy, + heading, + proximityAlertRadius, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup +) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend fun TelegramBot.sendLocation( + chat: Chat, + latitude: Double, + longitude: Double, + livePeriod: Seconds, + horizontalAccuracy: Meters? = null, + heading: Degrees? = null, + proximityAlertRadius: Meters? = null, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = sendLocation( + chat.id, + latitude, + longitude, + livePeriod, + horizontalAccuracy, + heading, + proximityAlertRadius, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup +) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend fun TelegramBot.sendLocation( + chat: Chat, + location: Location, + livePeriod: Seconds, + horizontalAccuracy: Meters? = null, + heading: Degrees? = null, + proximityAlertRadius: Meters? = null, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = sendLocation( + chat.id, + location.latitude, + location.longitude, + livePeriod, + horizontalAccuracy, + heading, + proximityAlertRadius, + disableNotification, + protectContent, + replyToMessageId, + allowSendingWithoutReply, + replyMarkup +) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend fun TelegramBot.sendLiveLocation( + chatId: ChatIdentifier, + latitude: Double, + longitude: Double, + livePeriod: Seconds, + horizontalAccuracy: Meters? = null, + heading: Degrees? = null, + proximityAlertRadius: Meters? = null, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = sendLocation(chatId, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend fun TelegramBot.sendLiveLocation( + chatId: ChatIdentifier, + location: Location, + livePeriod: Seconds, + horizontalAccuracy: Meters? = null, + heading: Degrees? = null, + proximityAlertRadius: Meters? = null, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = sendLocation(chatId, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend fun TelegramBot.sendLiveLocation( + chat: Chat, + latitude: Double, + longitude: Double, + livePeriod: Seconds, + horizontalAccuracy: Meters? = null, + heading: Degrees? = null, + proximityAlertRadius: Meters? = null, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = sendLocation(chat.id, latitude, longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) + +/** + * @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or + * [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param + */ +suspend fun TelegramBot.sendLiveLocation( + chat: Chat, + location: Location, + livePeriod: Seconds, + horizontalAccuracy: Meters? = null, + heading: Degrees? = null, + proximityAlertRadius: Meters? = null, + disableNotification: Boolean = false, + protectContent: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = sendLocation(chat.id, location.latitude, location.longitude, livePeriod, horizontalAccuracy, heading, proximityAlertRadius, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendStaticLocation.kt similarity index 97% rename from tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLocation.kt rename to tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendStaticLocation.kt index d571377951..af941fbb0a 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendLocation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendStaticLocation.kt @@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.MessageIdentifier import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat +import dev.inmo.tgbotapi.types.location.Location import dev.inmo.tgbotapi.types.location.StaticLocation /** @@ -40,7 +41,7 @@ suspend fun TelegramBot.sendLocation( */ suspend fun TelegramBot.sendLocation( chatId: ChatIdentifier, - location: StaticLocation, + location: Location, disableNotification: Boolean = false, protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, @@ -87,7 +88,7 @@ suspend fun TelegramBot.sendLocation( */ suspend fun TelegramBot.sendLocation( chat: Chat, - location: StaticLocation, + location: Location, disableNotification: Boolean = false, protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, @@ -125,7 +126,7 @@ suspend fun TelegramBot.sendStaticLocation( */ suspend fun TelegramBot.sendStaticLocation( chatId: ChatIdentifier, - location: StaticLocation, + location: Location, disableNotification: Boolean = false, protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, @@ -154,7 +155,7 @@ suspend fun TelegramBot.sendStaticLocation( */ suspend fun TelegramBot.sendStaticLocation( chat: Chat, - location: StaticLocation, + location: Location, disableNotification: Boolean = false, protectContent: Boolean = false, allowSendingWithoutReply: Boolean? = null, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/ReplyMarkup.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/ReplyMarkup.kt deleted file mode 100644 index dce59184d8..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/ReplyMarkup.kt +++ /dev/null @@ -1,7 +0,0 @@ -package dev.inmo.tgbotapi.abstracts.types - -import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup - -interface ReplyMarkup { - val replyMarkup: KeyboardMarkup? -} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/WithReplyMarkup.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/WithReplyMarkup.kt new file mode 100644 index 0000000000..3429d822c8 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/WithReplyMarkup.kt @@ -0,0 +1,9 @@ +package dev.inmo.tgbotapi.abstracts.types + +import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup + +interface WithReplyMarkup { + val replyMarkup: KeyboardMarkup? +} +@Deprecated("Renamed", ReplaceWith("WithReplyMarkup", "dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup")) +typealias ReplyMarkup = WithReplyMarkup diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/StopPoll.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/StopPoll.kt index 1078ecf512..5705ec13e9 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/StopPoll.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/StopPoll.kt @@ -1,7 +1,7 @@ package dev.inmo.tgbotapi.requests import dev.inmo.tgbotapi.abstracts.types.MessageAction -import dev.inmo.tgbotapi.abstracts.types.ReplyMarkup +import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup @@ -17,7 +17,7 @@ data class StopPoll( override val messageId: MessageIdentifier, @SerialName(replyMarkupField) override val replyMarkup: InlineKeyboardMarkup? = null -) : MessageAction, SimpleRequest, ReplyMarkup { +) : MessageAction, SimpleRequest, WithReplyMarkup { override fun method(): String = "stopPoll" override val resultDeserializer: DeserializationStrategy get() = PollSerializer diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/abstracts/EditReplyMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/abstracts/EditReplyMessage.kt index 94bc78a3ce..45090bc8b7 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/abstracts/EditReplyMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/abstracts/EditReplyMessage.kt @@ -1,8 +1,8 @@ package dev.inmo.tgbotapi.requests.edit.abstracts -import dev.inmo.tgbotapi.abstracts.types.ReplyMarkup +import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup -interface EditReplyMessage : ReplyMarkup { +interface EditReplyMessage : WithReplyMarkup { override val replyMarkup: InlineKeyboardMarkup? } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/abstracts/ReplyingMarkupSendMessageRequest.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/abstracts/ReplyingMarkupSendMessageRequest.kt index f152390db7..0627d8d8d3 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/abstracts/ReplyingMarkupSendMessageRequest.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/abstracts/ReplyingMarkupSendMessageRequest.kt @@ -1,5 +1,5 @@ package dev.inmo.tgbotapi.requests.send.abstracts -import dev.inmo.tgbotapi.abstracts.types.ReplyMarkup +import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup -interface ReplyingMarkupSendMessageRequest: SendMessageRequest, ReplyMarkup +interface ReplyingMarkupSendMessageRequest: SendMessageRequest, WithReplyMarkup diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/games/SendGame.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/games/SendGame.kt index 93c75b0338..086b69edbf 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/games/SendGame.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/games/SendGame.kt @@ -1,6 +1,6 @@ package dev.inmo.tgbotapi.requests.send.games -import dev.inmo.tgbotapi.abstracts.types.ReplyMarkup +import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup @@ -29,7 +29,7 @@ data class SendGame ( @SerialName(replyMarkupField) override val replyMarkup: KeyboardMarkup? = null ) : SendMessageRequest>, - ReplyMarkup { + WithReplyMarkup { override fun method(): String = "sendGame" override val resultDeserializer: DeserializationStrategy> get() = commonResultDeserializer diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/payments/SendInvoice.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/payments/SendInvoice.kt index a482268ade..0a51fafe4c 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/payments/SendInvoice.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/payments/SendInvoice.kt @@ -72,7 +72,7 @@ data class SendInvoice( ChatRequest, DisableNotification, ReplyMessageId, - ReplyMarkup, + WithReplyMarkup, SendMessageRequest> { override fun method(): String = "sendInvoice" override val resultDeserializer: DeserializationStrategy> From a18eda3db6d03af221e73735950404a3b15514b2 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 5 Aug 2022 16:31:39 +0600 Subject: [PATCH 11/17] add generation of class casts --- build.gradle | 1 + gradle/libs.versions.toml | 10 + settings.gradle | 2 + .../expectations/WaitCallbackQuery.kt | 4 +- .../expectations/WaitChatJoinRequest.kt | 4 +- .../expectations/WaitChosenInlineResult.kt | 6 +- .../expectations/WaitEditedContent.kt | 2 +- .../expectations/WaitEditedContentMessage.kt | 4 +- .../expectations/WaitEventAction.kt | 2 +- .../expectations/WaitEventActionMessages.kt | 2 +- .../expectations/WaitInlineQuery.kt | 4 +- .../expectations/WaitMediaGroup.kt | 2 +- .../expectations/WaitMediaGroupMessages.kt | 4 +- .../expectations/WaitPassportData.kt | 6 +- .../expectations/WaitPollAnswers.kt | 4 +- .../expectations/WaitPollUpdates.kt | 4 +- .../expectations/WaitPreCheckoutQuery.kt | 4 +- .../expectations/WaitShippingQuery.kt | 6 +- .../CallbackQueryTriggers.kt | 4 +- .../ChatJoinRequestTriggers.kt | 4 +- .../ChosenInlineResultTriggers.kt | 4 +- .../triggers_handling/CommandHandling.kt | 4 +- .../CommandHandlingUnhandled.kt | 4 +- .../EditedContentTriggers.kt | 4 +- .../triggers_handling/EventTriggers.kt | 6 +- .../triggers_handling/InlineQueryTriggers.kt | 4 +- .../triggers_handling/MediaGroupTriggers.kt | 4 +- .../triggers_handling/PassportTriggers.kt | 6 +- .../triggers_handling/PollAnswersTriggers.kt | 4 +- .../triggers_handling/PollUpdatesTriggers.kt | 4 +- .../PreCheckoutQueryTriggers.kt | 4 +- .../ShippingQueryTriggers.kt | 4 +- tgbotapi.core/build.gradle | 22 +- .../abstracts/CommonSendInvoiceData.kt | 2 + .../dev/inmo/tgbotapi/abstracts/WithUser.kt | 2 + .../abstracts/InlineQueryResult.kt | 4 +- .../InputMessageContent.kt | 2 + .../inmo/tgbotapi/types/actions/BotAction.kt | 2 + .../InlineKeyboardButton.kt | 2 + .../tgbotapi/types/buttons/KeyboardMarkup.kt | 2 + .../dev/inmo/tgbotapi/types/chat/Abstracts.kt | 2 + .../tgbotapi/types/dice/DiceAnimationType.kt | 2 + .../tgbotapi/types/files/TelegramMediaFile.kt | 2 + .../inmo/tgbotapi/types/location/Location.kt | 2 + .../tgbotapi/types/media/TelegramMedia.kt | 2 + .../message/ChatEvents/LeftChatMember.kt | 5 +- .../message/ChatEvents/abstracts/ChatEvent.kt | 3 + .../tgbotapi/types/message/ForwardInfo.kt | 2 + .../types/message/abstracts/Message.kt | 2 + .../types/message/content/Abstracts.kt | 2 + .../types/message/textsources/TextSource.kt | 2 + .../types/passport/PassportElementError.kt | 2 + .../decrypted/abstracts/SecureValue.kt | 2 + .../abstracts/EncryptedPassportElement.kt | 2 + .../dev/inmo/tgbotapi/types/polls/Poll.kt | 3 + .../tgbotapi/types/update/abstracts/Update.kt | 2 + .../utils/internal/ClassCastsIncluded.kt | 3 + tgbotapi.ksp/lib/build.gradle | 8 + .../commonMain/kotlin/ClassCastsIncluded.kt | 5 + tgbotapi.ksp/processor/build.gradle | 13 + .../src/main/kotlin/ClassCastsFiller.kt | 103 + .../kotlin/TelegramBotAPISymbolProcessor.kt | 65 + .../TelegramBotAPISymbolProcessorProvider.kt | 14 + ...ols.ksp.processing.SymbolProcessorProvider | 1 + .../extensions/utils/ClassCastsNew.kt | 3661 -------------- .../extensions/utils/NewClassCasts.kt | 4451 +++++++++++++++++ 66 files changed, 4798 insertions(+), 3732 deletions(-) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/ClassCastsIncluded.kt create mode 100644 tgbotapi.ksp/lib/build.gradle create mode 100644 tgbotapi.ksp/lib/src/commonMain/kotlin/ClassCastsIncluded.kt create mode 100644 tgbotapi.ksp/processor/build.gradle create mode 100644 tgbotapi.ksp/processor/src/main/kotlin/ClassCastsFiller.kt create mode 100644 tgbotapi.ksp/processor/src/main/kotlin/TelegramBotAPISymbolProcessor.kt create mode 100644 tgbotapi.ksp/processor/src/main/kotlin/TelegramBotAPISymbolProcessorProvider.kt create mode 100644 tgbotapi.ksp/processor/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider create mode 100644 tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/NewClassCasts.kt diff --git a/build.gradle b/build.gradle index 6b49962838..8be94d48a0 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,7 @@ buildscript { dependencies { classpath libs.kotlin.gradle.plugin + classpath libs.kotlin.ksp.plugin classpath libs.kotlin.serialization.plugin classpath libs.kotlin.dokka.plugin classpath libs.github.release.plugin diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ddaa75685b..3674f3a5cc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,6 +10,9 @@ korlibs = "3.0.0" uuid = "0.5.0" ktor = "2.0.3" +ksp = "1.7.10-1.0.6" +kotlin-poet = "1.12.0" + microutils = "0.12.0" github-release-plugin = "2.4.1" @@ -45,14 +48,21 @@ microutils-languageCodes = { module = "dev.inmo:micro_utils.language_codes", ver microutils-ktor-common = { module = "dev.inmo:micro_utils.ktor.common", version.ref = "microutils" } microutils-fsm-common = { module = "dev.inmo:micro_utils.fsm.common", version.ref = "microutils" } +# ksp dependencies + +kotlin-poet = { module = "com.squareup:kotlinpoet-ksp", version.ref = "kotlin-poet" } +ksp = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" } + # buildscript classpaths kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +kotlin-ksp-plugin = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "ksp" } kotlin-serialization-plugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" } kotlin-dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "kotlin" } github-release-plugin = { module = "com.github.breadmoirai:github-release", version.ref = "github-release-plugin" } [plugins] +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } diff --git a/settings.gradle b/settings.gradle index 6cf2139f0b..d8603ea158 100644 --- a/settings.gradle +++ b/settings.gradle @@ -12,6 +12,8 @@ pluginManagement { } include ":tgbotapi.core" +include ":tgbotapi.ksp:processor" +include ":tgbotapi.ksp:lib" include ":tgbotapi.api" include ":tgbotapi.utils" include ":tgbotapi.behaviour_builder" diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQuery.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQuery.kt index 9266cab99a..21f7a5b278 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQuery.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQuery.kt @@ -4,7 +4,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.asCallbackQueryUpdate +import dev.inmo.tgbotapi.extensions.utils.callbackQueryUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.queries.callback.* import dev.inmo.tgbotapi.utils.RiskFeature @@ -22,7 +22,7 @@ suspend inline fun BehaviourContext.waitCallbackQueries( initRequest, errorFactory ) { - (it.asCallbackQueryUpdate() ?.data as O).let(::listOfNotNull) + (it.callbackQueryUpdateOrNull() ?.data as O).let(::listOfNotNull) } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChatJoinRequest.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChatJoinRequest.kt index ef253dd339..a7ccf06d3a 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChatJoinRequest.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChatJoinRequest.kt @@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.asChatJoinRequestUpdate +import dev.inmo.tgbotapi.extensions.utils.chatJoinRequestUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.chat.ChatJoinRequest import dev.inmo.tgbotapi.utils.RiskFeature @@ -20,7 +20,7 @@ suspend inline fun BehaviourContext.internalWaitChatJoinRequests( initRequest, errorFactory ) { - (it.asChatJoinRequestUpdate() ?.data as? O).let(::listOfNotNull) + (it.chatJoinRequestUpdateOrNull() ?.data as? O).let(::listOfNotNull) } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChosenInlineResult.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChosenInlineResult.kt index 2b5744c174..2c8c812acb 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChosenInlineResult.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChosenInlineResult.kt @@ -1,14 +1,12 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.asChosenInlineResultUpdate +import dev.inmo.tgbotapi.extensions.utils.chosenInlineResultUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.* import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.toList typealias ChosenInlineResultMapper = suspend T.() -> T? @@ -20,7 +18,7 @@ suspend inline fun BehaviourContext.waitChosenInlineResults( initRequest, errorFactory ) { - (it.asChosenInlineResultUpdate() ?.data as? O).let(::listOfNotNull) + (it.chosenInlineResultUpdateOrNull() ?.data as? O).let(::listOfNotNull) } suspend fun BehaviourContext.waitChosenInlineResult( diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContent.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContent.kt index 2ca4af7fbb..0a48994147 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContent.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContent.kt @@ -4,7 +4,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.asCommonMessage +import dev.inmo.tgbotapi.extensions.utils.commonMessageOrNull import dev.inmo.tgbotapi.extensions.utils.withContent import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentMessage.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentMessage.kt index 69d9b1b16f..74961d206e 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentMessage.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentMessage.kt @@ -4,7 +4,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.asCommonMessage +import dev.inmo.tgbotapi.extensions.utils.commonMessageOrNull import dev.inmo.tgbotapi.extensions.utils.withContent import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage @@ -32,7 +32,7 @@ suspend inline fun BehaviourContext.waitEditedConte ) { val messages = when (it) { is BaseEditMessageUpdate -> { - val commonMessage = it.data.asCommonMessage() ?: return@expectFlow emptyList() + val commonMessage = it.data.commonMessageOrNull() ?: return@expectFlow emptyList() if (commonMessage !is MediaGroupMessage<*> || includeMediaGroups) { listOf(commonMessage) } else { 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 414fd7b4a1..20087fdf40 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 @@ -27,7 +27,7 @@ suspend inline fun BehaviourContext.waitEvents( initRequest, errorFactory ) { - it.asBaseSentMessageUpdate() ?.data ?.asChatEventMessage() ?.withEvent() ?.chatEvent.let(::listOfNotNull) + it.baseSentMessageUpdateOrNull() ?.data ?.chatEventMessageOrNull() ?.withEvent() ?.chatEvent.let(::listOfNotNull) } suspend fun BehaviourContext.waitChannelEvents( 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 f01530cf21..4d76053c72 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 @@ -25,7 +25,7 @@ suspend inline fun BehaviourContext.waitEventsMessages( initRequest, errorFactory ) { - it.asBaseSentMessageUpdate() ?.data ?.asChatEventMessage() ?.withEvent().let(::listOfNotNull) + it.baseSentMessageUpdateOrNull() ?.data ?.chatEventMessageOrNull() ?.withEvent().let(::listOfNotNull) } suspend fun BehaviourContext.waitChannelEventsMessages( diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitInlineQuery.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitInlineQuery.kt index 8c6c5bc393..8db88e0239 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitInlineQuery.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitInlineQuery.kt @@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.asInlineQueryUpdate +import dev.inmo.tgbotapi.extensions.utils.inlineQueryUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.InlineQueries.query.* import dev.inmo.tgbotapi.utils.RiskFeature @@ -20,7 +20,7 @@ suspend inline fun BehaviourContext.waitInlineQueries( initRequest, errorFactory ) { - (it.asInlineQueryUpdate() ?.data as? O).let(::listOfNotNull) + (it.inlineQueryUpdateOrNull() ?.data as? O).let(::listOfNotNull) } suspend fun BehaviourContext.waitAnyInlineQuery( diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroup.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroup.kt index 542f7a7d46..2be7987192 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroup.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroup.kt @@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.asSentMediaGroupUpdate +import dev.inmo.tgbotapi.extensions.utils.sentMediaGroupUpdateOrNull import dev.inmo.tgbotapi.extensions.utils.withContent import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroupMessages.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroupMessages.kt index 29f03d276e..5c1f9ad4d1 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroupMessages.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroupMessages.kt @@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.asSentMediaGroupUpdate +import dev.inmo.tgbotapi.extensions.utils.sentMediaGroupUpdateOrNull import dev.inmo.tgbotapi.extensions.utils.withContent import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage @@ -20,7 +20,7 @@ suspend inline fun BehaviourContext.buildMediaGr initRequest: Request<*>? = null, noinline errorFactory: NullableRequestBuilder<*> = { null } ): Flow>> = flowsUpdatesFilter.expectFlow(bot, initRequest, errorFactory) { update -> - update.asSentMediaGroupUpdate() ?.data ?.let { mediaGroup -> + update.sentMediaGroupUpdateOrNull() ?.data ?.let { mediaGroup -> val mapped = mediaGroup.mapNotNull { it.withContent() } listOf( mapped diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPassportData.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPassportData.kt index 2d1c16c90f..4ec369a844 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPassportData.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPassportData.kt @@ -2,8 +2,8 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.asMessageUpdate -import dev.inmo.tgbotapi.extensions.utils.asPassportMessage +import dev.inmo.tgbotapi.extensions.utils.messageUpdateOrNull +import dev.inmo.tgbotapi.extensions.utils.passportMessageOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.PassportMessage import dev.inmo.tgbotapi.types.passport.PassportData @@ -23,7 +23,7 @@ suspend inline fun BehaviourContext.waitP initRequest, errorFactory ) { - it.asMessageUpdate() ?.data ?.asPassportMessage() ?.passportData ?.data ?.filterIsInstance() ?: emptyList() + it.messageUpdateOrNull() ?.data ?.passportMessageOrNull() ?.passportData ?.data ?.filterIsInstance() ?: emptyList() } suspend fun BehaviourContext.waitAnyPassportMessages( diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollAnswers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollAnswers.kt index a59fcccc4b..24e9d674f3 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollAnswers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollAnswers.kt @@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.asPollAnswerUpdate +import dev.inmo.tgbotapi.extensions.utils.pollAnswerUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.polls.PollAnswer import dev.inmo.tgbotapi.utils.RiskFeature @@ -19,5 +19,5 @@ suspend fun BehaviourContext.waitPollAnswers( initRequest, errorFactory ) { - it.asPollAnswerUpdate() ?.data.let(::listOfNotNull) + it.pollAnswerUpdateOrNull() ?.data.let(::listOfNotNull) } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollUpdates.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollUpdates.kt index 1dd9ad044c..4288fa9939 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollUpdates.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollUpdates.kt @@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.asPollUpdate +import dev.inmo.tgbotapi.extensions.utils.pollUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.polls.* import dev.inmo.tgbotapi.utils.RiskFeature @@ -20,7 +20,7 @@ suspend inline fun BehaviourContext.waitPolls( initRequest, errorFactory ) { - (it.asPollUpdate() ?.data as? O).let(::listOfNotNull) + (it.pollUpdateOrNull() ?.data as? O).let(::listOfNotNull) } /** diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPreCheckoutQuery.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPreCheckoutQuery.kt index 0c2fcb5cf3..f0283f3368 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPreCheckoutQuery.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPreCheckoutQuery.kt @@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.asPreCheckoutQueryUpdate +import dev.inmo.tgbotapi.extensions.utils.preCheckoutQueryUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery import dev.inmo.tgbotapi.utils.RiskFeature @@ -19,5 +19,5 @@ suspend fun BehaviourContext.waitPreCheckoutQueries( initRequest, errorFactory ) { - it.asPreCheckoutQueryUpdate() ?.data.let(::listOfNotNull) + it.preCheckoutQueryUpdateOrNull() ?.data.let(::listOfNotNull) } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitShippingQuery.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitShippingQuery.kt index a35a7b9a66..493c6d7beb 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitShippingQuery.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitShippingQuery.kt @@ -1,12 +1,10 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.asShippingQueryUpdate +import dev.inmo.tgbotapi.extensions.utils.shippingQueryUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.payments.ShippingQuery import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.toList typealias ShippingQueryMapper = suspend ShippingQuery.() -> ShippingQuery? @@ -17,5 +15,5 @@ suspend fun BehaviourContext.waitShippingQueries( initRequest, errorFactory ) { - (it.asShippingQueryUpdate() ?.data).let(::listOfNotNull) + (it.shippingQueryUpdateOrNull() ?.data).let(::listOfNotNull) } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt index 49326ae88f..2c2ab5f1a4 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt @@ -9,7 +9,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CallbackQueryFilte import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.* import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserCallbackQueryMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory -import dev.inmo.tgbotapi.extensions.utils.asCallbackQueryUpdate +import dev.inmo.tgbotapi.extensions.utils.callbackQueryUpdateOrNull import dev.inmo.tgbotapi.types.queries.callback.* import dev.inmo.tgbotapi.types.update.abstracts.Update import kotlinx.coroutines.Job @@ -20,7 +20,7 @@ internal suspend inline fun B markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { - (it.asCallbackQueryUpdate() ?.data as? T) ?.let(::listOfNotNull) + (it.callbackQueryUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) } /** diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatJoinRequestTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatJoinRequestTriggers.kt index 90e5f5cbae..71d244e100 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatJoinRequestTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatJoinRequestTriggers.kt @@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.ChatJoinRequestFil import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatChatJoinRequestMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory -import dev.inmo.tgbotapi.extensions.utils.asChatJoinRequestUpdate +import dev.inmo.tgbotapi.extensions.utils.chatJoinRequestUpdateOrNull import dev.inmo.tgbotapi.types.chat.ChatJoinRequest import dev.inmo.tgbotapi.types.update.abstracts.Update @@ -29,5 +29,5 @@ suspend fun BC.onChatJoinRequest( markerFactory: MarkerFactory = ByChatChatJoinRequestMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { - (it.asChatJoinRequestUpdate() ?.data) ?.let(::listOfNotNull) + (it.chatJoinRequestUpdateOrNull() ?.data) ?.let(::listOfNotNull) } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChosenInlineResultTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChosenInlineResultTriggers.kt index f87eacd415..b4f7a00dfa 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChosenInlineResultTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChosenInlineResultTriggers.kt @@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.* import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserIdChosenInlineResultMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory -import dev.inmo.tgbotapi.extensions.utils.asChosenInlineResultUpdate +import dev.inmo.tgbotapi.extensions.utils.chosenInlineResultUpdateOrNull import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.* import dev.inmo.tgbotapi.types.update.abstracts.Update @@ -16,7 +16,7 @@ internal suspend inline fun = ByUserIdChosenInlineResultMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { - (it.asChosenInlineResultUpdate() ?.data as? T) ?.let(::listOfNotNull) + (it.chosenInlineResultUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) } /** diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt index 151d70b47d..4f5417178e 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt @@ -10,7 +10,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByCha import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times -import dev.inmo.tgbotapi.extensions.utils.asBotCommandTextSource +import dev.inmo.tgbotapi.extensions.utils.botCommandTextSourceOrNull import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithParams import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage import dev.inmo.tgbotapi.types.message.content.TextContent @@ -35,7 +35,7 @@ internal suspend fun BC.commandUncounted( true } sizeRequirement && textSources.any { - commandRegex.matches(it.asBotCommandTextSource() ?.command ?: return@any false) + commandRegex.matches(it.botCommandTextSourceOrNull() ?.command ?: return@any false) } }.let { initialFilter ?.times(it) ?: it diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandled.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandled.kt index 9f68928500..0219490400 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandled.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandled.kt @@ -8,7 +8,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByCha import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times -import dev.inmo.tgbotapi.extensions.utils.asBotCommandTextSource +import dev.inmo.tgbotapi.extensions.utils.botCommandTextSourceOrNull import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithParams import dev.inmo.tgbotapi.types.message.content.TextContent import dev.inmo.tgbotapi.types.message.content.TextMessage @@ -33,7 +33,7 @@ suspend fun BC.unhandledCommand( true } sizeRequirement && textSources.any { - val command = it.asBotCommandTextSource() ?.command ?: return@any false + val command = it.botCommandTextSourceOrNull() ?.command ?: return@any false !triggersHolder.handleableCommandsHolder.isHandled(command) } }.let { diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt index 30aaf7cac5..4199ee5ca8 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt @@ -20,7 +20,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CommonMessageFilte import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory -import dev.inmo.tgbotapi.extensions.utils.asEditMessageUpdate +import dev.inmo.tgbotapi.extensions.utils.editMessageUpdateOrNull import dev.inmo.tgbotapi.extensions.utils.withContent import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage @@ -41,7 +41,7 @@ internal suspend inline fun noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { when (it) { - is BaseEditMessageUpdate -> (it.asEditMessageUpdate() ?.data ?.withContent()) + is BaseEditMessageUpdate -> (it.editMessageUpdateOrNull() ?.data ?.withContent()) else -> null } ?.let(::listOfNotNull) } 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 cde6ed010e..db41229f8b 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 @@ -7,8 +7,8 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByCha import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory -import dev.inmo.tgbotapi.extensions.utils.asBaseSentMessageUpdate -import dev.inmo.tgbotapi.extensions.utils.asChatEventMessage +import dev.inmo.tgbotapi.extensions.utils.baseSentMessageUpdateOrNull +import dev.inmo.tgbotapi.extensions.utils.chatEventMessageOrNull import dev.inmo.tgbotapi.types.message.ChatEvents.* import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.ChatEvents.voice.* @@ -24,7 +24,7 @@ internal suspend inline fun BC.on noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { @Suppress("UNCHECKED_CAST") - (it.asBaseSentMessageUpdate() ?.data ?.asChatEventMessage() ?.takeIf { it.chatEvent is T } as? ChatEventMessage) ?.let(::listOfNotNull) + (it.baseSentMessageUpdateOrNull() ?.data ?.chatEventMessageOrNull() ?.takeIf { it.chatEvent is T } as? ChatEventMessage) ?.let(::listOfNotNull) } /** diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt index e850638058..52bc9e271a 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt @@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.InlineQueryFilterB import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserInlineQueryMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory -import dev.inmo.tgbotapi.extensions.utils.asInlineQueryUpdate +import dev.inmo.tgbotapi.extensions.utils.inlineQueryUpdateOrNull import dev.inmo.tgbotapi.types.InlineQueries.query.* import dev.inmo.tgbotapi.types.update.abstracts.Update @@ -15,7 +15,7 @@ internal suspend inline fun BC. markerFactory: MarkerFactory = ByUserInlineQueryMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { - (it.asInlineQueryUpdate() ?.data as? T) ?.let(::listOfNotNull) + (it.inlineQueryUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) } /** diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt index 8e868791df..58efa0cee3 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt @@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessagesFilterByCh import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMediaGroupMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory -import dev.inmo.tgbotapi.extensions.utils.asSentMediaGroupUpdate +import dev.inmo.tgbotapi.extensions.utils.sentMediaGroupUpdateOrNull import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage import dev.inmo.tgbotapi.types.message.content.* import dev.inmo.tgbotapi.types.update.abstracts.Update @@ -20,7 +20,7 @@ internal suspend inline fun >, Any> = ByChatMediaGroupMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver>> ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { - (it.asSentMediaGroupUpdate() ?.data ?.takeIf { messages -> + (it.sentMediaGroupUpdateOrNull() ?.data ?.takeIf { messages -> messages.all { message -> message.content is T } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt index e1705cbf34..b4cd034da8 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt @@ -5,8 +5,8 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByCha import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory -import dev.inmo.tgbotapi.extensions.utils.asMessageUpdate -import dev.inmo.tgbotapi.extensions.utils.asPassportMessage +import dev.inmo.tgbotapi.extensions.utils.messageUpdateOrNull +import dev.inmo.tgbotapi.extensions.utils.passportMessageOrNull import dev.inmo.tgbotapi.types.message.PassportMessage import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement import dev.inmo.tgbotapi.types.update.abstracts.Update @@ -17,7 +17,7 @@ internal suspend inline fun = ByChatMessageMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { - (it.asMessageUpdate() ?.data ?.asPassportMessage() ?.takeIf { it.passportData.data.any { it is T } }) ?.let(::listOfNotNull) + (it.messageUpdateOrNull() ?.data ?.passportMessageOrNull() ?.takeIf { it.passportData.data.any { it is T } }) ?.let(::listOfNotNull) } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollAnswersTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollAnswersTriggers.kt index 549e052426..a09639754b 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollAnswersTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollAnswersTriggers.kt @@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.* import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByIdPollAnswerMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory -import dev.inmo.tgbotapi.extensions.utils.asPollAnswerUpdate +import dev.inmo.tgbotapi.extensions.utils.pollAnswerUpdateOrNull import dev.inmo.tgbotapi.types.polls.PollAnswer import dev.inmo.tgbotapi.types.update.abstracts.Update @@ -16,7 +16,7 @@ internal suspend inline fun BC.onPollAnswered( markerFactory: MarkerFactory = ByIdPollAnswerMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { - (it.asPollAnswerUpdate() ?.data) ?.let(::listOfNotNull) + (it.pollAnswerUpdateOrNull() ?.data) ?.let(::listOfNotNull) } /** diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollUpdatesTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollUpdatesTriggers.kt index f9575de5e7..c9098d600d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollUpdatesTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollUpdatesTriggers.kt @@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.* import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByIdPollMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory -import dev.inmo.tgbotapi.extensions.utils.asPollUpdate +import dev.inmo.tgbotapi.extensions.utils.pollUpdateOrNull import dev.inmo.tgbotapi.types.polls.* import dev.inmo.tgbotapi.types.update.abstracts.Update @@ -16,7 +16,7 @@ internal suspend inline fun BC.onPollU markerFactory: MarkerFactory = ByIdPollMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { - (it.asPollUpdate() ?.data as? T) ?.let(::listOfNotNull) + (it.pollUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) } /** diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PreCheckoutQueryTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PreCheckoutQueryTriggers.kt index 3df37d6f8f..c53f1ecda0 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PreCheckoutQueryTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PreCheckoutQueryTriggers.kt @@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.PreCheckoutQueryFi import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserPreCheckoutQueryMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory -import dev.inmo.tgbotapi.extensions.utils.asPreCheckoutQueryUpdate +import dev.inmo.tgbotapi.extensions.utils.preCheckoutQueryUpdateOrNull import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery import dev.inmo.tgbotapi.types.update.abstracts.Update @@ -31,5 +31,5 @@ suspend fun BC.onPreCheckoutQuery( markerFactory: MarkerFactory = ByUserPreCheckoutQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { - (it.asPreCheckoutQueryUpdate() ?.data) ?.let(::listOfNotNull) + (it.preCheckoutQueryUpdateOrNull() ?.data) ?.let(::listOfNotNull) } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ShippingQueryTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ShippingQueryTriggers.kt index 37cb05be12..1f82cf12cb 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ShippingQueryTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ShippingQueryTriggers.kt @@ -5,7 +5,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.ShippingQueryFilte import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserShippingQueryMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory -import dev.inmo.tgbotapi.extensions.utils.asShippingQueryUpdate +import dev.inmo.tgbotapi.extensions.utils.shippingQueryUpdateOrNull import dev.inmo.tgbotapi.types.payments.ShippingQuery import dev.inmo.tgbotapi.types.update.abstracts.Update @@ -31,5 +31,5 @@ suspend fun BC.onShippingQuery( markerFactory: MarkerFactory = ByUserShippingQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { - (it.asShippingQueryUpdate() ?.data) ?.let(::listOfNotNull) + (it.shippingQueryUpdateOrNull() ?.data) ?.let(::listOfNotNull) } diff --git a/tgbotapi.core/build.gradle b/tgbotapi.core/build.gradle index 00c88b6d62..900d9789c7 100644 --- a/tgbotapi.core/build.gradle +++ b/tgbotapi.core/build.gradle @@ -1,6 +1,7 @@ plugins { id "org.jetbrains.kotlin.multiplatform" id "org.jetbrains.kotlin.plugin.serialization" + id "com.google.devtools.ksp" } project.description = "Core part of tgbotapi with all (and only) required functionality for working with Telegram Bot API" @@ -28,6 +29,8 @@ kotlin { api libs.microutils.languageCodes api libs.ktor.client.core + + api project(":tgbotapi.ksp:lib") } } commonTest { @@ -46,12 +49,15 @@ kotlin { } } } - -// targets.all { -// compilations.all { -// kotlinOptions { -// freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi", "-Xopt-in=kotlin.RequiresOptIn"] -// } -// } -// } +} + +dependencies { + add("kspCommonMainMetadata", project(":tgbotapi.ksp:processor")) + add("kspJvm", project(":tgbotapi.ksp:processor")) +} + +ksp { + arg("cctargetPackage", "dev.inmo.tgbotapi.extensions.utils") + arg("ccoutputFileName", "NewClassCasts") + arg("ccoutputFolder", project(":tgbotapi.utils").file("src/commonMain/kotlin").absolutePath) } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/CommonSendInvoiceData.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/CommonSendInvoiceData.kt index 14c1f8ea76..cd31df05fb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/CommonSendInvoiceData.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/CommonSendInvoiceData.kt @@ -1,8 +1,10 @@ package dev.inmo.tgbotapi.abstracts +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.payments.abstracts.Currencied import dev.inmo.tgbotapi.types.payments.abstracts.Priced +@ClassCastsIncluded interface CommonSendInvoiceData : Titled, Currencied, Priced { val description: String val payload: String diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/WithUser.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/WithUser.kt index 6aeb8100b7..a9e76b96db 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/WithUser.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/WithUser.kt @@ -1,5 +1,6 @@ package dev.inmo.tgbotapi.abstracts +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.chat.User /** @@ -7,6 +8,7 @@ import dev.inmo.tgbotapi.types.chat.User * * @see FromUser */ +@ClassCastsIncluded interface WithUser { val user: User } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult.kt index 9443c09391..3b5ac00da7 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult.kt @@ -1,13 +1,15 @@ package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.serializers.InlineQueryResultSerializer import dev.inmo.tgbotapi.types.InlineQueryIdentifier import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import kotlinx.serialization.Serializable @Serializable(InlineQueryResultSerializer::class) +@ClassCastsIncluded interface InlineQueryResult { val type: String val id: InlineQueryIdentifier val replyMarkup: InlineKeyboardMarkup? -} \ No newline at end of file +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent.kt index e440506ec2..232580cae2 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent.kt @@ -1,7 +1,9 @@ package dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContentSerializer import kotlinx.serialization.Serializable @Serializable(InputMessageContentSerializer::class) +@ClassCastsIncluded sealed interface InputMessageContent diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/actions/BotAction.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/actions/BotAction.kt index 856f3d8899..2ea92aaa72 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/actions/BotAction.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/actions/BotAction.kt @@ -1,6 +1,7 @@ package dev.inmo.tgbotapi.types.actions import dev.inmo.micro_utils.common.Warning +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.utils.RiskFeature import kotlinx.serialization.KSerializer import kotlinx.serialization.Serializable @@ -13,6 +14,7 @@ import kotlinx.serialization.encoding.Encoder * Use BotAction objects realisations to notify user about bot actions */ @Serializable(BotActionSerializer::class) +@ClassCastsIncluded sealed interface BotAction { val actionName: String } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton.kt index 5117b6dfde..cf8ad42c5e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton.kt @@ -1,5 +1,6 @@ package dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.games.CallbackGame import dev.inmo.tgbotapi.types.webapps.WebAppInfo @@ -11,6 +12,7 @@ import kotlinx.serialization.json.* * https://core.telegram.org/bots/api#inlinekeyboardbutton for more info */ @Serializable(InlineKeyboardButtonSerializer::class) +@ClassCastsIncluded sealed interface InlineKeyboardButton { val text: String } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/KeyboardMarkup.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/KeyboardMarkup.kt index 4e008eb84b..afd46e4cff 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/KeyboardMarkup.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/KeyboardMarkup.kt @@ -1,6 +1,8 @@ package dev.inmo.tgbotapi.types.buttons +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import kotlinx.serialization.Serializable @Serializable(KeyboardMarkupSerializer::class) +@ClassCastsIncluded sealed interface KeyboardMarkup diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Abstracts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Abstracts.kt index 0d6bf752e1..04c0b7da44 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Abstracts.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Abstracts.kt @@ -1,5 +1,6 @@ package dev.inmo.tgbotapi.types.chat +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.* import kotlinx.serialization.Serializable @@ -43,6 +44,7 @@ sealed interface AbleToAddInAttachmentMenuChat : Chat { } @Serializable(PreviewChatSerializer::class) +@ClassCastsIncluded sealed interface Chat { val id: ChatId } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/dice/DiceAnimationType.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/dice/DiceAnimationType.kt index 7e34caf55f..1c194eb490 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/dice/DiceAnimationType.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/dice/DiceAnimationType.kt @@ -1,5 +1,6 @@ package dev.inmo.tgbotapi.types.dice +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.utils.RiskFeature import kotlinx.serialization.KSerializer @@ -9,6 +10,7 @@ import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder @Serializable(DiceAnimationTypeSerializer::class) +@ClassCastsIncluded sealed interface DiceAnimationType { val emoji: String val valueLimits: IntRange diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/TelegramMediaFile.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/TelegramMediaFile.kt index b6e04f7e06..1d1e977d76 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/TelegramMediaFile.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/TelegramMediaFile.kt @@ -1,11 +1,13 @@ package dev.inmo.tgbotapi.types.files +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.requests.abstracts.FileId import dev.inmo.tgbotapi.types.FileUniqueId /** * Declare common part of media files in Telegram. Note: it is not representation of JVM `File` type */ +@ClassCastsIncluded sealed interface TelegramMediaFile { val fileId: FileId val fileUniqueId: FileUniqueId diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/location/Location.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/location/Location.kt index 28f09c744b..21724697c6 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/location/Location.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/location/Location.kt @@ -1,6 +1,7 @@ package dev.inmo.tgbotapi.types.location import dev.inmo.tgbotapi.abstracts.* +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.utils.nonstrictJsonFormat import kotlinx.serialization.* @@ -18,6 +19,7 @@ import kotlinx.serialization.json.JsonObject * @see dev.inmo.tgbotapi.extensions.utils.asLiveLocation */ @Serializable(LocationSerializer::class) +@ClassCastsIncluded sealed interface Location : Locationed, HorizontallyAccured @Serializable diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/TelegramMedia.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/TelegramMedia.kt index 2ae7932ede..f8dbf682a4 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/TelegramMedia.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/TelegramMedia.kt @@ -1,9 +1,11 @@ package dev.inmo.tgbotapi.types.media +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.requests.abstracts.InputFile import kotlinx.serialization.Serializable @Serializable(TelegramMediaSerializer::class) +@ClassCastsIncluded sealed interface TelegramMedia { val type: String val file: InputFile diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMember.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMember.kt index ba73e100ae..4d664fcbd0 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMember.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMember.kt @@ -4,6 +4,9 @@ import dev.inmo.tgbotapi.abstracts.WithUser import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PublicChatEvent -data class LeftChatMember( +data class LeftChatMemberEvent( override val user: User ) : PublicChatEvent, WithUser + +@Deprecated("Renamed", ReplaceWith("dev.inmo.tgbotapi.types.message.ChatEvents", "LeftChatMemberEvent")) +typealias LeftChatMember = LeftChatMemberEvent diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent.kt index a3873a9305..cb5523bb17 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent.kt @@ -1,3 +1,6 @@ package dev.inmo.tgbotapi.types.message.ChatEvents.abstracts +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded + +@ClassCastsIncluded interface ChatEvent diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt index b96f35336b..3bdde5c8d5 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ForwardInfo.kt @@ -1,10 +1,12 @@ package dev.inmo.tgbotapi.types.message import dev.inmo.tgbotapi.abstracts.FromUser +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.chat.* import dev.inmo.tgbotapi.types.chat.User +@ClassCastsIncluded sealed interface ForwardInfo { abstract val dateOfOriginal: TelegramDate diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/Message.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/Message.kt index 012164c153..39859a9289 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/Message.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/Message.kt @@ -1,6 +1,7 @@ package dev.inmo.tgbotapi.types.message.abstracts import com.soywiz.klock.DateTime +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.MessageIdentifier import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.RawMessage @@ -9,6 +10,7 @@ import kotlinx.serialization.descriptors.* import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder +@ClassCastsIncluded interface Message { val messageId: MessageIdentifier val chat: Chat diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Abstracts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Abstracts.kt index 857ff558d8..453bef4726 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Abstracts.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Abstracts.kt @@ -1,5 +1,6 @@ package dev.inmo.tgbotapi.types.message.content +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.MessageIdentifier @@ -108,6 +109,7 @@ sealed interface MediaContent: MessageContent { fun asTelegramMedia(): TelegramMedia } +@ClassCastsIncluded sealed interface ResendableContent { fun createResend( chatId: ChatIdentifier, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/textsources/TextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/textsources/TextSource.kt index 092833fa6c..2ae9efcde4 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/textsources/TextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/textsources/TextSource.kt @@ -1,5 +1,6 @@ package dev.inmo.tgbotapi.types.message.textsources +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.captionLength import dev.inmo.tgbotapi.types.textLength import kotlinx.serialization.Serializable @@ -10,6 +11,7 @@ typealias TextSourcesList = List typealias MutableTextSourcesList = MutableList @Serializable(TextSourceSerializer::class) +@ClassCastsIncluded sealed interface TextSource { val markdown: String val markdownV2: String diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/PassportElementError.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/PassportElementError.kt index 74dfc64364..adfcd9d2f3 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/PassportElementError.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/PassportElementError.kt @@ -5,6 +5,7 @@ package dev.inmo.tgbotapi.types.passport import dev.inmo.micro_utils.crypto.MD5 import dev.inmo.micro_utils.crypto.md5 import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.* import dev.inmo.tgbotapi.types.passport.encrypted.type @@ -18,6 +19,7 @@ import kotlinx.serialization.json.* val ByteArray.passportFileHash: MD5 get() = md5() +@ClassCastsIncluded @Serializable(PassportElementErrorSerializer::class) sealed class PassportElementError { abstract val source: String diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue.kt index b9bb54371c..8eaec8b628 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue.kt @@ -1,7 +1,9 @@ package dev.inmo.tgbotapi.types.passport.decrypted.abstracts +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.passport.credentials.EndDataCredentials +@ClassCastsIncluded interface SecureValue { val credentials: List } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement.kt index 6bf1d843df..8ae7705fa2 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement.kt @@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.types.passport.encrypted.abstracts import dev.inmo.micro_utils.crypto.SourceBytes import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonObject @@ -9,6 +10,7 @@ import kotlinx.serialization.json.JsonObject typealias PassportElementHash = SourceBytes @Serializable(EncryptedElementSerializer::class) +@ClassCastsIncluded interface EncryptedPassportElement { val hash: PassportElementHash } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/Poll.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/Poll.kt index 373486a3f5..03a54de345 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/Poll.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/Poll.kt @@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.types.polls import com.soywiz.klock.DateTime import com.soywiz.klock.TimeSpan import dev.inmo.tgbotapi.abstracts.TextedInput +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.* import dev.inmo.tgbotapi.types.message.RawMessageEntity @@ -16,6 +17,7 @@ import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder import kotlinx.serialization.json.* +@ClassCastsIncluded sealed interface ScheduledCloseInfo { val closeDateTime: DateTime } @@ -45,6 +47,7 @@ val LongSeconds.asExactScheduledCloseInfo ) @Serializable(PollSerializer::class) +@ClassCastsIncluded sealed interface Poll { val id: PollIdentifier val question: String diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/update/abstracts/Update.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/update/abstracts/Update.kt index a06e2be315..55c3f42fb3 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/update/abstracts/Update.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/update/abstracts/Update.kt @@ -1,5 +1,6 @@ package dev.inmo.tgbotapi.types.update.abstracts +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded import dev.inmo.tgbotapi.types.UpdateIdentifier import dev.inmo.tgbotapi.types.update.RawUpdate import dev.inmo.tgbotapi.utils.RiskFeature @@ -10,6 +11,7 @@ import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder import kotlinx.serialization.json.JsonElement +@ClassCastsIncluded interface Update { val updateId: UpdateIdentifier val data: Any diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/ClassCastsIncluded.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/ClassCastsIncluded.kt new file mode 100644 index 0000000000..cc46caee80 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/ClassCastsIncluded.kt @@ -0,0 +1,3 @@ +package dev.inmo.tgbotapi.utils.internal + +import dev.inmo.tgbotapi.utils.RiskFeature diff --git a/tgbotapi.ksp/lib/build.gradle b/tgbotapi.ksp/lib/build.gradle new file mode 100644 index 0000000000..05a6c36bde --- /dev/null +++ b/tgbotapi.ksp/lib/build.gradle @@ -0,0 +1,8 @@ +plugins { + id "org.jetbrains.kotlin.multiplatform" +} + +project.description = "Class Casts generator KSP library to include into your library" + +apply from: "$mppProjectWithSerializationPresetPath" +apply from: "$publishGradlePath" diff --git a/tgbotapi.ksp/lib/src/commonMain/kotlin/ClassCastsIncluded.kt b/tgbotapi.ksp/lib/src/commonMain/kotlin/ClassCastsIncluded.kt new file mode 100644 index 0000000000..c0c3a45730 --- /dev/null +++ b/tgbotapi.ksp/lib/src/commonMain/kotlin/ClassCastsIncluded.kt @@ -0,0 +1,5 @@ +package dev.inmo.tgbotapi.ksp.lib + +@Target(AnnotationTarget.CLASS) +@Retention(AnnotationRetention.SOURCE) +annotation class ClassCastsIncluded diff --git a/tgbotapi.ksp/processor/build.gradle b/tgbotapi.ksp/processor/build.gradle new file mode 100644 index 0000000000..985f68a50d --- /dev/null +++ b/tgbotapi.ksp/processor/build.gradle @@ -0,0 +1,13 @@ +plugins { + id "org.jetbrains.kotlin.jvm" +} + +repositories { + mavenCentral() +} + +dependencies { + implementation libs.kotlin.poet + implementation libs.ksp + implementation project(":tgbotapi.ksp:lib") +} diff --git a/tgbotapi.ksp/processor/src/main/kotlin/ClassCastsFiller.kt b/tgbotapi.ksp/processor/src/main/kotlin/ClassCastsFiller.kt new file mode 100644 index 0000000000..6ff48ffec5 --- /dev/null +++ b/tgbotapi.ksp/processor/src/main/kotlin/ClassCastsFiller.kt @@ -0,0 +1,103 @@ +package dev.inmo.tgbotapi.ksp.processor + +import com.google.devtools.ksp.symbol.* +import com.squareup.kotlinpoet.* +import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy +import com.squareup.kotlinpoet.ksp.* + +private fun FileSpec.Builder.addTopLevelImport(className: ClassName) { + className.topLevelClassName().let { + addImport(it.packageName, it.simpleNames) + } +} + +private fun FileSpec.Builder.createTypeDefinition(ksClassDeclaration: KSClassDeclaration): TypeName { + val className = ksClassDeclaration.toClassName() + return if (ksClassDeclaration.typeParameters.isNotEmpty()) { + className.parameterizedBy( + ksClassDeclaration.typeParameters.map { + it.bounds.first().resolve().also { + val typeClassName = it.toClassName() + addTopLevelImport(typeClassName) + }.toTypeName() + } + ) + } else { + className + } +} + +fun FileSpec.Builder.fill( + sourceKSClassDeclaration: KSClassDeclaration, + subtypesMap: Map>, + targetClassDeclaration: KSClassDeclaration = sourceKSClassDeclaration +) { + if (sourceKSClassDeclaration == targetClassDeclaration) { + subtypesMap[sourceKSClassDeclaration] ?.forEach { + fill(sourceKSClassDeclaration, subtypesMap, it) + } + } else { + val sourceClassName = sourceKSClassDeclaration.toClassName() + val targetClassClassName = targetClassDeclaration.toClassName() + val targetClassTypeDefinition = createTypeDefinition(targetClassDeclaration) + val simpleName = targetClassDeclaration.simpleName.asString() + val withFirstLowerCase = simpleName.replaceFirstChar { it.lowercase() } + val castedOrNullName = "${withFirstLowerCase}OrNull" + + addTopLevelImport(targetClassClassName) + addFunction( + FunSpec.builder(castedOrNullName).apply { + receiver(sourceClassName) + addCode( + "return this as? %L", + targetClassTypeDefinition + ) + returns(targetClassTypeDefinition.copy(nullable = true)) + addModifiers(KModifier.INLINE) + }.build() + ) + addFunction( + FunSpec.builder("${withFirstLowerCase}OrThrow").apply { + receiver(sourceClassName) + addCode( + "return this as %L", + targetClassTypeDefinition + ) + returns(targetClassTypeDefinition) + addModifiers(KModifier.INLINE) + }.build() + ) + addFunction( + FunSpec.builder("if$simpleName").apply { + val genericType = TypeVariableName("T", null) + addTypeVariable(genericType) + receiver(sourceClassName) + addParameter( + "block", + LambdaTypeName.get( + null, + targetClassTypeDefinition, + returnType = genericType + ) + ) + addCode( + "return ${castedOrNullName}() ?.let(block)", + targetClassTypeDefinition + ) + returns(genericType.copy(nullable = true)) + addModifiers(KModifier.INLINE) + }.build() + ) + + subtypesMap[targetClassDeclaration] ?.let { + if (it.count { it.classKind == ClassKind.CLASS } > 1) { + it + } else { + it.filter { it.classKind != ClassKind.CLASS } + } + } ?.forEach { + fill(sourceKSClassDeclaration, subtypesMap, it) + fill(targetClassDeclaration, subtypesMap, it) + } + } +} diff --git a/tgbotapi.ksp/processor/src/main/kotlin/TelegramBotAPISymbolProcessor.kt b/tgbotapi.ksp/processor/src/main/kotlin/TelegramBotAPISymbolProcessor.kt new file mode 100644 index 0000000000..9583317566 --- /dev/null +++ b/tgbotapi.ksp/processor/src/main/kotlin/TelegramBotAPISymbolProcessor.kt @@ -0,0 +1,65 @@ +package dev.inmo.tgbotapi.ksp.processor + +import com.google.devtools.ksp.getAllSuperTypes +import com.google.devtools.ksp.processing.* +import com.google.devtools.ksp.symbol.KSAnnotated +import com.google.devtools.ksp.symbol.KSClassDeclaration +import com.squareup.kotlinpoet.FileSpec +import com.squareup.kotlinpoet.ksp.writeTo +import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded +import java.io.File + +class TelegramBotAPISymbolProcessor( + private val codeGenerator: CodeGenerator, + private val targetPackage: String = "", + private val outputFile: String = "Output", + private val outputFolder: String? = null +) : SymbolProcessor { + override fun process(resolver: Resolver): List { + val classes = resolver.getSymbolsWithAnnotation(ClassCastsIncluded::class.qualifiedName!!).filterIsInstance() + val classesSubtypes = mutableMapOf>() + + resolver.getAllFiles().forEach { + it.declarations.forEach { potentialSubtype -> + if (potentialSubtype is KSClassDeclaration) { + val allSupertypes = potentialSubtype.getAllSuperTypes().map { it.declaration } + classes.forEach { + if (it in allSupertypes) { + classesSubtypes.getOrPut(it) { mutableSetOf() }.add(potentialSubtype) + } + } + } + } + } + fun fillWithSealeds(source: KSClassDeclaration, current: KSClassDeclaration = source) { + current.getSealedSubclasses().forEach { + classesSubtypes.getOrPut(source) { mutableSetOf() }.add(it) + fillWithSealeds(source, it) + } + } + classes.forEach { fillWithSealeds(it) } + + val fileSpec = FileSpec.builder( + targetPackage, + outputFile + ).apply { + classes.forEach { + fill( + it, + classesSubtypes.toMap() + ) + } + }.build() + runCatching { + outputFolder ?.also { + File(it).apply { + delete() + runCatching { mkdirs() } + fileSpec.writeTo(this) + } + } ?: fileSpec.writeTo(codeGenerator, false) + } + + return emptyList() + } +} diff --git a/tgbotapi.ksp/processor/src/main/kotlin/TelegramBotAPISymbolProcessorProvider.kt b/tgbotapi.ksp/processor/src/main/kotlin/TelegramBotAPISymbolProcessorProvider.kt new file mode 100644 index 0000000000..a6d4c0e7a9 --- /dev/null +++ b/tgbotapi.ksp/processor/src/main/kotlin/TelegramBotAPISymbolProcessorProvider.kt @@ -0,0 +1,14 @@ +package dev.inmo.tgbotapi.ksp.processor + +import com.google.devtools.ksp.processing.* + +class TelegramBotAPISymbolProcessorProvider : SymbolProcessorProvider { + override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor { + return TelegramBotAPISymbolProcessor( + environment.codeGenerator, + environment.options["cctargetPackage"] ?: "", + environment.options["ccoutputFileName"] ?: "Output", + environment.options["ccoutputFolder"], + ) + } +} diff --git a/tgbotapi.ksp/processor/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider b/tgbotapi.ksp/processor/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider new file mode 100644 index 0000000000..f0b099fb8c --- /dev/null +++ b/tgbotapi.ksp/processor/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider @@ -0,0 +1 @@ +dev.inmo.tgbotapi.ksp.processor.TelegramBotAPISymbolProcessorProvider 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 ec0a9408f1..6227113172 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 @@ -66,3474 +66,6 @@ import dev.inmo.tgbotapi.types.update.abstracts.* import dev.inmo.tgbotapi.types.update.media_group.* import dev.inmo.tgbotapi.utils.PreviewFeature -@PreviewFeature -inline fun Chat.ifBot(block: (Bot) -> T) = botOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.botOrNull(): Bot? = this as? Bot - -@PreviewFeature -inline fun Chat.botOrThrow(): Bot = this as Bot - -@PreviewFeature -inline fun Chat.ifCommonBot(block: (CommonBot) -> T) = commonBotOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.commonBotOrNull(): CommonBot? = this as? CommonBot - -@PreviewFeature -inline fun Chat.commonBotOrThrow(): CommonBot = this as CommonBot - -@PreviewFeature -inline fun Chat.ifCommonUser(block: (CommonUser) -> T) = commonUserOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.commonUserOrNull(): CommonUser? = this as? CommonUser - -@PreviewFeature -inline fun Chat.commonUserOrThrow(): CommonUser = this as CommonUser - -@PreviewFeature -inline fun Chat.ifExtendedBot(block: (ExtendedBot) -> T) = extendedBotOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.extendedBotOrNull(): ExtendedBot? = this as? ExtendedBot - -@PreviewFeature -inline fun Chat.extendedBotOrThrow(): ExtendedBot = this as ExtendedBot - -@PreviewFeature -inline fun Chat.ifUser(block: (User) -> T) = userOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.userOrNull(): User? = this as? User - -@PreviewFeature -inline fun Chat.userOrThrow(): User = this as User - -@PreviewFeature -inline fun Chat.ifChannelChat(block: (ChannelChat) -> T) = channelChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.channelChatOrNull(): ChannelChat? = this as? ChannelChat - -@PreviewFeature -inline fun Chat.channelChatOrThrow(): ChannelChat = this as ChannelChat - -@PreviewFeature -inline fun Chat.ifGroupChat(block: (GroupChat) -> T) = groupChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.groupChatOrNull(): GroupChat? = this as? GroupChat - -@PreviewFeature -inline fun Chat.groupChatOrThrow(): GroupChat = this as GroupChat - -@PreviewFeature -inline fun Chat.ifPrivateChat(block: (PrivateChat) -> T) = privateChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.privateChatOrNull(): PrivateChat? = this as? PrivateChat - -@PreviewFeature -inline fun Chat.privateChatOrThrow(): PrivateChat = this as PrivateChat - -@PreviewFeature -inline fun Chat.ifPublicChat(block: (PublicChat) -> T) = publicChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.publicChatOrNull(): PublicChat? = this as? PublicChat - -@PreviewFeature -inline fun Chat.publicChatOrThrow(): PublicChat = this as PublicChat - -@PreviewFeature -inline fun Chat.ifSuperPublicChat(block: (SuperPublicChat) -> T) = superPublicChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.superPublicChatOrNull(): SuperPublicChat? = this as? SuperPublicChat - -@PreviewFeature -inline fun Chat.superPublicChatOrThrow(): SuperPublicChat = this as SuperPublicChat - -@PreviewFeature -inline fun Chat.ifSupergroupChat(block: (SupergroupChat) -> T) = supergroupChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.supergroupChatOrNull(): SupergroupChat? = this as? SupergroupChat - -@PreviewFeature -inline fun Chat.supergroupChatOrThrow(): SupergroupChat = this as SupergroupChat - -@PreviewFeature -inline fun Chat.ifUnknownChatType(block: (UnknownChatType) -> T) = unknownChatTypeOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.unknownChatTypeOrNull(): UnknownChatType? = this as? UnknownChatType - -@PreviewFeature -inline fun Chat.unknownChatTypeOrThrow(): UnknownChatType = this as UnknownChatType - -@PreviewFeature -inline fun Chat.ifUsernameChat(block: (UsernameChat) -> T) = usernameChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.usernameChatOrNull(): UsernameChat? = this as? UsernameChat - -@PreviewFeature -inline fun Chat.usernameChatOrThrow(): UsernameChat = this as UsernameChat - -@PreviewFeature -inline fun Chat.ifExtendedChannelChat(block: (ExtendedChannelChat) -> T) = extendedChannelChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.extendedChannelChatOrNull(): ExtendedChannelChat? = this as? ExtendedChannelChat - -@PreviewFeature -inline fun Chat.extendedChannelChatOrThrow(): ExtendedChannelChat = this as ExtendedChannelChat - -@PreviewFeature -inline fun Chat.ifExtendedChat(block: (ExtendedChat) -> T) = extendedChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.extendedChatOrNull(): ExtendedChat? = this as? ExtendedChat - -@PreviewFeature -inline fun Chat.extendedChatOrThrow(): ExtendedChat = this as ExtendedChat - -@PreviewFeature -inline fun Chat.ifExtendedGroupChat(block: (ExtendedGroupChat) -> T) = extendedGroupChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.extendedGroupChatOrNull(): ExtendedGroupChat? = this as? ExtendedGroupChat - -@PreviewFeature -inline fun Chat.extendedGroupChatOrThrow(): ExtendedGroupChat = this as ExtendedGroupChat - -@PreviewFeature -inline fun Chat.ifExtendedPrivateChat(block: (ExtendedPrivateChat) -> T) = extendedPrivateChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.extendedPrivateChatOrNull(): ExtendedPrivateChat? = this as? ExtendedPrivateChat - -@PreviewFeature -inline fun Chat.extendedPrivateChatOrThrow(): ExtendedPrivateChat = this as ExtendedPrivateChat - -@PreviewFeature -inline fun Chat.ifExtendedPublicChat(block: (ExtendedPublicChat) -> T) = extendedPublicChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.extendedPublicChatOrNull(): ExtendedPublicChat? = this as? ExtendedPublicChat - -@PreviewFeature -inline fun Chat.extendedPublicChatOrThrow(): ExtendedPublicChat = this as ExtendedPublicChat - -@PreviewFeature -inline fun Chat.ifExtendedSupergroupChat(block: (ExtendedSupergroupChat) -> T) = - extendedSupergroupChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.extendedSupergroupChatOrNull(): ExtendedSupergroupChat? = this as? ExtendedSupergroupChat - -@PreviewFeature -inline fun Chat.extendedSupergroupChatOrThrow(): ExtendedSupergroupChat = this as ExtendedSupergroupChat - -@PreviewFeature -inline fun Chat.ifPossiblyPremiumChat(block: (PossiblyPremiumChat) -> T) = possiblyPremiumChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.possiblyPremiumChatOrNull(): PossiblyPremiumChat? = this as? PossiblyPremiumChat - -@PreviewFeature -inline fun Chat.possiblyPremiumChatOrThrow(): PossiblyPremiumChat = this as PossiblyPremiumChat - -@PreviewFeature -inline fun Chat.ifAbleToAddInAttachmentMenuChat(block: (AbleToAddInAttachmentMenuChat) -> T) = - ableToAddInAttachmentMenuChatOrNull()?.let(block) - -@PreviewFeature -inline fun Chat.ableToAddInAttachmentMenuChatOrNull(): AbleToAddInAttachmentMenuChat? = - this as? AbleToAddInAttachmentMenuChat - -@PreviewFeature -inline fun Chat.ableToAddInAttachmentMenuChatOrThrow(): AbleToAddInAttachmentMenuChat = - this as AbleToAddInAttachmentMenuChat - -@PreviewFeature -inline fun CallbackQuery.ifDataCallbackQuery(block: (DataCallbackQuery) -> T) = - dataCallbackQueryOrNull()?.let(block) - -@PreviewFeature -inline fun CallbackQuery.dataCallbackQueryOrNull(): DataCallbackQuery? = this as? DataCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.dataCallbackQueryOrThrow(): DataCallbackQuery = this as DataCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.ifGameShortNameCallbackQuery(block: (GameShortNameCallbackQuery) -> T) = - gameShortNameCallbackQueryOrNull()?.let(block) - -@PreviewFeature -inline fun CallbackQuery.gameShortNameCallbackQueryOrNull(): GameShortNameCallbackQuery? = - this as? GameShortNameCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.gameShortNameCallbackQueryOrThrow(): GameShortNameCallbackQuery = - this as GameShortNameCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.ifInlineMessageIdCallbackQuery(block: (InlineMessageIdCallbackQuery) -> T) = - inlineMessageIdCallbackQueryOrNull()?.let(block) - -@PreviewFeature -inline fun CallbackQuery.inlineMessageIdCallbackQueryOrNull(): InlineMessageIdCallbackQuery? = - this as? InlineMessageIdCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.inlineMessageIdCallbackQueryOrThrow(): InlineMessageIdCallbackQuery = - this as InlineMessageIdCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.ifInlineMessageIdDataCallbackQuery(block: (InlineMessageIdDataCallbackQuery) -> T) = - inlineMessageIdDataCallbackQueryOrNull()?.let(block) - -@PreviewFeature -inline fun CallbackQuery.inlineMessageIdDataCallbackQueryOrNull(): InlineMessageIdDataCallbackQuery? = - this as? InlineMessageIdDataCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.inlineMessageIdDataCallbackQueryOrThrow(): InlineMessageIdDataCallbackQuery = - this as InlineMessageIdDataCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.ifInlineMessageIdGameShortNameCallbackQuery(block: (InlineMessageIdGameShortNameCallbackQuery) -> T) = - inlineMessageIdGameShortNameCallbackQueryOrNull()?.let(block) - -@PreviewFeature -inline fun CallbackQuery.inlineMessageIdGameShortNameCallbackQueryOrNull(): InlineMessageIdGameShortNameCallbackQuery? = - this as? InlineMessageIdGameShortNameCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.inlineMessageIdGameShortNameCallbackQueryOrThrow(): InlineMessageIdGameShortNameCallbackQuery = - this as InlineMessageIdGameShortNameCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.ifMessageCallbackQuery(block: (MessageCallbackQuery) -> T) = - messageCallbackQueryOrNull()?.let(block) - -@PreviewFeature -inline fun CallbackQuery.messageCallbackQueryOrNull(): MessageCallbackQuery? = this as? MessageCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.messageCallbackQueryOrThrow(): MessageCallbackQuery = this as MessageCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.ifMessageDataCallbackQuery(block: (MessageDataCallbackQuery) -> T) = - messageDataCallbackQueryOrNull()?.let(block) - -@PreviewFeature -inline fun CallbackQuery.messageDataCallbackQueryOrNull(): MessageDataCallbackQuery? = this as? MessageDataCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.messageDataCallbackQueryOrThrow(): MessageDataCallbackQuery = this as MessageDataCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.ifMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T) = - messageGameShortNameCallbackQueryOrNull()?.let(block) - -@PreviewFeature -inline fun CallbackQuery.messageGameShortNameCallbackQueryOrNull(): MessageGameShortNameCallbackQuery? = - this as? MessageGameShortNameCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.messageGameShortNameCallbackQueryOrThrow(): MessageGameShortNameCallbackQuery = - this as MessageGameShortNameCallbackQuery - -@PreviewFeature -inline fun CallbackQuery.ifUnknownCallbackQueryType(block: (UnknownCallbackQueryType) -> T) = - unknownCallbackQueryTypeOrNull()?.let(block) - -@PreviewFeature -inline fun CallbackQuery.unknownCallbackQueryTypeOrNull(): UnknownCallbackQueryType? = this as? UnknownCallbackQueryType - -@PreviewFeature -inline fun CallbackQuery.unknownCallbackQueryTypeOrThrow(): UnknownCallbackQueryType = this as UnknownCallbackQueryType - -@PreviewFeature -inline fun PassportElementError.ifPassportElementErrorDataField(block: (PassportElementErrorDataField) -> T) = - passportElementErrorDataFieldOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.passportElementErrorDataFieldOrNull(): PassportElementErrorDataField? = - this as? PassportElementErrorDataField - -@PreviewFeature -inline fun PassportElementError.passportElementErrorDataFieldOrThrow(): PassportElementErrorDataField = - this as PassportElementErrorDataField - -@PreviewFeature -inline fun PassportElementError.ifPassportElementErrorFile(block: (PassportElementErrorFile) -> T) = - passportElementErrorFileOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.passportElementErrorFileOrNull(): PassportElementErrorFile? = - this as? PassportElementErrorFile - -@PreviewFeature -inline fun PassportElementError.passportElementErrorFileOrThrow(): PassportElementErrorFile = - this as PassportElementErrorFile - -@PreviewFeature -inline fun PassportElementError.ifPassportElementErrorFiles(block: (PassportElementErrorFiles) -> T) = - passportElementErrorFilesOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.passportElementErrorFilesOrNull(): PassportElementErrorFiles? = - this as? PassportElementErrorFiles - -@PreviewFeature -inline fun PassportElementError.passportElementErrorFilesOrThrow(): PassportElementErrorFiles = - this as PassportElementErrorFiles - -@PreviewFeature -inline fun PassportElementError.ifPassportElementErrorFrontSide(block: (PassportElementErrorFrontSide) -> T) = - passportElementErrorFrontSideOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.passportElementErrorFrontSideOrNull(): PassportElementErrorFrontSide? = - this as? PassportElementErrorFrontSide - -@PreviewFeature -inline fun PassportElementError.passportElementErrorFrontSideOrThrow(): PassportElementErrorFrontSide = - this as PassportElementErrorFrontSide - -@PreviewFeature -inline fun PassportElementError.ifPassportElementErrorReverseSide(block: (PassportElementErrorReverseSide) -> T) = - passportElementErrorReverseSideOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.passportElementErrorReverseSideOrNull(): PassportElementErrorReverseSide? = - this as? PassportElementErrorReverseSide - -@PreviewFeature -inline fun PassportElementError.passportElementErrorReverseSideOrThrow(): PassportElementErrorReverseSide = - this as PassportElementErrorReverseSide - -@PreviewFeature -inline fun PassportElementError.ifPassportElementErrorSelfie(block: (PassportElementErrorSelfie) -> T) = - passportElementErrorSelfieOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.passportElementErrorSelfieOrNull(): PassportElementErrorSelfie? = - this as? PassportElementErrorSelfie - -@PreviewFeature -inline fun PassportElementError.passportElementErrorSelfieOrThrow(): PassportElementErrorSelfie = - this as PassportElementErrorSelfie - -@PreviewFeature -inline fun PassportElementError.ifPassportElementErrorTranslationFile(block: (PassportElementErrorTranslationFile) -> T) = - passportElementErrorTranslationFileOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.passportElementErrorTranslationFileOrNull(): PassportElementErrorTranslationFile? = - this as? PassportElementErrorTranslationFile - -@PreviewFeature -inline fun PassportElementError.passportElementErrorTranslationFileOrThrow(): PassportElementErrorTranslationFile = - this as PassportElementErrorTranslationFile - -@PreviewFeature -inline fun PassportElementError.ifPassportElementErrorTranslationFiles(block: (PassportElementErrorTranslationFiles) -> T) = - passportElementErrorTranslationFilesOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.passportElementErrorTranslationFilesOrNull(): PassportElementErrorTranslationFiles? = - this as? PassportElementErrorTranslationFiles - -@PreviewFeature -inline fun PassportElementError.passportElementErrorTranslationFilesOrThrow(): PassportElementErrorTranslationFiles = - this as PassportElementErrorTranslationFiles - -@PreviewFeature -inline fun PassportElementError.ifPassportElementErrorUnspecified(block: (PassportElementErrorUnspecified) -> T) = - passportElementErrorUnspecifiedOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.passportElementErrorUnspecifiedOrNull(): PassportElementErrorUnspecified? = - this as? PassportElementErrorUnspecified - -@PreviewFeature -inline fun PassportElementError.passportElementErrorUnspecifiedOrThrow(): PassportElementErrorUnspecified = - this as PassportElementErrorUnspecified - -@PreviewFeature -inline fun PassportElementError.ifPassportElementFileError(block: (PassportElementFileError) -> T) = - passportElementFileErrorOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.passportElementFileErrorOrNull(): PassportElementFileError? = - this as? PassportElementFileError - -@PreviewFeature -inline fun PassportElementError.passportElementFileErrorOrThrow(): PassportElementFileError = - this as PassportElementFileError - -@PreviewFeature -inline fun PassportElementError.ifPassportElementFilesError(block: (PassportElementFilesError) -> T) = - passportElementFilesErrorOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.passportElementFilesErrorOrNull(): PassportElementFilesError? = - this as? PassportElementFilesError - -@PreviewFeature -inline fun PassportElementError.passportElementFilesErrorOrThrow(): PassportElementFilesError = - this as PassportElementFilesError - -@PreviewFeature -inline fun PassportElementError.ifPassportMultipleElementsError(block: (PassportMultipleElementsError) -> T) = - passportMultipleElementsErrorOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.passportMultipleElementsErrorOrNull(): PassportMultipleElementsError? = - this as? PassportMultipleElementsError - -@PreviewFeature -inline fun PassportElementError.passportMultipleElementsErrorOrThrow(): PassportMultipleElementsError = - this as PassportMultipleElementsError - -@PreviewFeature -inline fun PassportElementError.ifPassportSingleElementError(block: (PassportSingleElementError) -> T) = - passportSingleElementErrorOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.passportSingleElementErrorOrNull(): PassportSingleElementError? = - this as? PassportSingleElementError - -@PreviewFeature -inline fun PassportElementError.passportSingleElementErrorOrThrow(): PassportSingleElementError = - this as PassportSingleElementError - -@PreviewFeature -inline fun PassportElementError.ifUnknownPassportElementError(block: (UnknownPassportElementError) -> T) = - unknownPassportElementErrorOrNull()?.let(block) - -@PreviewFeature -inline fun PassportElementError.unknownPassportElementErrorOrNull(): UnknownPassportElementError? = - this as? UnknownPassportElementError - -@PreviewFeature -inline fun PassportElementError.unknownPassportElementErrorOrThrow(): UnknownPassportElementError = - this as UnknownPassportElementError - -@PreviewFeature -inline fun EncryptedPassportElement.ifBankStatement(block: (BankStatement) -> T) = bankStatementOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.bankStatementOrNull(): BankStatement? = this as? BankStatement - -@PreviewFeature -inline fun EncryptedPassportElement.bankStatementOrThrow(): BankStatement = this as BankStatement - -@PreviewFeature -inline fun EncryptedPassportElement.ifCommonPassport(block: (CommonPassport) -> T) = - commonPassportOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.commonPassportOrNull(): CommonPassport? = this as? CommonPassport - -@PreviewFeature -inline fun EncryptedPassportElement.commonPassportOrThrow(): CommonPassport = this as CommonPassport - -@PreviewFeature -inline fun EncryptedPassportElement.ifDriverLicense(block: (DriverLicense) -> T) = driverLicenseOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.driverLicenseOrNull(): DriverLicense? = this as? DriverLicense - -@PreviewFeature -inline fun EncryptedPassportElement.driverLicenseOrThrow(): DriverLicense = this as DriverLicense - -@PreviewFeature -inline fun EncryptedPassportElement.ifEmail(block: (Email) -> T) = emailOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.emailOrNull(): Email? = this as? Email - -@PreviewFeature -inline fun EncryptedPassportElement.emailOrThrow(): Email = this as Email - -@PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedAddress(block: (EncryptedAddress) -> T) = - encryptedAddressOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedAddressOrNull(): EncryptedAddress? = this as? EncryptedAddress - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedAddressOrThrow(): EncryptedAddress = this as EncryptedAddress - -@PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPersonalDetails(block: (EncryptedPersonalDetails) -> T) = - encryptedPersonalDetailsOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPersonalDetailsOrNull(): EncryptedPersonalDetails? = - this as? EncryptedPersonalDetails - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPersonalDetailsOrThrow(): EncryptedPersonalDetails = - this as EncryptedPersonalDetails - -@PreviewFeature -inline fun EncryptedPassportElement.ifIdentityCard(block: (IdentityCard) -> T) = identityCardOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.identityCardOrNull(): IdentityCard? = this as? IdentityCard - -@PreviewFeature -inline fun EncryptedPassportElement.identityCardOrThrow(): IdentityCard = this as IdentityCard - -@PreviewFeature -inline fun EncryptedPassportElement.ifInternalPassport(block: (InternalPassport) -> T) = - internalPassportOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.internalPassportOrNull(): InternalPassport? = this as? InternalPassport - -@PreviewFeature -inline fun EncryptedPassportElement.internalPassportOrThrow(): InternalPassport = this as InternalPassport - -@PreviewFeature -inline fun EncryptedPassportElement.ifPassport(block: (Passport) -> T) = passportOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.passportOrNull(): Passport? = this as? Passport - -@PreviewFeature -inline fun EncryptedPassportElement.passportOrThrow(): Passport = this as Passport - -@PreviewFeature -inline fun EncryptedPassportElement.ifPassportRegistration(block: (PassportRegistration) -> T) = - passportRegistrationOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.passportRegistrationOrNull(): PassportRegistration? = this as? PassportRegistration - -@PreviewFeature -inline fun EncryptedPassportElement.passportRegistrationOrThrow(): PassportRegistration = this as PassportRegistration - -@PreviewFeature -inline fun EncryptedPassportElement.ifPhoneNumber(block: (PhoneNumber) -> T) = phoneNumberOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.phoneNumberOrNull(): PhoneNumber? = this as? PhoneNumber - -@PreviewFeature -inline fun EncryptedPassportElement.phoneNumberOrThrow(): PhoneNumber = this as PhoneNumber - -@PreviewFeature -inline fun EncryptedPassportElement.ifRentalAgreement(block: (RentalAgreement) -> T) = - rentalAgreementOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.rentalAgreementOrNull(): RentalAgreement? = this as? RentalAgreement - -@PreviewFeature -inline fun EncryptedPassportElement.rentalAgreementOrThrow(): RentalAgreement = this as RentalAgreement - -@PreviewFeature -inline fun EncryptedPassportElement.ifTemporaryRegistration(block: (TemporaryRegistration) -> T) = - temporaryRegistrationOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.temporaryRegistrationOrNull(): TemporaryRegistration? = - this as? TemporaryRegistration - -@PreviewFeature -inline fun EncryptedPassportElement.temporaryRegistrationOrThrow(): TemporaryRegistration = - this as TemporaryRegistration - -@PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithTranslatableFilesCollection(block: (EncryptedPassportElementWithTranslatableFilesCollection) -> T) = - encryptedPassportElementWithTranslatableFilesCollectionOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithTranslatableFilesCollectionOrNull(): EncryptedPassportElementWithTranslatableFilesCollection? = - this as? EncryptedPassportElementWithTranslatableFilesCollection - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithTranslatableFilesCollectionOrThrow(): EncryptedPassportElementWithTranslatableFilesCollection = - this as EncryptedPassportElementWithTranslatableFilesCollection - -@PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithTranslatableIDDocument(block: (EncryptedPassportElementWithTranslatableIDDocument) -> T) = - encryptedPassportElementWithTranslatableIDDocumentOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithTranslatableIDDocumentOrNull(): EncryptedPassportElementWithTranslatableIDDocument? = - this as? EncryptedPassportElementWithTranslatableIDDocument - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithTranslatableIDDocumentOrThrow(): EncryptedPassportElementWithTranslatableIDDocument = - this as EncryptedPassportElementWithTranslatableIDDocument - -@PreviewFeature -inline fun EncryptedPassportElement.ifUtilityBill(block: (UtilityBill) -> T) = utilityBillOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.utilityBillOrNull(): UtilityBill? = this as? UtilityBill - -@PreviewFeature -inline fun EncryptedPassportElement.utilityBillOrThrow(): UtilityBill = this as UtilityBill - -@PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithFilesCollection(block: (EncryptedPassportElementWithFilesCollection) -> T) = - encryptedPassportElementWithFilesCollectionOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithFilesCollectionOrNull(): EncryptedPassportElementWithFilesCollection? = - this as? EncryptedPassportElementWithFilesCollection - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithFilesCollectionOrThrow(): EncryptedPassportElementWithFilesCollection = - this as EncryptedPassportElementWithFilesCollection - -@PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementTranslatable(block: (EncryptedPassportElementTranslatable) -> T) = - encryptedPassportElementTranslatableOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementTranslatableOrNull(): EncryptedPassportElementTranslatable? = - this as? EncryptedPassportElementTranslatable - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementTranslatableOrThrow(): EncryptedPassportElementTranslatable = - this as EncryptedPassportElementTranslatable - -@PreviewFeature -inline fun EncryptedPassportElement.ifUnknownEncryptedPassportElement(block: (UnknownEncryptedPassportElement) -> T) = - unknownEncryptedPassportElementOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.unknownEncryptedPassportElementOrNull(): UnknownEncryptedPassportElement? = - this as? UnknownEncryptedPassportElement - -@PreviewFeature -inline fun EncryptedPassportElement.unknownEncryptedPassportElementOrThrow(): UnknownEncryptedPassportElement = - this as UnknownEncryptedPassportElement - -@PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithData(block: (EncryptedPassportElementWithData) -> T) = - encryptedPassportElementWithDataOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithDataOrNull(): EncryptedPassportElementWithData? = - this as? EncryptedPassportElementWithData - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithDataOrThrow(): EncryptedPassportElementWithData = - this as EncryptedPassportElementWithData - -@PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithEmail(block: (EncryptedPassportElementWithEmail) -> T) = - encryptedPassportElementWithEmailOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithEmailOrNull(): EncryptedPassportElementWithEmail? = - this as? EncryptedPassportElementWithEmail - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithEmailOrThrow(): EncryptedPassportElementWithEmail = - this as EncryptedPassportElementWithEmail - -@PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithFrontSide(block: (EncryptedPassportElementWithFrontSide) -> T) = - encryptedPassportElementWithFrontSideOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithFrontSideOrNull(): EncryptedPassportElementWithFrontSide? = - this as? EncryptedPassportElementWithFrontSide - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithFrontSideOrThrow(): EncryptedPassportElementWithFrontSide = - this as EncryptedPassportElementWithFrontSide - -@PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithPhoneNumber(block: (EncryptedPassportElementWithPhoneNumber) -> T) = - encryptedPassportElementWithPhoneNumberOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithPhoneNumberOrNull(): EncryptedPassportElementWithPhoneNumber? = - this as? EncryptedPassportElementWithPhoneNumber - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithPhoneNumberOrThrow(): EncryptedPassportElementWithPhoneNumber = - this as EncryptedPassportElementWithPhoneNumber - -@PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithReverseSide(block: (EncryptedPassportElementWithReverseSide) -> T) = - encryptedPassportElementWithReverseSideOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithReverseSideOrNull(): EncryptedPassportElementWithReverseSide? = - this as? EncryptedPassportElementWithReverseSide - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithReverseSideOrThrow(): EncryptedPassportElementWithReverseSide = - this as EncryptedPassportElementWithReverseSide - -@PreviewFeature -inline fun EncryptedPassportElement.ifEncryptedPassportElementWithSelfie(block: (EncryptedPassportElementWithSelfie) -> T) = - encryptedPassportElementWithSelfieOrNull()?.let(block) - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithSelfieOrNull(): EncryptedPassportElementWithSelfie? = - this as? EncryptedPassportElementWithSelfie - -@PreviewFeature -inline fun EncryptedPassportElement.encryptedPassportElementWithSelfieOrThrow(): EncryptedPassportElementWithSelfie = - this as EncryptedPassportElementWithSelfie - -@PreviewFeature -inline fun SecureValue.ifAddressSecureValue(block: (AddressSecureValue) -> T) = - addressSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.addressSecureValueOrNull(): AddressSecureValue? = this as? AddressSecureValue - -@PreviewFeature -inline fun SecureValue.addressSecureValueOrThrow(): AddressSecureValue = this as AddressSecureValue - -@PreviewFeature -inline fun SecureValue.ifBankStatementSecureValue(block: (BankStatementSecureValue) -> T) = - bankStatementSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.bankStatementSecureValueOrNull(): BankStatementSecureValue? = this as? BankStatementSecureValue - -@PreviewFeature -inline fun SecureValue.bankStatementSecureValueOrThrow(): BankStatementSecureValue = this as BankStatementSecureValue - -@PreviewFeature -inline fun SecureValue.ifCommonPassportSecureValue(block: (CommonPassportSecureValue) -> T) = - commonPassportSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.commonPassportSecureValueOrNull(): CommonPassportSecureValue? = - this as? CommonPassportSecureValue - -@PreviewFeature -inline fun SecureValue.commonPassportSecureValueOrThrow(): CommonPassportSecureValue = this as CommonPassportSecureValue - -@PreviewFeature -inline fun SecureValue.ifDriverLicenseSecureValue(block: (DriverLicenseSecureValue) -> T) = - driverLicenseSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.driverLicenseSecureValueOrNull(): DriverLicenseSecureValue? = this as? DriverLicenseSecureValue - -@PreviewFeature -inline fun SecureValue.driverLicenseSecureValueOrThrow(): DriverLicenseSecureValue = this as DriverLicenseSecureValue - -@PreviewFeature -inline fun SecureValue.ifIdentityCardSecureValue(block: (IdentityCardSecureValue) -> T) = - identityCardSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.identityCardSecureValueOrNull(): IdentityCardSecureValue? = this as? IdentityCardSecureValue - -@PreviewFeature -inline fun SecureValue.identityCardSecureValueOrThrow(): IdentityCardSecureValue = this as IdentityCardSecureValue - -@PreviewFeature -inline fun SecureValue.ifIdentityWithReverseSideSecureValue(block: (IdentityWithReverseSideSecureValue) -> T) = - identityWithReverseSideSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.identityWithReverseSideSecureValueOrNull(): IdentityWithReverseSideSecureValue? = - this as? IdentityWithReverseSideSecureValue - -@PreviewFeature -inline fun SecureValue.identityWithReverseSideSecureValueOrThrow(): IdentityWithReverseSideSecureValue = - this as IdentityWithReverseSideSecureValue - -@PreviewFeature -inline fun SecureValue.ifInternalPassportSecureValue(block: (InternalPassportSecureValue) -> T) = - internalPassportSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.internalPassportSecureValueOrNull(): InternalPassportSecureValue? = - this as? InternalPassportSecureValue - -@PreviewFeature -inline fun SecureValue.internalPassportSecureValueOrThrow(): InternalPassportSecureValue = - this as InternalPassportSecureValue - -@PreviewFeature -inline fun SecureValue.ifOtherDocumentsSecureValue(block: (OtherDocumentsSecureValue) -> T) = - otherDocumentsSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.otherDocumentsSecureValueOrNull(): OtherDocumentsSecureValue? = - this as? OtherDocumentsSecureValue - -@PreviewFeature -inline fun SecureValue.otherDocumentsSecureValueOrThrow(): OtherDocumentsSecureValue = this as OtherDocumentsSecureValue - -@PreviewFeature -inline fun SecureValue.ifPassportRegistrationSecureValue(block: (PassportRegistrationSecureValue) -> T) = - passportRegistrationSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.passportRegistrationSecureValueOrNull(): PassportRegistrationSecureValue? = - this as? PassportRegistrationSecureValue - -@PreviewFeature -inline fun SecureValue.passportRegistrationSecureValueOrThrow(): PassportRegistrationSecureValue = - this as PassportRegistrationSecureValue - -@PreviewFeature -inline fun SecureValue.ifPassportSecureValue(block: (PassportSecureValue) -> T) = - passportSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.passportSecureValueOrNull(): PassportSecureValue? = this as? PassportSecureValue - -@PreviewFeature -inline fun SecureValue.passportSecureValueOrThrow(): PassportSecureValue = this as PassportSecureValue - -@PreviewFeature -inline fun SecureValue.ifPersonalDetailsSecureValue(block: (PersonalDetailsSecureValue) -> T) = - personalDetailsSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.personalDetailsSecureValueOrNull(): PersonalDetailsSecureValue? = - this as? PersonalDetailsSecureValue - -@PreviewFeature -inline fun SecureValue.personalDetailsSecureValueOrThrow(): PersonalDetailsSecureValue = - this as PersonalDetailsSecureValue - -@PreviewFeature -inline fun SecureValue.ifRentalAgreementSecureValue(block: (RentalAgreementSecureValue) -> T) = - rentalAgreementSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.rentalAgreementSecureValueOrNull(): RentalAgreementSecureValue? = - this as? RentalAgreementSecureValue - -@PreviewFeature -inline fun SecureValue.rentalAgreementSecureValueOrThrow(): RentalAgreementSecureValue = - this as RentalAgreementSecureValue - -@PreviewFeature -inline fun SecureValue.ifTemporalRegistrationSecureValue(block: (TemporalRegistrationSecureValue) -> T) = - temporalRegistrationSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.temporalRegistrationSecureValueOrNull(): TemporalRegistrationSecureValue? = - this as? TemporalRegistrationSecureValue - -@PreviewFeature -inline fun SecureValue.temporalRegistrationSecureValueOrThrow(): TemporalRegistrationSecureValue = - this as TemporalRegistrationSecureValue - -@PreviewFeature -inline fun SecureValue.ifUtilityBillSecureValue(block: (UtilityBillSecureValue) -> T) = - utilityBillSecureValueOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.utilityBillSecureValueOrNull(): UtilityBillSecureValue? = this as? UtilityBillSecureValue - -@PreviewFeature -inline fun SecureValue.utilityBillSecureValueOrThrow(): UtilityBillSecureValue = this as UtilityBillSecureValue - -@PreviewFeature -inline fun SecureValue.ifSecureValueIdentity(block: (SecureValueIdentity) -> T) = - secureValueIdentityOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.secureValueIdentityOrNull(): SecureValueIdentity? = this as? SecureValueIdentity - -@PreviewFeature -inline fun SecureValue.secureValueIdentityOrThrow(): SecureValueIdentity = this as SecureValueIdentity - -@PreviewFeature -inline fun SecureValue.ifSecureValueWithData(block: (SecureValueWithData) -> T) = - secureValueWithDataOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.secureValueWithDataOrNull(): SecureValueWithData? = this as? SecureValueWithData - -@PreviewFeature -inline fun SecureValue.secureValueWithDataOrThrow(): SecureValueWithData = this as SecureValueWithData - -@PreviewFeature -inline fun SecureValue.ifSecureValueWithFiles(block: (SecureValueWithFiles) -> T) = - secureValueWithFilesOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.secureValueWithFilesOrNull(): SecureValueWithFiles? = this as? SecureValueWithFiles - -@PreviewFeature -inline fun SecureValue.secureValueWithFilesOrThrow(): SecureValueWithFiles = this as SecureValueWithFiles - -@PreviewFeature -inline fun SecureValue.ifSecureValueWithReverseSide(block: (SecureValueWithReverseSide) -> T) = - secureValueWithReverseSideOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.secureValueWithReverseSideOrNull(): SecureValueWithReverseSide? = - this as? SecureValueWithReverseSide - -@PreviewFeature -inline fun SecureValue.secureValueWithReverseSideOrThrow(): SecureValueWithReverseSide = - this as SecureValueWithReverseSide - -@PreviewFeature -inline fun SecureValue.ifSecureValueWithTranslations(block: (SecureValueWithTranslations) -> T) = - secureValueWithTranslationsOrNull()?.let(block) - -@PreviewFeature -inline fun SecureValue.secureValueWithTranslationsOrNull(): SecureValueWithTranslations? = - this as? SecureValueWithTranslations - -@PreviewFeature -inline fun SecureValue.secureValueWithTranslationsOrThrow(): SecureValueWithTranslations = - this as SecureValueWithTranslations - -@PreviewFeature -inline fun Message.ifAnonymousGroupContentMessageImpl(block: (AnonymousGroupContentMessageImpl) -> T) = - anonymousGroupContentMessageImplOrNull()?.let(block) - -@PreviewFeature -inline fun Message.anonymousGroupContentMessageImplOrNull(): AnonymousGroupContentMessageImpl? = - this as? AnonymousGroupContentMessageImpl - -@PreviewFeature -inline fun Message.anonymousGroupContentMessageImplOrThrow(): AnonymousGroupContentMessageImpl = - this as AnonymousGroupContentMessageImpl - -@PreviewFeature -inline fun Message.ifChannelContentMessageImpl(block: (UnconnectedFromChannelGroupContentMessageImpl) -> T) = - channelContentMessageImplOrNull()?.let(block) - -@PreviewFeature -inline fun Message.channelContentMessageImplOrNull(): UnconnectedFromChannelGroupContentMessageImpl? = - this as? UnconnectedFromChannelGroupContentMessageImpl - -@PreviewFeature -inline fun Message.channelContentMessageImplOrThrow(): UnconnectedFromChannelGroupContentMessageImpl = - this as UnconnectedFromChannelGroupContentMessageImpl - -@PreviewFeature -inline fun Message.ifPassportMessage(block: (PassportMessage) -> T) = passportMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.passportMessageOrNull(): PassportMessage? = this as? PassportMessage - -@PreviewFeature -inline fun Message.passportMessageOrThrow(): PassportMessage = this as PassportMessage - -@PreviewFeature -inline fun Message.ifPrivateContentMessageImpl(block: (PrivateContentMessageImpl) -> T) = - privateContentMessageImplOrNull()?.let(block) - -@PreviewFeature -inline fun Message.privateContentMessageImplOrNull(): PrivateContentMessageImpl? = - this as? PrivateContentMessageImpl - -@PreviewFeature -inline fun Message.privateContentMessageImplOrThrow(): PrivateContentMessageImpl = - this as PrivateContentMessageImpl - -@PreviewFeature -inline fun Message.ifChannelEventMessage(block: (ChannelEventMessage) -> T) = - channelEventMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.channelEventMessageOrNull(): ChannelEventMessage? = - this as? ChannelEventMessage - -@PreviewFeature -inline fun Message.channelEventMessageOrThrow(): ChannelEventMessage = - this as ChannelEventMessage - -@PreviewFeature -inline fun Message.ifChannelMediaGroupMessage(block: (ChannelMediaGroupMessage) -> T) = - channelMediaGroupMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.channelMediaGroupMessageOrNull(): ChannelMediaGroupMessage? = - this as? ChannelMediaGroupMessage - -@PreviewFeature -inline fun Message.channelMediaGroupMessageOrThrow(): ChannelMediaGroupMessage = - this as ChannelMediaGroupMessage - -@PreviewFeature -inline fun Message.ifCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T) = - commonGroupEventMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.commonGroupEventMessageOrNull(): CommonGroupEventMessage? = - this as? CommonGroupEventMessage - -@PreviewFeature -inline fun Message.commonGroupEventMessageOrThrow(): CommonGroupEventMessage = - this as CommonGroupEventMessage - -@PreviewFeature -inline fun Message.ifCommonMediaGroupMessage(block: (CommonMediaGroupMessage) -> T) = - commonMediaGroupMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.commonMediaGroupMessageOrNull(): CommonMediaGroupMessage? = - this as? CommonMediaGroupMessage - -@PreviewFeature -inline fun Message.commonMediaGroupMessageOrThrow(): CommonMediaGroupMessage = - this as CommonMediaGroupMessage - -@PreviewFeature -inline fun Message.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T) = - commonSupergroupEventMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.commonSupergroupEventMessageOrNull(): CommonSupergroupEventMessage? = - this as? CommonSupergroupEventMessage - -@PreviewFeature -inline fun Message.commonSupergroupEventMessageOrThrow(): CommonSupergroupEventMessage = - this as CommonSupergroupEventMessage - -@PreviewFeature -inline fun Message.ifAnonymousGroupContentMessage(block: (AnonymousGroupContentMessage) -> T) = - anonymousGroupContentMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.anonymousGroupContentMessageOrNull(): AnonymousGroupContentMessage? = - this as? AnonymousGroupContentMessage - -@PreviewFeature -inline fun Message.anonymousGroupContentMessageOrThrow(): AnonymousGroupContentMessage = - this as AnonymousGroupContentMessage - -@PreviewFeature -inline fun Message.ifChannelContentMessage(block: (ChannelContentMessage) -> T) = - channelContentMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.channelContentMessageOrNull(): ChannelContentMessage? = - this as? ChannelContentMessage - -@PreviewFeature -inline fun Message.channelContentMessageOrThrow(): ChannelContentMessage = - this as ChannelContentMessage - -@PreviewFeature -inline fun Message.ifConnectedFromChannelGroupContentMessage(block: (ConnectedFromChannelGroupContentMessage) -> T) = - connectedFromChannelGroupContentMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.connectedFromChannelGroupContentMessageOrNull(): ConnectedFromChannelGroupContentMessage? = - this as? ConnectedFromChannelGroupContentMessage - -@PreviewFeature -inline fun Message.connectedFromChannelGroupContentMessageOrThrow(): ConnectedFromChannelGroupContentMessage = - this as ConnectedFromChannelGroupContentMessage - -@PreviewFeature -inline fun Message.ifUnconnectedFromChannelGroupContentMessage(block: (UnconnectedFromChannelGroupContentMessage) -> T) = - unconnectedFromChannelGroupContentMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.unconnectedFromChannelGroupContentMessageOrNull(): UnconnectedFromChannelGroupContentMessage? = - this as? UnconnectedFromChannelGroupContentMessage - -@PreviewFeature -inline fun Message.unconnectedFromChannelGroupContentMessageOrThrow(): UnconnectedFromChannelGroupContentMessage = - this as UnconnectedFromChannelGroupContentMessage - -@PreviewFeature -inline fun Message.ifChatEventMessage(block: (ChatEventMessage) -> T) = - chatEventMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.chatEventMessageOrNull(): ChatEventMessage? = this as? ChatEventMessage - -@PreviewFeature -inline fun Message.chatEventMessageOrThrow(): ChatEventMessage = this as ChatEventMessage - -@PreviewFeature -inline fun Message.ifCommonGroupContentMessage(block: (CommonGroupContentMessage) -> T) = - commonGroupContentMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.commonGroupContentMessageOrNull(): CommonGroupContentMessage? = - this as? CommonGroupContentMessage - -@PreviewFeature -inline fun Message.commonGroupContentMessageOrThrow(): CommonGroupContentMessage = - this as CommonGroupContentMessage - -@PreviewFeature -inline fun Message.ifCommonMessage(block: (CommonMessage) -> T) = commonMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.commonMessageOrNull(): CommonMessage? = this as? CommonMessage - -@PreviewFeature -inline fun Message.commonMessageOrThrow(): CommonMessage = this as CommonMessage - -@PreviewFeature -inline fun Message.ifContentMessage(block: (ContentMessage) -> T) = - contentMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.contentMessageOrNull(): ContentMessage? = this as? ContentMessage - -@PreviewFeature -inline fun Message.contentMessageOrThrow(): ContentMessage = this as ContentMessage - -@PreviewFeature -inline fun Message.ifFromChannelGroupContentMessage(block: (FromChannelGroupContentMessage) -> T) = - fromChannelGroupContentMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.fromChannelGroupContentMessageOrNull(): FromChannelGroupContentMessage? = - this as? FromChannelGroupContentMessage - -@PreviewFeature -inline fun Message.fromChannelGroupContentMessageOrThrow(): FromChannelGroupContentMessage = - this as FromChannelGroupContentMessage - -@PreviewFeature -inline fun Message.ifGroupEventMessage(block: (GroupEventMessage) -> T) = - groupEventMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.groupEventMessageOrNull(): GroupEventMessage? = this as? GroupEventMessage - -@PreviewFeature -inline fun Message.groupEventMessageOrThrow(): GroupEventMessage = this as GroupEventMessage - -@PreviewFeature -inline fun Message.ifPrivateEventMessage(block: (PrivateEventMessage) -> T) = - privateEventMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.privateEventMessageOrNull(): PrivateEventMessage? = - this as? PrivateEventMessage - -@PreviewFeature -inline fun Message.privateEventMessageOrThrow(): PrivateEventMessage = - this as PrivateEventMessage - -@PreviewFeature -inline fun Message.ifGroupContentMessage(block: (GroupContentMessage) -> T) = - groupContentMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.groupContentMessageOrNull(): GroupContentMessage? = - this as? GroupContentMessage - -@PreviewFeature -inline fun Message.groupContentMessageOrThrow(): GroupContentMessage = - this as GroupContentMessage - -@PreviewFeature -inline fun Message.ifMediaGroupMessage(block: (MediaGroupMessage) -> T) = - mediaGroupMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.mediaGroupMessageOrNull(): MediaGroupMessage? = - this as? MediaGroupMessage - -@PreviewFeature -inline fun Message.mediaGroupMessageOrThrow(): MediaGroupMessage = - this as MediaGroupMessage - -@PreviewFeature -inline fun Message.ifPossiblyEditedMessage(block: (PossiblyEditedMessage) -> T) = - possiblyEditedMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.possiblyEditedMessageOrNull(): PossiblyEditedMessage? = this as? PossiblyEditedMessage - -@PreviewFeature -inline fun Message.possiblyEditedMessageOrThrow(): PossiblyEditedMessage = this as PossiblyEditedMessage - -@PreviewFeature -inline fun Message.ifPossiblyReplyMessage(block: (PossiblyReplyMessage) -> T) = - possiblyReplyMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.possiblyReplyMessageOrNull(): PossiblyReplyMessage? = this as? PossiblyReplyMessage - -@PreviewFeature -inline fun Message.possiblyReplyMessageOrThrow(): PossiblyReplyMessage = this as PossiblyReplyMessage - -@PreviewFeature -inline fun Message.ifPossiblyForwardedMessage(block: (PossiblyForwardedMessage) -> T) = - possiblyForwardedMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.possiblyForwardedMessageOrNull(): PossiblyForwardedMessage? = this as? PossiblyForwardedMessage - -@PreviewFeature -inline fun Message.possiblyForwardedMessageOrThrow(): PossiblyForwardedMessage = this as PossiblyForwardedMessage - -@PreviewFeature -inline fun Message.ifPossiblyPaymentMessage(block: (PossiblyPaymentMessage) -> T) = - possiblyPaymentMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.possiblyPaymentMessageOrNull(): PossiblyPaymentMessage? = this as? PossiblyPaymentMessage - -@PreviewFeature -inline fun Message.possiblyPaymentMessageOrThrow(): PossiblyPaymentMessage = this as PossiblyPaymentMessage - -@PreviewFeature -inline fun Message.ifPrivateContentMessage(block: (PrivateContentMessage) -> T) = - privateContentMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.privateContentMessageOrNull(): PrivateContentMessage? = - this as? PrivateContentMessage - -@PreviewFeature -inline fun Message.privateContentMessageOrThrow(): PrivateContentMessage = - this as PrivateContentMessage - -@PreviewFeature -inline fun Message.ifPublicContentMessage(block: (PublicContentMessage) -> T) = - publicContentMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.publicContentMessageOrNull(): PublicContentMessage? = - this as? PublicContentMessage - -@PreviewFeature -inline fun Message.publicContentMessageOrThrow(): PublicContentMessage = - this as PublicContentMessage - -@PreviewFeature -inline fun Message.ifSignedMessage(block: (SignedMessage) -> T) = signedMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.signedMessageOrNull(): SignedMessage? = this as? SignedMessage - -@PreviewFeature -inline fun Message.signedMessageOrThrow(): SignedMessage = this as SignedMessage - -@PreviewFeature -inline fun Message.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T) = - supergroupEventMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.supergroupEventMessageOrNull(): SupergroupEventMessage? = - this as? SupergroupEventMessage - -@PreviewFeature -inline fun Message.supergroupEventMessageOrThrow(): SupergroupEventMessage = - this as SupergroupEventMessage - -@PreviewFeature -inline fun Message.ifUnknownMessageType(block: (UnknownMessageType) -> T) = unknownMessageTypeOrNull()?.let(block) - -@PreviewFeature -inline fun Message.unknownMessageTypeOrNull(): UnknownMessageType? = this as? UnknownMessageType - -@PreviewFeature -inline fun Message.unknownMessageTypeOrThrow(): UnknownMessageType = this as UnknownMessageType - -@PreviewFeature -inline fun Message.ifPossiblySentViaBotCommonMessage(block: (PossiblySentViaBotCommonMessage) -> T) = - possiblySentViaBotCommonMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.possiblySentViaBotCommonMessageOrNull(): PossiblySentViaBotCommonMessage? = - this as? PossiblySentViaBotCommonMessage - -@PreviewFeature -inline fun Message.possiblySentViaBotCommonMessageOrThrow(): PossiblySentViaBotCommonMessage = - this as PossiblySentViaBotCommonMessage - -@PreviewFeature -inline fun Message.ifFromUserMessage(block: (FromUserMessage) -> T) = fromUserMessageOrNull()?.let(block) - -@PreviewFeature -inline fun Message.fromUserMessageOrNull(): FromUserMessage? = this as? FromUserMessage - -@PreviewFeature -inline fun Message.fromUserMessageOrThrow(): FromUserMessage = this as FromUserMessage - -@PreviewFeature -inline fun BotAction.ifFindLocationAction(block: (FindLocationAction) -> T) = findLocationActionOrNull()?.let(block) - -@PreviewFeature -inline fun BotAction.findLocationActionOrNull(): FindLocationAction? = this as? FindLocationAction - -@PreviewFeature -inline fun BotAction.findLocationActionOrThrow(): FindLocationAction = this as FindLocationAction - -@PreviewFeature -inline fun BotAction.ifRecordVoiceAction(block: (RecordVoiceAction) -> T) = recordVoiceActionOrNull()?.let(block) - -@PreviewFeature -inline fun BotAction.recordVoiceActionOrNull(): RecordVoiceAction? = this as? RecordVoiceAction - -@PreviewFeature -inline fun BotAction.recordVoiceActionOrThrow(): RecordVoiceAction = this as RecordVoiceAction - -@PreviewFeature -inline fun BotAction.ifRecordVideoAction(block: (RecordVideoAction) -> T) = recordVideoActionOrNull()?.let(block) - -@PreviewFeature -inline fun BotAction.recordVideoActionOrNull(): RecordVideoAction? = this as? RecordVideoAction - -@PreviewFeature -inline fun BotAction.recordVideoActionOrThrow(): RecordVideoAction = this as RecordVideoAction - -@PreviewFeature -inline fun BotAction.ifRecordVideoNoteAction(block: (RecordVideoNoteAction) -> T) = - recordVideoNoteActionOrNull()?.let(block) - -@PreviewFeature -inline fun BotAction.recordVideoNoteActionOrNull(): RecordVideoNoteAction? = this as? RecordVideoNoteAction - -@PreviewFeature -inline fun BotAction.recordVideoNoteActionOrThrow(): RecordVideoNoteAction = this as RecordVideoNoteAction - -@PreviewFeature -inline fun BotAction.ifTypingAction(block: (TypingAction) -> T) = typingActionOrNull()?.let(block) - -@PreviewFeature -inline fun BotAction.typingActionOrNull(): TypingAction? = this as? TypingAction - -@PreviewFeature -inline fun BotAction.typingActionOrThrow(): TypingAction = this as TypingAction - -@PreviewFeature -inline fun BotAction.ifChooseStickerAction(block: (ChooseStickerAction) -> T) = - chooseStickerActionOrNull()?.let(block) - -@PreviewFeature -inline fun BotAction.chooseStickerActionOrNull(): ChooseStickerAction? = this as? ChooseStickerAction - -@PreviewFeature -inline fun BotAction.chooseStickerActionOrThrow(): ChooseStickerAction = this as ChooseStickerAction - -@PreviewFeature -inline fun BotAction.ifUploadVoiceAction(block: (UploadVoiceAction) -> T) = uploadVoiceActionOrNull()?.let(block) - -@PreviewFeature -inline fun BotAction.uploadVoiceActionOrNull(): UploadVoiceAction? = this as? UploadVoiceAction - -@PreviewFeature -inline fun BotAction.uploadVoiceActionOrThrow(): UploadVoiceAction = this as UploadVoiceAction - -@PreviewFeature -inline fun BotAction.ifUploadDocumentAction(block: (UploadDocumentAction) -> T) = - uploadDocumentActionOrNull()?.let(block) - -@PreviewFeature -inline fun BotAction.uploadDocumentActionOrNull(): UploadDocumentAction? = this as? UploadDocumentAction - -@PreviewFeature -inline fun BotAction.uploadDocumentActionOrThrow(): UploadDocumentAction = this as UploadDocumentAction - -@PreviewFeature -inline fun BotAction.ifUploadPhotoAction(block: (UploadPhotoAction) -> T) = uploadPhotoActionOrNull()?.let(block) - -@PreviewFeature -inline fun BotAction.uploadPhotoActionOrNull(): UploadPhotoAction? = this as? UploadPhotoAction - -@PreviewFeature -inline fun BotAction.uploadPhotoActionOrThrow(): UploadPhotoAction = this as UploadPhotoAction - -@PreviewFeature -inline fun BotAction.ifUploadVideoAction(block: (UploadVideoAction) -> T) = uploadVideoActionOrNull()?.let(block) - -@PreviewFeature -inline fun BotAction.uploadVideoActionOrNull(): UploadVideoAction? = this as? UploadVideoAction - -@PreviewFeature -inline fun BotAction.uploadVideoActionOrThrow(): UploadVideoAction = this as UploadVideoAction - -@PreviewFeature -inline fun BotAction.ifUploadVideoNoteAction(block: (UploadVideoNoteAction) -> T) = - uploadVideoNoteActionOrNull()?.let(block) - -@PreviewFeature -inline fun BotAction.uploadVideoNoteActionOrNull(): UploadVideoNoteAction? = this as? UploadVideoNoteAction - -@PreviewFeature -inline fun BotAction.uploadVideoNoteActionOrThrow(): UploadVideoNoteAction = this as UploadVideoNoteAction - -@PreviewFeature -inline fun InlineQuery.ifBaseInlineQuery(block: (BaseInlineQuery) -> T) = baseInlineQueryOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQuery.baseInlineQueryOrNull(): BaseInlineQuery? = - this as? BaseInlineQuery - -@PreviewFeature -inline fun InlineQuery.baseInlineQueryOrThrow(): BaseInlineQuery = - this as BaseInlineQuery - -@PreviewFeature -inline fun InlineQuery.ifLocationInlineQuery(block: (LocationInlineQuery) -> T) = - locationInlineQueryOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQuery.locationInlineQueryOrNull(): LocationInlineQuery? = - this as? LocationInlineQuery - -@PreviewFeature -inline fun InlineQuery.locationInlineQueryOrThrow(): LocationInlineQuery = - this as LocationInlineQuery - -@PreviewFeature -inline fun InputMessageContent.ifInputContactMessageContent(block: (InputContactMessageContent) -> T) = - inputContactMessageContentOrNull()?.let(block) - -@PreviewFeature -inline fun InputMessageContent.inputContactMessageContentOrNull(): InputContactMessageContent? = - this as? InputContactMessageContent - -@PreviewFeature -inline fun InputMessageContent.inputContactMessageContentOrThrow(): InputContactMessageContent = - this as InputContactMessageContent - -@PreviewFeature -inline fun InputMessageContent.ifInputLocationMessageContent(block: (InputLocationMessageContent) -> T) = - inputLocationMessageContentOrNull()?.let(block) - -@PreviewFeature -inline fun InputMessageContent.inputLocationMessageContentOrNull(): InputLocationMessageContent? = - this as? InputLocationMessageContent - -@PreviewFeature -inline fun InputMessageContent.inputLocationMessageContentOrThrow(): InputLocationMessageContent = - this as InputLocationMessageContent - -@PreviewFeature -inline fun InputMessageContent.ifInputTextMessageContent(block: (InputTextMessageContent) -> T) = - inputTextMessageContentOrNull()?.let(block) - -@PreviewFeature -inline fun InputMessageContent.inputTextMessageContentOrNull(): InputTextMessageContent? = - this as? InputTextMessageContent - -@PreviewFeature -inline fun InputMessageContent.inputTextMessageContentOrThrow(): InputTextMessageContent = - this as InputTextMessageContent - -@PreviewFeature -inline fun InputMessageContent.ifInputVenueMessageContent(block: (InputVenueMessageContent) -> T) = - inputVenueMessageContentOrNull()?.let(block) - -@PreviewFeature -inline fun InputMessageContent.inputVenueMessageContentOrNull(): InputVenueMessageContent? = - this as? InputVenueMessageContent - -@PreviewFeature -inline fun InputMessageContent.inputVenueMessageContentOrThrow(): InputVenueMessageContent = - this as InputVenueMessageContent - -@PreviewFeature -inline fun InputMessageContent.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T) = - inputInvoiceMessageContentOrNull()?.let(block) - -@PreviewFeature -inline fun InputMessageContent.inputInvoiceMessageContentOrNull(): InputInvoiceMessageContent? = - this as? InputInvoiceMessageContent - -@PreviewFeature -inline fun InputMessageContent.inputInvoiceMessageContentOrThrow(): InputInvoiceMessageContent = - this as InputInvoiceMessageContent - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultArticle(block: (InlineQueryResultArticle) -> T) = - inlineQueryResultArticleOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultArticleOrNull(): InlineQueryResultArticle? = - this as? InlineQueryResultArticle - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultArticleOrThrow(): InlineQueryResultArticle = - this as InlineQueryResultArticle - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultContact(block: (InlineQueryResultContact) -> T) = - inlineQueryResultContactOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultContactOrNull(): InlineQueryResultContact? = - this as? InlineQueryResultContact - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultContactOrThrow(): InlineQueryResultContact = - this as InlineQueryResultContact - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultGame(block: (InlineQueryResultGame) -> T) = - inlineQueryResultGameOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultGameOrNull(): InlineQueryResultGame? = this as? InlineQueryResultGame - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultGameOrThrow(): InlineQueryResultGame = this as InlineQueryResultGame - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultLocation(block: (InlineQueryResultLocation) -> T) = - inlineQueryResultLocationOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultLocationOrNull(): InlineQueryResultLocation? = - this as? InlineQueryResultLocation - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultLocationOrThrow(): InlineQueryResultLocation = - this as InlineQueryResultLocation - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultStickerCached(block: (InlineQueryResultStickerCached) -> T) = - inlineQueryResultStickerCachedOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultStickerCachedOrNull(): InlineQueryResultStickerCached? = - this as? InlineQueryResultStickerCached - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultStickerCachedOrThrow(): InlineQueryResultStickerCached = - this as InlineQueryResultStickerCached - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVenue(block: (InlineQueryResultVenue) -> T) = - inlineQueryResultVenueOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVenueOrNull(): InlineQueryResultVenue? = this as? InlineQueryResultVenue - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVenueOrThrow(): InlineQueryResultVenue = this as InlineQueryResultVenue - -@PreviewFeature -inline fun InlineQueryResult.ifDescribedInlineQueryResult(block: (DescribedInlineQueryResult) -> T) = - describedInlineQueryResultOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.describedInlineQueryResultOrNull(): DescribedInlineQueryResult? = - this as? DescribedInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.describedInlineQueryResultOrThrow(): DescribedInlineQueryResult = - this as DescribedInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.ifFileInlineQueryResult(block: (FileInlineQueryResult) -> T) = - fileInlineQueryResultOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.fileInlineQueryResultOrNull(): FileInlineQueryResult? = this as? FileInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.fileInlineQueryResultOrThrow(): FileInlineQueryResult = this as FileInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.ifOptionallyTitledInlineQueryResult(block: (OptionallyTitledInlineQueryResult) -> T) = - optionallyTitledInlineQueryResultOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.optionallyTitledInlineQueryResultOrNull(): OptionallyTitledInlineQueryResult? = - this as? OptionallyTitledInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.optionallyTitledInlineQueryResultOrThrow(): OptionallyTitledInlineQueryResult = - this as OptionallyTitledInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.ifSizedInlineQueryResult(block: (SizedInlineQueryResult) -> T) = - sizedInlineQueryResultOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.sizedInlineQueryResultOrNull(): SizedInlineQueryResult? = this as? SizedInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.sizedInlineQueryResultOrThrow(): SizedInlineQueryResult = this as SizedInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.ifThumbSizedInlineQueryResult(block: (ThumbSizedInlineQueryResult) -> T) = - thumbSizedInlineQueryResultOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.thumbSizedInlineQueryResultOrNull(): ThumbSizedInlineQueryResult? = - this as? ThumbSizedInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.thumbSizedInlineQueryResultOrThrow(): ThumbSizedInlineQueryResult = - this as ThumbSizedInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.ifThumbedInlineQueryResult(block: (ThumbedInlineQueryResult) -> T) = - thumbedInlineQueryResultOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.thumbedInlineQueryResultOrNull(): ThumbedInlineQueryResult? = - this as? ThumbedInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.thumbedInlineQueryResultOrThrow(): ThumbedInlineQueryResult = - this as ThumbedInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.ifThumbedWithMimeTypeInlineQueryResult(block: (ThumbedWithMimeTypeInlineQueryResult) -> T) = - thumbedWithMimeTypeInlineQueryResultOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.thumbedWithMimeTypeInlineQueryResultOrNull(): ThumbedWithMimeTypeInlineQueryResult? = - this as? ThumbedWithMimeTypeInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.thumbedWithMimeTypeInlineQueryResultOrThrow(): ThumbedWithMimeTypeInlineQueryResult = - this as ThumbedWithMimeTypeInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.ifTitledInlineQueryResult(block: (TitledInlineQueryResult) -> T) = - titledInlineQueryResultOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.titledInlineQueryResultOrNull(): TitledInlineQueryResult? = - this as? TitledInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.titledInlineQueryResultOrThrow(): TitledInlineQueryResult = this as TitledInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.ifUrlInlineQueryResult(block: (UrlInlineQueryResult) -> T) = - urlInlineQueryResultOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.urlInlineQueryResultOrNull(): UrlInlineQueryResult? = this as? UrlInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.urlInlineQueryResultOrThrow(): UrlInlineQueryResult = this as UrlInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.ifWithInputMessageContentInlineQueryResult(block: (WithInputMessageContentInlineQueryResult) -> T) = - withInputMessageContentInlineQueryResultOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrNull(): WithInputMessageContentInlineQueryResult? = - this as? WithInputMessageContentInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrThrow(): WithInputMessageContentInlineQueryResult = - this as WithInputMessageContentInlineQueryResult - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultAudio(block: (InlineQueryResultAudio) -> T) = - inlineQueryResultAudioOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultAudioOrNull(): InlineQueryResultAudio? = this as? InlineQueryResultAudio - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultAudioOrThrow(): InlineQueryResultAudio = this as InlineQueryResultAudio - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultAudioCached(block: (InlineQueryResultAudioCached) -> T) = - inlineQueryResultAudioCachedOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultAudioCachedOrNull(): InlineQueryResultAudioCached? = - this as? InlineQueryResultAudioCached - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultAudioCachedOrThrow(): InlineQueryResultAudioCached = - this as InlineQueryResultAudioCached - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultAudioCommon(block: (InlineQueryResultAudioCommon) -> T) = - inlineQueryResultAudioCommonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultAudioCommonOrNull(): InlineQueryResultAudioCommon? = - this as? InlineQueryResultAudioCommon - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultAudioCommonOrThrow(): InlineQueryResultAudioCommon = - this as InlineQueryResultAudioCommon - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultDocument(block: (InlineQueryResultDocument) -> T) = - inlineQueryResultDocumentOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultDocumentOrNull(): InlineQueryResultDocument? = - this as? InlineQueryResultDocument - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultDocumentOrThrow(): InlineQueryResultDocument = - this as InlineQueryResultDocument - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultDocumentCached(block: (InlineQueryResultDocumentCached) -> T) = - inlineQueryResultDocumentCachedOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultDocumentCachedOrNull(): InlineQueryResultDocumentCached? = - this as? InlineQueryResultDocumentCached - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultDocumentCachedOrThrow(): InlineQueryResultDocumentCached = - this as InlineQueryResultDocumentCached - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultDocumentCommon(block: (InlineQueryResultDocumentCommon) -> T) = - inlineQueryResultDocumentCommonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultDocumentCommonOrNull(): InlineQueryResultDocumentCommon? = - this as? InlineQueryResultDocumentCommon - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultDocumentCommonOrThrow(): InlineQueryResultDocumentCommon = - this as InlineQueryResultDocumentCommon - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultGif(block: (InlineQueryResultGif) -> T) = - inlineQueryResultGifOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultGifOrNull(): InlineQueryResultGif? = this as? InlineQueryResultGif - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultGifOrThrow(): InlineQueryResultGif = this as InlineQueryResultGif - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultGifCached(block: (InlineQueryResultGifCached) -> T) = - inlineQueryResultGifCachedOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultGifCachedOrNull(): InlineQueryResultGifCached? = - this as? InlineQueryResultGifCached - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultGifCachedOrThrow(): InlineQueryResultGifCached = - this as InlineQueryResultGifCached - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultGifCommon(block: (InlineQueryResultGifCommon) -> T) = - inlineQueryResultGifCommonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultGifCommonOrNull(): InlineQueryResultGifCommon? = - this as? InlineQueryResultGifCommon - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultGifCommonOrThrow(): InlineQueryResultGifCommon = - this as InlineQueryResultGifCommon - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultMpeg4Gif(block: (InlineQueryResultMpeg4Gif) -> T) = - inlineQueryResultMpeg4GifOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultMpeg4GifOrNull(): InlineQueryResultMpeg4Gif? = - this as? InlineQueryResultMpeg4Gif - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultMpeg4GifOrThrow(): InlineQueryResultMpeg4Gif = - this as InlineQueryResultMpeg4Gif - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultMpeg4GifCached(block: (InlineQueryResultMpeg4GifCached) -> T) = - inlineQueryResultMpeg4GifCachedOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedOrNull(): InlineQueryResultMpeg4GifCached? = - this as? InlineQueryResultMpeg4GifCached - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedOrThrow(): InlineQueryResultMpeg4GifCached = - this as InlineQueryResultMpeg4GifCached - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultMpeg4GifCommon(block: (InlineQueryResultMpeg4GifCommon) -> T) = - inlineQueryResultMpeg4GifCommonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultMpeg4GifCommonOrNull(): InlineQueryResultMpeg4GifCommon? = - this as? InlineQueryResultMpeg4GifCommon - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultMpeg4GifCommonOrThrow(): InlineQueryResultMpeg4GifCommon = - this as InlineQueryResultMpeg4GifCommon - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultPhoto(block: (InlineQueryResultPhoto) -> T) = - inlineQueryResultPhotoOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultPhotoOrNull(): InlineQueryResultPhoto? = this as? InlineQueryResultPhoto - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultPhotoOrThrow(): InlineQueryResultPhoto = this as InlineQueryResultPhoto - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultPhotoCached(block: (InlineQueryResultPhotoCached) -> T) = - inlineQueryResultPhotoCachedOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultPhotoCachedOrNull(): InlineQueryResultPhotoCached? = - this as? InlineQueryResultPhotoCached - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultPhotoCachedOrThrow(): InlineQueryResultPhotoCached = - this as InlineQueryResultPhotoCached - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultPhotoCommon(block: (InlineQueryResultPhotoCommon) -> T) = - inlineQueryResultPhotoCommonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultPhotoCommonOrNull(): InlineQueryResultPhotoCommon? = - this as? InlineQueryResultPhotoCommon - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultPhotoCommonOrThrow(): InlineQueryResultPhotoCommon = - this as InlineQueryResultPhotoCommon - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVideo(block: (InlineQueryResultVideo) -> T) = - inlineQueryResultVideoOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVideoOrNull(): InlineQueryResultVideo? = this as? InlineQueryResultVideo - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVideoOrThrow(): InlineQueryResultVideo = this as InlineQueryResultVideo - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVideoCached(block: (InlineQueryResultVideoCached) -> T) = - inlineQueryResultVideoCachedOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVideoCachedOrNull(): InlineQueryResultVideoCached? = - this as? InlineQueryResultVideoCached - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVideoCachedOrThrow(): InlineQueryResultVideoCached = - this as InlineQueryResultVideoCached - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVideoCommon(block: (InlineQueryResultVideoCommon) -> T) = - inlineQueryResultVideoCommonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVideoCommonOrNull(): InlineQueryResultVideoCommon? = - this as? InlineQueryResultVideoCommon - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVideoCommonOrThrow(): InlineQueryResultVideoCommon = - this as InlineQueryResultVideoCommon - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVoice(block: (InlineQueryResultVoice) -> T) = - inlineQueryResultVoiceOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVoiceOrNull(): InlineQueryResultVoice? = this as? InlineQueryResultVoice - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVoiceOrThrow(): InlineQueryResultVoice = this as InlineQueryResultVoice - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVoiceCached(block: (InlineQueryResultVoiceCached) -> T) = - inlineQueryResultVoiceCachedOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVoiceCachedOrNull(): InlineQueryResultVoiceCached? = - this as? InlineQueryResultVoiceCached - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVoiceCachedOrThrow(): InlineQueryResultVoiceCached = - this as InlineQueryResultVoiceCached - -@PreviewFeature -inline fun InlineQueryResult.ifInlineQueryResultVoiceCommon(block: (InlineQueryResultVoiceCommon) -> T) = - inlineQueryResultVoiceCommonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVoiceCommonOrNull(): InlineQueryResultVoiceCommon? = - this as? InlineQueryResultVoiceCommon - -@PreviewFeature -inline fun InlineQueryResult.inlineQueryResultVoiceCommonOrThrow(): InlineQueryResultVoiceCommon = - this as InlineQueryResultVoiceCommon - -@PreviewFeature -inline fun ChatMember.ifOwnerChatMember(block: (OwnerChatMember) -> T) = ownerChatMemberOrNull()?.let(block) - -@PreviewFeature -inline fun ChatMember.ownerChatMemberOrNull(): OwnerChatMember? = this as? OwnerChatMember - -@PreviewFeature -inline fun ChatMember.ownerChatMemberOrThrow(): OwnerChatMember = this as OwnerChatMember - -@PreviewFeature -inline fun ChatMember.ifKickedChatMember(block: (KickedChatMember) -> T) = kickedChatMemberOrNull()?.let(block) - -@PreviewFeature -inline fun ChatMember.kickedChatMemberOrNull(): KickedChatMember? = this as? KickedChatMember - -@PreviewFeature -inline fun ChatMember.kickedChatMemberOrThrow(): KickedChatMember = this as KickedChatMember - -@PreviewFeature -inline fun ChatMember.ifLeftChatMember(block: (LeftChatMember) -> T) = leftChatMemberOrNull()?.let(block) - -@PreviewFeature -inline fun ChatMember.leftChatMemberOrNull(): LeftChatMember? = this as? LeftChatMember - -@PreviewFeature -inline fun ChatMember.leftChatMemberOrThrow(): LeftChatMember = this as LeftChatMember - -@PreviewFeature -inline fun ChatMember.ifMemberChatMember(block: (MemberChatMember) -> T) = memberChatMemberOrNull()?.let(block) - -@PreviewFeature -inline fun ChatMember.memberChatMemberOrNull(): MemberChatMember? = this as? MemberChatMember - -@PreviewFeature -inline fun ChatMember.memberChatMemberOrThrow(): MemberChatMember = this as MemberChatMember - -@PreviewFeature -inline fun ChatMember.ifRestrictedChatMember(block: (RestrictedChatMember) -> T) = - restrictedChatMemberOrNull()?.let(block) - -@PreviewFeature -inline fun ChatMember.restrictedChatMemberOrNull(): RestrictedChatMember? = this as? RestrictedChatMember - -@PreviewFeature -inline fun ChatMember.restrictedChatMemberOrThrow(): RestrictedChatMember = this as RestrictedChatMember - -@PreviewFeature -inline fun ChatMember.ifAdministratorChatMember(block: (AdministratorChatMember) -> T) = - administratorChatMemberOrNull()?.let(block) - -@PreviewFeature -inline fun ChatMember.administratorChatMemberOrNull(): AdministratorChatMember? = this as? AdministratorChatMember - -@PreviewFeature -inline fun ChatMember.administratorChatMemberOrThrow(): AdministratorChatMember = this as AdministratorChatMember - -@PreviewFeature -inline fun ChatMember.ifBannedChatMember(block: (BannedChatMember) -> T) = bannedChatMemberOrNull()?.let(block) - -@PreviewFeature -inline fun ChatMember.bannedChatMemberOrNull(): BannedChatMember? = this as? BannedChatMember - -@PreviewFeature -inline fun ChatMember.bannedChatMemberOrThrow(): BannedChatMember = this as BannedChatMember - -@PreviewFeature -inline fun ChatMember.ifSpecialRightsChatMember(block: (SpecialRightsChatMember) -> T) = - specialRightsChatMemberOrNull()?.let(block) - -@PreviewFeature -inline fun ChatMember.specialRightsChatMemberOrNull(): SpecialRightsChatMember? = this as? SpecialRightsChatMember - -@PreviewFeature -inline fun ChatMember.specialRightsChatMemberOrThrow(): SpecialRightsChatMember = this as SpecialRightsChatMember - -@PreviewFeature -inline fun TelegramMedia.ifAudioMediaGroupMemberTelegramMedia(block: (AudioMediaGroupMemberTelegramMedia) -> T) = - audioMediaGroupMemberTelegramMediaOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMedia.audioMediaGroupMemberTelegramMediaOrNull(): AudioMediaGroupMemberTelegramMedia? = - this as? AudioMediaGroupMemberTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.audioMediaGroupMemberTelegramMediaOrThrow(): AudioMediaGroupMemberTelegramMedia = - this as AudioMediaGroupMemberTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.ifDocumentMediaGroupMemberTelegramMedia(block: (DocumentMediaGroupMemberTelegramMedia) -> T) = - documentMediaGroupMemberTelegramMediaOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMedia.documentMediaGroupMemberTelegramMediaOrNull(): DocumentMediaGroupMemberTelegramMedia? = - this as? DocumentMediaGroupMemberTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.documentMediaGroupMemberTelegramMediaOrThrow(): DocumentMediaGroupMemberTelegramMedia = - this as DocumentMediaGroupMemberTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.ifDuratedTelegramMedia(block: (DuratedTelegramMedia) -> T) = - duratedTelegramMediaOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMedia.duratedTelegramMediaOrNull(): DuratedTelegramMedia? = this as? DuratedTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.duratedTelegramMediaOrThrow(): DuratedTelegramMedia = this as DuratedTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.ifTelegramMediaAnimation(block: (TelegramMediaAnimation) -> T) = - telegramMediaAnimationOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMedia.telegramMediaAnimationOrNull(): TelegramMediaAnimation? = this as? TelegramMediaAnimation - -@PreviewFeature -inline fun TelegramMedia.telegramMediaAnimationOrThrow(): TelegramMediaAnimation = this as TelegramMediaAnimation - -@PreviewFeature -inline fun TelegramMedia.ifTelegramMediaAudio(block: (TelegramMediaAudio) -> T) = - telegramMediaAudioOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMedia.telegramMediaAudioOrNull(): TelegramMediaAudio? = this as? TelegramMediaAudio - -@PreviewFeature -inline fun TelegramMedia.telegramMediaAudioOrThrow(): TelegramMediaAudio = this as TelegramMediaAudio - -@PreviewFeature -inline fun TelegramMedia.ifTelegramMediaDocument(block: (TelegramMediaDocument) -> T) = - telegramMediaDocumentOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMedia.telegramMediaDocumentOrNull(): TelegramMediaDocument? = this as? TelegramMediaDocument - -@PreviewFeature -inline fun TelegramMedia.telegramMediaDocumentOrThrow(): TelegramMediaDocument = this as TelegramMediaDocument - -@PreviewFeature -inline fun TelegramMedia.ifTelegramMediaPhoto(block: (TelegramMediaPhoto) -> T) = - telegramMediaPhotoOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMedia.telegramMediaPhotoOrNull(): TelegramMediaPhoto? = this as? TelegramMediaPhoto - -@PreviewFeature -inline fun TelegramMedia.telegramMediaPhotoOrThrow(): TelegramMediaPhoto = this as TelegramMediaPhoto - -@PreviewFeature -inline fun TelegramMedia.ifTelegramMediaVideo(block: (TelegramMediaVideo) -> T) = - telegramMediaVideoOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMedia.telegramMediaVideoOrNull(): TelegramMediaVideo? = this as? TelegramMediaVideo - -@PreviewFeature -inline fun TelegramMedia.telegramMediaVideoOrThrow(): TelegramMediaVideo = this as TelegramMediaVideo - -@PreviewFeature -inline fun TelegramMedia.ifMediaGroupMemberTelegramMedia(block: (MediaGroupMemberTelegramMedia) -> T) = - mediaGroupMemberTelegramMediaOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMedia.mediaGroupMemberTelegramMediaOrNull(): MediaGroupMemberTelegramMedia? = - this as? MediaGroupMemberTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.mediaGroupMemberTelegramMediaOrThrow(): MediaGroupMemberTelegramMedia = - this as MediaGroupMemberTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.ifSizedTelegramMedia(block: (SizedTelegramMedia) -> T) = - sizedTelegramMediaOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMedia.sizedTelegramMediaOrNull(): SizedTelegramMedia? = this as? SizedTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.sizedTelegramMediaOrThrow(): SizedTelegramMedia = this as SizedTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.ifThumbedTelegramMedia(block: (ThumbedTelegramMedia) -> T) = - thumbedTelegramMediaOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMedia.thumbedTelegramMediaOrNull(): ThumbedTelegramMedia? = this as? ThumbedTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.thumbedTelegramMediaOrThrow(): ThumbedTelegramMedia = this as ThumbedTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.ifTitledTelegramMedia(block: (TitledTelegramMedia) -> T) = - titledTelegramMediaOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMedia.titledTelegramMediaOrNull(): TitledTelegramMedia? = this as? TitledTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.titledTelegramMediaOrThrow(): TitledTelegramMedia = this as TitledTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.ifVisualMediaGroupMemberTelegramMedia(block: (VisualMediaGroupMemberTelegramMedia) -> T) = - visualMediaGroupMemberTelegramMediaOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMedia.visualMediaGroupMemberTelegramMediaOrNull(): VisualMediaGroupMemberTelegramMedia? = - this as? VisualMediaGroupMemberTelegramMedia - -@PreviewFeature -inline fun TelegramMedia.visualMediaGroupMemberTelegramMediaOrThrow(): VisualMediaGroupMemberTelegramMedia = - this as VisualMediaGroupMemberTelegramMedia - -@PreviewFeature -inline fun Update.ifCallbackQueryUpdate(block: (CallbackQueryUpdate) -> T) = callbackQueryUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.callbackQueryUpdateOrNull(): CallbackQueryUpdate? = this as? CallbackQueryUpdate - -@PreviewFeature -inline fun Update.callbackQueryUpdateOrThrow(): CallbackQueryUpdate = this as CallbackQueryUpdate - -@PreviewFeature -inline fun Update.ifChannelPostUpdate(block: (ChannelPostUpdate) -> T) = channelPostUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.channelPostUpdateOrNull(): ChannelPostUpdate? = this as? ChannelPostUpdate - -@PreviewFeature -inline fun Update.channelPostUpdateOrThrow(): ChannelPostUpdate = this as ChannelPostUpdate - -@PreviewFeature -inline fun Update.ifChosenInlineResultUpdate(block: (ChosenInlineResultUpdate) -> T) = - chosenInlineResultUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.chosenInlineResultUpdateOrNull(): ChosenInlineResultUpdate? = this as? ChosenInlineResultUpdate - -@PreviewFeature -inline fun Update.chosenInlineResultUpdateOrThrow(): ChosenInlineResultUpdate = this as ChosenInlineResultUpdate - -@PreviewFeature -inline fun Update.ifEditChannelPostUpdate(block: (EditChannelPostUpdate) -> T) = - editChannelPostUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.editChannelPostUpdateOrNull(): EditChannelPostUpdate? = this as? EditChannelPostUpdate - -@PreviewFeature -inline fun Update.editChannelPostUpdateOrThrow(): EditChannelPostUpdate = this as EditChannelPostUpdate - -@PreviewFeature -inline fun Update.ifEditMessageUpdate(block: (EditMessageUpdate) -> T) = editMessageUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.editMessageUpdateOrNull(): EditMessageUpdate? = this as? EditMessageUpdate - -@PreviewFeature -inline fun Update.editMessageUpdateOrThrow(): EditMessageUpdate = this as EditMessageUpdate - -@PreviewFeature -inline fun Update.ifInlineQueryUpdate(block: (InlineQueryUpdate) -> T) = inlineQueryUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.inlineQueryUpdateOrNull(): InlineQueryUpdate? = this as? InlineQueryUpdate - -@PreviewFeature -inline fun Update.inlineQueryUpdateOrThrow(): InlineQueryUpdate = this as InlineQueryUpdate - -@PreviewFeature -inline fun Update.ifChannelPostMediaGroupUpdate(block: (ChannelPostMediaGroupUpdate) -> T) = - channelPostMediaGroupUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.channelPostMediaGroupUpdateOrNull(): ChannelPostMediaGroupUpdate? = - this as? ChannelPostMediaGroupUpdate - -@PreviewFeature -inline fun Update.channelPostMediaGroupUpdateOrThrow(): ChannelPostMediaGroupUpdate = - this as ChannelPostMediaGroupUpdate - -@PreviewFeature -inline fun Update.ifEditChannelPostMediaGroupUpdate(block: (EditChannelPostMediaGroupUpdate) -> T) = - editChannelPostMediaGroupUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.editChannelPostMediaGroupUpdateOrNull(): EditChannelPostMediaGroupUpdate? = - this as? EditChannelPostMediaGroupUpdate - -@PreviewFeature -inline fun Update.editChannelPostMediaGroupUpdateOrThrow(): EditChannelPostMediaGroupUpdate = - this as EditChannelPostMediaGroupUpdate - -@PreviewFeature -inline fun Update.ifEditMediaGroupUpdate(block: (EditMediaGroupUpdate) -> T) = - editMediaGroupUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.editMediaGroupUpdateOrNull(): EditMediaGroupUpdate? = this as? EditMediaGroupUpdate - -@PreviewFeature -inline fun Update.editMediaGroupUpdateOrThrow(): EditMediaGroupUpdate = this as EditMediaGroupUpdate - -@PreviewFeature -inline fun Update.ifEditMessageMediaGroupUpdate(block: (EditMessageMediaGroupUpdate) -> T) = - editMessageMediaGroupUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.editMessageMediaGroupUpdateOrNull(): EditMessageMediaGroupUpdate? = - this as? EditMessageMediaGroupUpdate - -@PreviewFeature -inline fun Update.editMessageMediaGroupUpdateOrThrow(): EditMessageMediaGroupUpdate = - this as EditMessageMediaGroupUpdate - -@PreviewFeature -inline fun Update.ifMediaGroupUpdate(block: (MediaGroupUpdate) -> T) = mediaGroupUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.mediaGroupUpdateOrNull(): MediaGroupUpdate? = this as? MediaGroupUpdate - -@PreviewFeature -inline fun Update.mediaGroupUpdateOrThrow(): MediaGroupUpdate = this as MediaGroupUpdate - -@PreviewFeature -inline fun Update.ifMessageMediaGroupUpdate(block: (MessageMediaGroupUpdate) -> T) = - messageMediaGroupUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.messageMediaGroupUpdateOrNull(): MessageMediaGroupUpdate? = this as? MessageMediaGroupUpdate - -@PreviewFeature -inline fun Update.messageMediaGroupUpdateOrThrow(): MessageMediaGroupUpdate = this as MessageMediaGroupUpdate - -@PreviewFeature -inline fun Update.ifSentMediaGroupUpdate(block: (SentMediaGroupUpdate) -> T) = - sentMediaGroupUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.sentMediaGroupUpdateOrNull(): SentMediaGroupUpdate? = this as? SentMediaGroupUpdate - -@PreviewFeature -inline fun Update.sentMediaGroupUpdateOrThrow(): SentMediaGroupUpdate = this as SentMediaGroupUpdate - -@PreviewFeature -inline fun Update.ifMessageUpdate(block: (MessageUpdate) -> T) = messageUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.messageUpdateOrNull(): MessageUpdate? = this as? MessageUpdate - -@PreviewFeature -inline fun Update.messageUpdateOrThrow(): MessageUpdate = this as MessageUpdate - -@PreviewFeature -inline fun Update.ifPollAnswerUpdate(block: (PollAnswerUpdate) -> T) = pollAnswerUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.pollAnswerUpdateOrNull(): PollAnswerUpdate? = this as? PollAnswerUpdate - -@PreviewFeature -inline fun Update.pollAnswerUpdateOrThrow(): PollAnswerUpdate = this as PollAnswerUpdate - -@PreviewFeature -inline fun Update.ifPollUpdate(block: (PollUpdate) -> T) = pollUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.pollUpdateOrNull(): PollUpdate? = this as? PollUpdate - -@PreviewFeature -inline fun Update.pollUpdateOrThrow(): PollUpdate = this as PollUpdate - -@PreviewFeature -inline fun Update.ifPreCheckoutQueryUpdate(block: (PreCheckoutQueryUpdate) -> T) = - preCheckoutQueryUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.preCheckoutQueryUpdateOrNull(): PreCheckoutQueryUpdate? = this as? PreCheckoutQueryUpdate - -@PreviewFeature -inline fun Update.preCheckoutQueryUpdateOrThrow(): PreCheckoutQueryUpdate = this as PreCheckoutQueryUpdate - -@PreviewFeature -inline fun Update.ifShippingQueryUpdate(block: (ShippingQueryUpdate) -> T) = shippingQueryUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.shippingQueryUpdateOrNull(): ShippingQueryUpdate? = this as? ShippingQueryUpdate - -@PreviewFeature -inline fun Update.shippingQueryUpdateOrThrow(): ShippingQueryUpdate = this as ShippingQueryUpdate - -@PreviewFeature -inline fun Update.ifBaseEditMessageUpdate(block: (BaseEditMessageUpdate) -> T) = - baseEditMessageUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.baseEditMessageUpdateOrNull(): BaseEditMessageUpdate? = this as? BaseEditMessageUpdate - -@PreviewFeature -inline fun Update.baseEditMessageUpdateOrThrow(): BaseEditMessageUpdate = this as BaseEditMessageUpdate - -@PreviewFeature -inline fun Update.ifBaseMessageUpdate(block: (BaseMessageUpdate) -> T) = baseMessageUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.baseMessageUpdateOrNull(): BaseMessageUpdate? = this as? BaseMessageUpdate - -@PreviewFeature -inline fun Update.baseMessageUpdateOrThrow(): BaseMessageUpdate = this as BaseMessageUpdate - -@PreviewFeature -inline fun Update.ifBaseSentMessageUpdate(block: (BaseSentMessageUpdate) -> T) = - baseSentMessageUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.baseSentMessageUpdateOrNull(): BaseSentMessageUpdate? = this as? BaseSentMessageUpdate - -@PreviewFeature -inline fun Update.baseSentMessageUpdateOrThrow(): BaseSentMessageUpdate = this as BaseSentMessageUpdate - -@PreviewFeature -inline fun Update.ifUnknownUpdate(block: (UnknownUpdate) -> T) = unknownUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.unknownUpdateOrNull(): UnknownUpdate? = this as? UnknownUpdate - -@PreviewFeature -inline fun Update.unknownUpdateOrThrow(): UnknownUpdate = this as UnknownUpdate - -@PreviewFeature -inline fun Update.ifCommonChatMemberUpdatedUpdate(block: (CommonChatMemberUpdatedUpdate) -> T) = - commonChatMemberUpdatedUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.commonChatMemberUpdatedUpdateOrNull(): CommonChatMemberUpdatedUpdate? = - this as? CommonChatMemberUpdatedUpdate - -@PreviewFeature -inline fun Update.commonChatMemberUpdatedUpdateOrThrow(): CommonChatMemberUpdatedUpdate = - this as CommonChatMemberUpdatedUpdate - -@PreviewFeature -inline fun Update.ifMyChatMemberUpdatedUpdate(block: (MyChatMemberUpdatedUpdate) -> T) = - myChatMemberUpdatedUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.myChatMemberUpdatedUpdateOrNull(): MyChatMemberUpdatedUpdate? = this as? MyChatMemberUpdatedUpdate - -@PreviewFeature -inline fun Update.myChatMemberUpdatedUpdateOrThrow(): MyChatMemberUpdatedUpdate = this as MyChatMemberUpdatedUpdate - -@PreviewFeature -inline fun Update.ifChatMemberUpdatedUpdate(block: (ChatMemberUpdatedUpdate) -> T) = - chatMemberUpdatedUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.chatMemberUpdatedUpdateOrNull(): ChatMemberUpdatedUpdate? = this as? ChatMemberUpdatedUpdate - -@PreviewFeature -inline fun Update.chatMemberUpdatedUpdateOrThrow(): ChatMemberUpdatedUpdate = this as ChatMemberUpdatedUpdate - -@PreviewFeature -inline fun Update.ifChatJoinRequestUpdate(block: (ChatJoinRequestUpdate) -> T) = - chatJoinRequestUpdateOrNull()?.let(block) - -@PreviewFeature -inline fun Update.chatJoinRequestUpdateOrNull(): ChatJoinRequestUpdate? = this as? ChatJoinRequestUpdate - -@PreviewFeature -inline fun Update.chatJoinRequestUpdateOrThrow(): ChatJoinRequestUpdate = this as ChatJoinRequestUpdate - -@PreviewFeature -inline fun TelegramMediaFile.ifAnimationFile(block: (AnimationFile) -> T) = animationFileOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.animationFileOrNull(): AnimationFile? = this as? AnimationFile - -@PreviewFeature -inline fun TelegramMediaFile.animationFileOrThrow(): AnimationFile = this as AnimationFile - -@PreviewFeature -inline fun TelegramMediaFile.ifAudioFile(block: (AudioFile) -> T) = audioFileOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.audioFileOrNull(): AudioFile? = this as? AudioFile - -@PreviewFeature -inline fun TelegramMediaFile.audioFileOrThrow(): AudioFile = this as AudioFile - -@PreviewFeature -inline fun TelegramMediaFile.ifDocumentFile(block: (DocumentFile) -> T) = documentFileOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.documentFileOrNull(): DocumentFile? = this as? DocumentFile - -@PreviewFeature -inline fun TelegramMediaFile.documentFileOrThrow(): DocumentFile = this as DocumentFile - -@PreviewFeature -inline fun TelegramMediaFile.ifFile(block: (File) -> T) = fileOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.fileOrNull(): File? = this as? File - -@PreviewFeature -inline fun TelegramMediaFile.fileOrThrow(): File = this as File - -@PreviewFeature -inline fun TelegramMediaFile.ifPathedFile(block: (PathedFile) -> T) = pathedFileOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.pathedFileOrNull(): PathedFile? = this as? PathedFile - -@PreviewFeature -inline fun TelegramMediaFile.pathedFileOrThrow(): PathedFile = this as PathedFile - -@PreviewFeature -inline fun TelegramMediaFile.ifPhotoSize(block: (PhotoSize) -> T) = photoSizeOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.photoSizeOrNull(): PhotoSize? = this as? PhotoSize - -@PreviewFeature -inline fun TelegramMediaFile.photoSizeOrThrow(): PhotoSize = this as PhotoSize - -@PreviewFeature -inline fun TelegramMediaFile.ifSticker(block: (Sticker) -> T) = stickerOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.stickerOrNull(): Sticker? = this as? Sticker - -@PreviewFeature -inline fun TelegramMediaFile.stickerOrThrow(): Sticker = this as Sticker - -@PreviewFeature -inline fun TelegramMediaFile.ifSimpleSticker(block: (SimpleSticker) -> T) = simpleStickerOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.simpleStickerOrNull(): SimpleSticker? = this as? SimpleSticker - -@PreviewFeature -inline fun TelegramMediaFile.simpleStickerOrThrow(): SimpleSticker = this as SimpleSticker - -@PreviewFeature -inline fun TelegramMediaFile.ifAnimatedSticker(block: (AnimatedSticker) -> T) = animatedStickerOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.animatedStickerOrNull(): AnimatedSticker? = this as? AnimatedSticker - -@PreviewFeature -inline fun TelegramMediaFile.animatedStickerOrThrow(): AnimatedSticker = this as AnimatedSticker - -@PreviewFeature -inline fun TelegramMediaFile.ifVideoSticker(block: (VideoSticker) -> T) = videoStickerOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.videoStickerOrNull(): VideoSticker? = this as? VideoSticker - -@PreviewFeature -inline fun TelegramMediaFile.videoStickerOrThrow(): VideoSticker = this as VideoSticker - -@PreviewFeature -inline fun TelegramMediaFile.ifVideoFile(block: (VideoFile) -> T) = videoFileOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.videoFileOrNull(): VideoFile? = this as? VideoFile - -@PreviewFeature -inline fun TelegramMediaFile.videoFileOrThrow(): VideoFile = this as VideoFile - -@PreviewFeature -inline fun TelegramMediaFile.ifVideoNoteFile(block: (VideoNoteFile) -> T) = videoNoteFileOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.videoNoteFileOrNull(): VideoNoteFile? = this as? VideoNoteFile - -@PreviewFeature -inline fun TelegramMediaFile.videoNoteFileOrThrow(): VideoNoteFile = this as VideoNoteFile - -@PreviewFeature -inline fun TelegramMediaFile.ifVoiceFile(block: (VoiceFile) -> T) = voiceFileOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.voiceFileOrNull(): VoiceFile? = this as? VoiceFile - -@PreviewFeature -inline fun TelegramMediaFile.voiceFileOrThrow(): VoiceFile = this as VoiceFile - -@PreviewFeature -inline fun TelegramMediaFile.ifMimedMediaFile(block: (MimedMediaFile) -> T) = mimedMediaFileOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.mimedMediaFileOrNull(): MimedMediaFile? = this as? MimedMediaFile - -@PreviewFeature -inline fun TelegramMediaFile.mimedMediaFileOrThrow(): MimedMediaFile = this as MimedMediaFile - -@PreviewFeature -inline fun TelegramMediaFile.ifPlayableMediaFile(block: (PlayableMediaFile) -> T) = - playableMediaFileOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.playableMediaFileOrNull(): PlayableMediaFile? = this as? PlayableMediaFile - -@PreviewFeature -inline fun TelegramMediaFile.playableMediaFileOrThrow(): PlayableMediaFile = this as PlayableMediaFile - -@PreviewFeature -inline fun TelegramMediaFile.ifSizedMediaFile(block: (SizedMediaFile) -> T) = sizedMediaFileOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.sizedMediaFileOrNull(): SizedMediaFile? = this as? SizedMediaFile - -@PreviewFeature -inline fun TelegramMediaFile.sizedMediaFileOrThrow(): SizedMediaFile = this as SizedMediaFile - -@PreviewFeature -inline fun TelegramMediaFile.ifThumbedMediaFile(block: (ThumbedMediaFile) -> T) = - thumbedMediaFileOrNull()?.let(block) - -@PreviewFeature -inline fun TelegramMediaFile.thumbedMediaFileOrNull(): ThumbedMediaFile? = this as? ThumbedMediaFile - -@PreviewFeature -inline fun TelegramMediaFile.thumbedMediaFileOrThrow(): ThumbedMediaFile = this as ThumbedMediaFile - -@PreviewFeature -inline fun KeyboardMarkup.ifForceReply(block: (ReplyForce) -> T) = forceReplyOrNull()?.let(block) - -@PreviewFeature -inline fun KeyboardMarkup.forceReplyOrNull(): ReplyForce? = this as? ReplyForce - -@PreviewFeature -inline fun KeyboardMarkup.forceReplyOrThrow(): ReplyForce = this as ReplyForce - -@PreviewFeature -inline fun KeyboardMarkup.ifInlineKeyboardMarkup(block: (InlineKeyboardMarkup) -> T) = - inlineKeyboardMarkupOrNull()?.let(block) - -@PreviewFeature -inline fun KeyboardMarkup.inlineKeyboardMarkupOrNull(): InlineKeyboardMarkup? = this as? InlineKeyboardMarkup - -@PreviewFeature -inline fun KeyboardMarkup.inlineKeyboardMarkupOrThrow(): InlineKeyboardMarkup = this as InlineKeyboardMarkup - -@PreviewFeature -inline fun KeyboardMarkup.ifReplyKeyboardMarkup(block: (ReplyKeyboardMarkup) -> T) = - replyKeyboardMarkupOrNull()?.let(block) - -@PreviewFeature -inline fun KeyboardMarkup.replyKeyboardMarkupOrNull(): ReplyKeyboardMarkup? = this as? ReplyKeyboardMarkup - -@PreviewFeature -inline fun KeyboardMarkup.replyKeyboardMarkupOrThrow(): ReplyKeyboardMarkup = this as ReplyKeyboardMarkup - -@PreviewFeature -inline fun KeyboardMarkup.ifReplyKeyboardRemove(block: (ReplyKeyboardRemove) -> T) = - replyKeyboardRemoveOrNull()?.let(block) - -@PreviewFeature -inline fun KeyboardMarkup.replyKeyboardRemoveOrNull(): ReplyKeyboardRemove? = this as? ReplyKeyboardRemove - -@PreviewFeature -inline fun KeyboardMarkup.replyKeyboardRemoveOrThrow(): ReplyKeyboardRemove = this as ReplyKeyboardRemove - -@PreviewFeature -inline fun InlineKeyboardButton.ifCallbackDataInlineKeyboardButton(block: (CallbackDataInlineKeyboardButton) -> T) = - callbackDataInlineKeyboardButtonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineKeyboardButton.callbackDataInlineKeyboardButtonOrNull(): CallbackDataInlineKeyboardButton? = - this as? CallbackDataInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.callbackDataInlineKeyboardButtonOrThrow(): CallbackDataInlineKeyboardButton = - this as CallbackDataInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.ifCallbackGameInlineKeyboardButton(block: (CallbackGameInlineKeyboardButton) -> T) = - callbackGameInlineKeyboardButtonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineKeyboardButton.callbackGameInlineKeyboardButtonOrNull(): CallbackGameInlineKeyboardButton? = - this as? CallbackGameInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.callbackGameInlineKeyboardButtonOrThrow(): CallbackGameInlineKeyboardButton = - this as CallbackGameInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.ifLoginURLInlineKeyboardButton(block: (LoginURLInlineKeyboardButton) -> T) = - loginURLInlineKeyboardButtonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineKeyboardButton.loginURLInlineKeyboardButtonOrNull(): LoginURLInlineKeyboardButton? = - this as? LoginURLInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.loginURLInlineKeyboardButtonOrThrow(): LoginURLInlineKeyboardButton = - this as LoginURLInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.ifPayInlineKeyboardButton(block: (PayInlineKeyboardButton) -> T) = - payInlineKeyboardButtonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineKeyboardButton.payInlineKeyboardButtonOrNull(): PayInlineKeyboardButton? = - this as? PayInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.payInlineKeyboardButtonOrThrow(): PayInlineKeyboardButton = - this as PayInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.ifSwitchInlineQueryCurrentChatInlineKeyboardButton(block: (SwitchInlineQueryCurrentChatInlineKeyboardButton) -> T) = - switchInlineQueryCurrentChatInlineKeyboardButtonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineKeyboardButton.switchInlineQueryCurrentChatInlineKeyboardButtonOrNull(): SwitchInlineQueryCurrentChatInlineKeyboardButton? = - this as? SwitchInlineQueryCurrentChatInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.switchInlineQueryCurrentChatInlineKeyboardButtonOrThrow(): SwitchInlineQueryCurrentChatInlineKeyboardButton = - this as SwitchInlineQueryCurrentChatInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.ifSwitchInlineQueryInlineKeyboardButton(block: (SwitchInlineQueryInlineKeyboardButton) -> T) = - switchInlineQueryInlineKeyboardButtonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineKeyboardButton.switchInlineQueryInlineKeyboardButtonOrNull(): SwitchInlineQueryInlineKeyboardButton? = - this as? SwitchInlineQueryInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.switchInlineQueryInlineKeyboardButtonOrThrow(): SwitchInlineQueryInlineKeyboardButton = - this as SwitchInlineQueryInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.ifURLInlineKeyboardButton(block: (URLInlineKeyboardButton) -> T) = - uRLInlineKeyboardButtonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineKeyboardButton.uRLInlineKeyboardButtonOrNull(): URLInlineKeyboardButton? = - this as? URLInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.uRLInlineKeyboardButtonOrThrow(): URLInlineKeyboardButton = - this as URLInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.ifWebAppKeyboardButton(block: (WebAppKeyboardButton) -> T) = - webAppKeyboardButtonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineKeyboardButton.webAppKeyboardButtonOrNull(): WebAppKeyboardButton? = this as? WebAppKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.webAppKeyboardButtonOrThrow(): WebAppKeyboardButton = - this as WebAppKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.ifUnknownInlineKeyboardButton(block: (UnknownInlineKeyboardButton) -> T) = - unknownInlineKeyboardButtonOrNull()?.let(block) - -@PreviewFeature -inline fun InlineKeyboardButton.unknownInlineKeyboardButtonOrNull(): UnknownInlineKeyboardButton? = - this as? UnknownInlineKeyboardButton - -@PreviewFeature -inline fun InlineKeyboardButton.unknownInlineKeyboardButtonOrThrow(): UnknownInlineKeyboardButton = - this as UnknownInlineKeyboardButton - -@PreviewFeature -inline fun Poll.ifMultipleAnswersPoll(block: (MultipleAnswersPoll) -> T) = multipleAnswersPollOrNull()?.let(block) - -@PreviewFeature -inline fun Poll.multipleAnswersPollOrNull(): MultipleAnswersPoll? = this as? MultipleAnswersPoll - -@PreviewFeature -inline fun Poll.multipleAnswersPollOrThrow(): MultipleAnswersPoll = this as MultipleAnswersPoll - -@PreviewFeature -inline fun Poll.ifQuizPoll(block: (QuizPoll) -> T) = quizPollOrNull()?.let(block) - -@PreviewFeature -inline fun Poll.quizPollOrNull(): QuizPoll? = this as? QuizPoll - -@PreviewFeature -inline fun Poll.quizPollOrThrow(): QuizPoll = this as QuizPoll - -@PreviewFeature -inline fun Poll.ifRegularPoll(block: (RegularPoll) -> T) = regularPollOrNull()?.let(block) - -@PreviewFeature -inline fun Poll.regularPollOrNull(): RegularPoll? = this as? RegularPoll - -@PreviewFeature -inline fun Poll.regularPollOrThrow(): RegularPoll = this as RegularPoll - -@PreviewFeature -inline fun Poll.ifUnknownPollType(block: (UnknownPollType) -> T) = unknownPollTypeOrNull()?.let(block) - -@PreviewFeature -inline fun Poll.unknownPollTypeOrNull(): UnknownPollType? = this as? UnknownPollType - -@PreviewFeature -inline fun Poll.unknownPollTypeOrThrow(): UnknownPollType = this as UnknownPollType - -@PreviewFeature -inline fun ResendableContent.ifContactContent(block: (ContactContent) -> T) = contactContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.contactContentOrNull(): ContactContent? = this as? ContactContent - -@PreviewFeature -inline fun ResendableContent.contactContentOrThrow(): ContactContent = this as ContactContent - -@PreviewFeature -inline fun ResendableContent.ifDiceContent(block: (DiceContent) -> T) = diceContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.diceContentOrNull(): DiceContent? = this as? DiceContent - -@PreviewFeature -inline fun ResendableContent.diceContentOrThrow(): DiceContent = this as DiceContent - -@PreviewFeature -inline fun ResendableContent.ifGameContent(block: (GameContent) -> T) = gameContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.gameContentOrNull(): GameContent? = this as? GameContent - -@PreviewFeature -inline fun ResendableContent.gameContentOrThrow(): GameContent = this as GameContent - -@PreviewFeature -inline fun ResendableContent.ifLocationContent(block: (LocationContent) -> T) = locationContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.locationContentOrNull(): LocationContent? = this as? LocationContent - -@PreviewFeature -inline fun ResendableContent.locationContentOrThrow(): LocationContent = this as LocationContent - -@PreviewFeature -inline fun ResendableContent.ifLiveLocationContent(block: (LiveLocationContent) -> T) = - liveLocationContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.liveLocationContentOrNull(): LiveLocationContent? = this as? LiveLocationContent - -@PreviewFeature -inline fun ResendableContent.liveLocationContentOrThrow(): LiveLocationContent = this as LiveLocationContent - -@PreviewFeature -inline fun ResendableContent.ifStaticLocationContent(block: (StaticLocationContent) -> T) = - staticLocationContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.staticLocationContentOrNull(): StaticLocationContent? = this as? StaticLocationContent - -@PreviewFeature -inline fun ResendableContent.staticLocationContentOrThrow(): StaticLocationContent = this as StaticLocationContent - -@PreviewFeature -inline fun ResendableContent.ifPollContent(block: (PollContent) -> T) = pollContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.pollContentOrNull(): PollContent? = this as? PollContent - -@PreviewFeature -inline fun ResendableContent.pollContentOrThrow(): PollContent = this as PollContent - -@PreviewFeature -inline fun ResendableContent.ifTextContent(block: (TextContent) -> T) = textContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.textContentOrNull(): TextContent? = this as? TextContent - -@PreviewFeature -inline fun ResendableContent.textContentOrThrow(): TextContent = this as TextContent - -@PreviewFeature -inline fun ResendableContent.ifVenueContent(block: (VenueContent) -> T) = venueContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.venueContentOrNull(): VenueContent? = this as? VenueContent - -@PreviewFeature -inline fun ResendableContent.venueContentOrThrow(): VenueContent = this as VenueContent - -@PreviewFeature -inline fun ResendableContent.ifAudioMediaGroupContent(block: (AudioMediaGroupContent) -> T) = - audioMediaGroupContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.audioMediaGroupContentOrNull(): AudioMediaGroupContent? = this as? AudioMediaGroupContent - -@PreviewFeature -inline fun ResendableContent.audioMediaGroupContentOrThrow(): AudioMediaGroupContent = this as AudioMediaGroupContent - -@PreviewFeature -inline fun ResendableContent.ifDocumentMediaGroupContent(block: (DocumentMediaGroupContent) -> T) = - documentMediaGroupContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.documentMediaGroupContentOrNull(): DocumentMediaGroupContent? = - this as? DocumentMediaGroupContent - -@PreviewFeature -inline fun ResendableContent.documentMediaGroupContentOrThrow(): DocumentMediaGroupContent = - this as DocumentMediaGroupContent - -@PreviewFeature -inline fun ResendableContent.ifMediaCollectionContent(block: (MediaCollectionContent) -> T) = - mediaCollectionContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.mediaCollectionContentOrNull(): MediaCollectionContent? = - this as? MediaCollectionContent - -@PreviewFeature -inline fun ResendableContent.mediaCollectionContentOrThrow(): MediaCollectionContent = - this as MediaCollectionContent - -@PreviewFeature -inline fun ResendableContent.ifTextedMediaContent(block: (TextedMediaContent) -> T) = - textedMediaContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.textedMediaContentOrNull(): TextedMediaContent? = - this as? TextedMediaContent - -@PreviewFeature -inline fun ResendableContent.textedMediaContentOrThrow(): TextedMediaContent = - this as TextedMediaContent - -@PreviewFeature -inline fun ResendableContent.ifMediaContent(block: (MediaContent) -> T) = mediaContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.mediaContentOrNull(): MediaContent? = this as? MediaContent - -@PreviewFeature -inline fun ResendableContent.mediaContentOrThrow(): MediaContent = this as MediaContent - -@PreviewFeature -inline fun ResendableContent.ifMediaGroupContent(block: (MediaGroupContent) -> T) = - mediaGroupContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.mediaGroupContentOrNull(): MediaGroupContent? = this as? MediaGroupContent - -@PreviewFeature -inline fun ResendableContent.mediaGroupContentOrThrow(): MediaGroupContent = this as MediaGroupContent - -@PreviewFeature -inline fun ResendableContent.ifMessageContent(block: (MessageContent) -> T) = messageContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.messageContentOrNull(): MessageContent? = this as? MessageContent - -@PreviewFeature -inline fun ResendableContent.messageContentOrThrow(): MessageContent = this as MessageContent - -@PreviewFeature -inline fun ResendableContent.ifVisualMediaGroupContent(block: (VisualMediaGroupContent) -> T) = - visualMediaGroupContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.visualMediaGroupContentOrNull(): VisualMediaGroupContent? = - this as? VisualMediaGroupContent - -@PreviewFeature -inline fun ResendableContent.visualMediaGroupContentOrThrow(): VisualMediaGroupContent = this as VisualMediaGroupContent - -@PreviewFeature -inline fun ResendableContent.ifAnimationContent(block: (AnimationContent) -> T) = - animationContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.animationContentOrNull(): AnimationContent? = this as? AnimationContent - -@PreviewFeature -inline fun ResendableContent.animationContentOrThrow(): AnimationContent = this as AnimationContent - -@PreviewFeature -inline fun ResendableContent.ifAudioContent(block: (AudioContent) -> T) = audioContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.audioContentOrNull(): AudioContent? = this as? AudioContent - -@PreviewFeature -inline fun ResendableContent.audioContentOrThrow(): AudioContent = this as AudioContent - -@PreviewFeature -inline fun ResendableContent.ifDocumentContent(block: (DocumentContent) -> T) = documentContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.documentContentOrNull(): DocumentContent? = this as? DocumentContent - -@PreviewFeature -inline fun ResendableContent.documentContentOrThrow(): DocumentContent = this as DocumentContent - -@PreviewFeature -inline fun ResendableContent.ifPhotoContent(block: (PhotoContent) -> T) = photoContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.photoContentOrNull(): PhotoContent? = this as? PhotoContent - -@PreviewFeature -inline fun ResendableContent.photoContentOrThrow(): PhotoContent = this as PhotoContent - -@PreviewFeature -inline fun ResendableContent.ifStickerContent(block: (StickerContent) -> T) = stickerContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.stickerContentOrNull(): StickerContent? = this as? StickerContent - -@PreviewFeature -inline fun ResendableContent.stickerContentOrThrow(): StickerContent = this as StickerContent - -@PreviewFeature -inline fun ResendableContent.ifVideoContent(block: (VideoContent) -> T) = videoContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.videoContentOrNull(): VideoContent? = this as? VideoContent - -@PreviewFeature -inline fun ResendableContent.videoContentOrThrow(): VideoContent = this as VideoContent - -@PreviewFeature -inline fun ResendableContent.ifVideoNoteContent(block: (VideoNoteContent) -> T) = - videoNoteContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.videoNoteContentOrNull(): VideoNoteContent? = this as? VideoNoteContent - -@PreviewFeature -inline fun ResendableContent.videoNoteContentOrThrow(): VideoNoteContent = this as VideoNoteContent - -@PreviewFeature -inline fun ResendableContent.ifVoiceContent(block: (VoiceContent) -> T) = voiceContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.voiceContentOrNull(): VoiceContent? = this as? VoiceContent - -@PreviewFeature -inline fun ResendableContent.voiceContentOrThrow(): VoiceContent = this as VoiceContent - -@PreviewFeature -inline fun ResendableContent.ifInvoiceContent(block: (InvoiceContent) -> T) = invoiceContentOrNull()?.let(block) - -@PreviewFeature -inline fun ResendableContent.invoiceContentOrNull(): InvoiceContent? = this as? InvoiceContent - -@PreviewFeature -inline fun ResendableContent.invoiceContentOrThrow(): InvoiceContent = this as InvoiceContent - -@PreviewFeature -inline fun TextSource.ifMultilevelTextSource(block: (MultilevelTextSource) -> T) = - multilevelTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.multilevelTextSourceOrNull(): MultilevelTextSource? = this as? MultilevelTextSource - -@PreviewFeature -inline fun TextSource.multilevelTextSourceOrThrow(): MultilevelTextSource = this as MultilevelTextSource - -@PreviewFeature -inline fun TextSource.ifBoldTextSource(block: (BoldTextSource) -> T) = boldTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.boldTextSourceOrNull(): BoldTextSource? = this as? BoldTextSource - -@PreviewFeature -inline fun TextSource.boldTextSourceOrThrow(): BoldTextSource = this as BoldTextSource - -@PreviewFeature -inline fun TextSource.ifBotCommandTextSource(block: (BotCommandTextSource) -> T) = - botCommandTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.botCommandTextSourceOrNull(): BotCommandTextSource? = this as? BotCommandTextSource - -@PreviewFeature -inline fun TextSource.botCommandTextSourceOrThrow(): BotCommandTextSource = this as BotCommandTextSource - -@PreviewFeature -inline fun TextSource.ifCashTagTextSource(block: (CashTagTextSource) -> T) = cashTagTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.cashTagTextSourceOrNull(): CashTagTextSource? = this as? CashTagTextSource - -@PreviewFeature -inline fun TextSource.cashTagTextSourceOrThrow(): CashTagTextSource = this as CashTagTextSource - -@PreviewFeature -inline fun TextSource.ifCodeTextSource(block: (CodeTextSource) -> T) = codeTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.codeTextSourceOrNull(): CodeTextSource? = this as? CodeTextSource - -@PreviewFeature -inline fun TextSource.codeTextSourceOrThrow(): CodeTextSource = this as CodeTextSource - -@PreviewFeature -inline fun TextSource.ifEMailTextSource(block: (EMailTextSource) -> T) = eMailTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.eMailTextSourceOrNull(): EMailTextSource? = this as? EMailTextSource - -@PreviewFeature -inline fun TextSource.eMailTextSourceOrThrow(): EMailTextSource = this as EMailTextSource - -@PreviewFeature -inline fun TextSource.ifHashTagTextSource(block: (HashTagTextSource) -> T) = hashTagTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.hashTagTextSourceOrNull(): HashTagTextSource? = this as? HashTagTextSource - -@PreviewFeature -inline fun TextSource.hashTagTextSourceOrThrow(): HashTagTextSource = this as HashTagTextSource - -@PreviewFeature -inline fun TextSource.ifItalicTextSource(block: (ItalicTextSource) -> T) = italicTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.italicTextSourceOrNull(): ItalicTextSource? = this as? ItalicTextSource - -@PreviewFeature -inline fun TextSource.italicTextSourceOrThrow(): ItalicTextSource = this as ItalicTextSource - -@PreviewFeature -inline fun TextSource.ifMentionTextSource(block: (MentionTextSource) -> T) = mentionTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.mentionTextSourceOrNull(): MentionTextSource? = this as? MentionTextSource - -@PreviewFeature -inline fun TextSource.mentionTextSourceOrThrow(): MentionTextSource = this as MentionTextSource - -@PreviewFeature -inline fun TextSource.ifPhoneNumberTextSource(block: (PhoneNumberTextSource) -> T) = - phoneNumberTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.phoneNumberTextSourceOrNull(): PhoneNumberTextSource? = this as? PhoneNumberTextSource - -@PreviewFeature -inline fun TextSource.phoneNumberTextSourceOrThrow(): PhoneNumberTextSource = this as PhoneNumberTextSource - -@PreviewFeature -inline fun TextSource.ifPreTextSource(block: (PreTextSource) -> T) = preTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.preTextSourceOrNull(): PreTextSource? = this as? PreTextSource - -@PreviewFeature -inline fun TextSource.preTextSourceOrThrow(): PreTextSource = this as PreTextSource - -@PreviewFeature -inline fun TextSource.ifRegularTextSource(block: (RegularTextSource) -> T) = regularTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.regularTextSourceOrNull(): RegularTextSource? = this as? RegularTextSource - -@PreviewFeature -inline fun TextSource.regularTextSourceOrThrow(): RegularTextSource = this as RegularTextSource - -@PreviewFeature -inline fun TextSource.ifStrikethroughTextSource(block: (StrikethroughTextSource) -> T) = - strikethroughTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.strikethroughTextSourceOrNull(): StrikethroughTextSource? = this as? StrikethroughTextSource - -@PreviewFeature -inline fun TextSource.strikethroughTextSourceOrThrow(): StrikethroughTextSource = this as StrikethroughTextSource - -@PreviewFeature -inline fun TextSource.ifTextLinkTextSource(block: (TextLinkTextSource) -> T) = - textLinkTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.textLinkTextSourceOrNull(): TextLinkTextSource? = this as? TextLinkTextSource - -@PreviewFeature -inline fun TextSource.textLinkTextSourceOrThrow(): TextLinkTextSource = this as TextLinkTextSource - -@PreviewFeature -inline fun TextSource.ifTextMentionTextSource(block: (TextMentionTextSource) -> T) = - textMentionTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.textMentionTextSourceOrNull(): TextMentionTextSource? = this as? TextMentionTextSource - -@PreviewFeature -inline fun TextSource.textMentionTextSourceOrThrow(): TextMentionTextSource = this as TextMentionTextSource - -@PreviewFeature -inline fun TextSource.ifURLTextSource(block: (URLTextSource) -> T) = uRLTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.uRLTextSourceOrNull(): URLTextSource? = this as? URLTextSource - -@PreviewFeature -inline fun TextSource.uRLTextSourceOrThrow(): URLTextSource = this as URLTextSource - -@PreviewFeature -inline fun TextSource.ifUnderlineTextSource(block: (UnderlineTextSource) -> T) = - underlineTextSourceOrNull()?.let(block) - -@PreviewFeature -inline fun TextSource.underlineTextSourceOrNull(): UnderlineTextSource? = this as? UnderlineTextSource - -@PreviewFeature -inline fun TextSource.underlineTextSourceOrThrow(): UnderlineTextSource = this as UnderlineTextSource - -@PreviewFeature -inline fun DiceAnimationType.ifBasketballDiceAnimationType(block: (BasketballDiceAnimationType) -> T) = - basketballDiceAnimationTypeOrNull()?.let(block) - -@PreviewFeature -inline fun DiceAnimationType.basketballDiceAnimationTypeOrNull(): BasketballDiceAnimationType? = - this as? BasketballDiceAnimationType - -@PreviewFeature -inline fun DiceAnimationType.basketballDiceAnimationTypeOrThrow(): BasketballDiceAnimationType = - this as BasketballDiceAnimationType - -@PreviewFeature -inline fun DiceAnimationType.ifBowlingDiceAnimationType(block: (BowlingDiceAnimationType) -> T) = - bowlingDiceAnimationTypeOrNull()?.let(block) - -@PreviewFeature -inline fun DiceAnimationType.bowlingDiceAnimationTypeOrNull(): BowlingDiceAnimationType? = - this as? BowlingDiceAnimationType - -@PreviewFeature -inline fun DiceAnimationType.bowlingDiceAnimationTypeOrThrow(): BowlingDiceAnimationType = - this as BowlingDiceAnimationType - -@PreviewFeature -inline fun DiceAnimationType.ifCubeDiceAnimationType(block: (CubeDiceAnimationType) -> T) = - cubeDiceAnimationTypeOrNull()?.let(block) - -@PreviewFeature -inline fun DiceAnimationType.cubeDiceAnimationTypeOrNull(): CubeDiceAnimationType? = this as? CubeDiceAnimationType - -@PreviewFeature -inline fun DiceAnimationType.cubeDiceAnimationTypeOrThrow(): CubeDiceAnimationType = this as CubeDiceAnimationType - -@PreviewFeature -inline fun DiceAnimationType.ifCustomDiceAnimationType(block: (CustomDiceAnimationType) -> T) = - customDiceAnimationTypeOrNull()?.let(block) - -@PreviewFeature -inline fun DiceAnimationType.customDiceAnimationTypeOrNull(): CustomDiceAnimationType? = - this as? CustomDiceAnimationType - -@PreviewFeature -inline fun DiceAnimationType.customDiceAnimationTypeOrThrow(): CustomDiceAnimationType = this as CustomDiceAnimationType - -@PreviewFeature -inline fun DiceAnimationType.ifDartsDiceAnimationType(block: (DartsDiceAnimationType) -> T) = - dartsDiceAnimationTypeOrNull()?.let(block) - -@PreviewFeature -inline fun DiceAnimationType.dartsDiceAnimationTypeOrNull(): DartsDiceAnimationType? = this as? DartsDiceAnimationType - -@PreviewFeature -inline fun DiceAnimationType.dartsDiceAnimationTypeOrThrow(): DartsDiceAnimationType = this as DartsDiceAnimationType - -@PreviewFeature -inline fun DiceAnimationType.ifFootballDiceAnimationType(block: (FootballDiceAnimationType) -> T) = - footballDiceAnimationTypeOrNull()?.let(block) - -@PreviewFeature -inline fun DiceAnimationType.footballDiceAnimationTypeOrNull(): FootballDiceAnimationType? = - this as? FootballDiceAnimationType - -@PreviewFeature -inline fun DiceAnimationType.footballDiceAnimationTypeOrThrow(): FootballDiceAnimationType = - this as FootballDiceAnimationType - -@PreviewFeature -inline fun DiceAnimationType.ifSlotMachineDiceAnimationType(block: (SlotMachineDiceAnimationType) -> T) = - slotMachineDiceAnimationTypeOrNull()?.let(block) - -@PreviewFeature -inline fun DiceAnimationType.slotMachineDiceAnimationTypeOrNull(): SlotMachineDiceAnimationType? = - this as? SlotMachineDiceAnimationType - -@PreviewFeature -inline fun DiceAnimationType.slotMachineDiceAnimationTypeOrThrow(): SlotMachineDiceAnimationType = - this as SlotMachineDiceAnimationType - -@PreviewFeature -inline fun ChatEvent.ifChannelChatCreated(block: (ChannelChatCreated) -> T) = channelChatCreatedOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.channelChatCreatedOrNull(): ChannelChatCreated? = this as? ChannelChatCreated - -@PreviewFeature -inline fun ChatEvent.channelChatCreatedOrThrow(): ChannelChatCreated = this as ChannelChatCreated - -@PreviewFeature -inline fun ChatEvent.ifDeleteChatPhoto(block: (DeleteChatPhoto) -> T) = deleteChatPhotoOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.deleteChatPhotoOrNull(): DeleteChatPhoto? = this as? DeleteChatPhoto - -@PreviewFeature -inline fun ChatEvent.deleteChatPhotoOrThrow(): DeleteChatPhoto = this as DeleteChatPhoto - -@PreviewFeature -inline fun ChatEvent.ifGroupChatCreated(block: (GroupChatCreated) -> T) = groupChatCreatedOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.groupChatCreatedOrNull(): GroupChatCreated? = this as? GroupChatCreated - -@PreviewFeature -inline fun ChatEvent.groupChatCreatedOrThrow(): GroupChatCreated = this as GroupChatCreated - -@PreviewFeature -inline fun ChatEvent.ifLeftChatMember(block: (LeftChatMember) -> T) = leftChatMemberOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.leftChatMemberOrNull(): LeftChatMember? = this as? LeftChatMember - -@PreviewFeature -inline fun ChatEvent.leftChatMemberOrThrow(): LeftChatMember = this as LeftChatMember - -@PreviewFeature -inline fun ChatEvent.ifMessageAutoDeleteTimerChanged(block: (MessageAutoDeleteTimerChanged) -> T) = - messageAutoDeleteTimerChangedOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.messageAutoDeleteTimerChangedOrNull(): MessageAutoDeleteTimerChanged? = - this as? MessageAutoDeleteTimerChanged - -@PreviewFeature -inline fun ChatEvent.messageAutoDeleteTimerChangedOrThrow(): MessageAutoDeleteTimerChanged = - this as MessageAutoDeleteTimerChanged - -@PreviewFeature -inline fun ChatEvent.ifNewChatMembers(block: (NewChatMembers) -> T) = newChatMembersOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.newChatMembersOrNull(): NewChatMembers? = this as? NewChatMembers - -@PreviewFeature -inline fun ChatEvent.newChatMembersOrThrow(): NewChatMembers = this as NewChatMembers - -@PreviewFeature -inline fun ChatEvent.ifNewChatPhoto(block: (NewChatPhoto) -> T) = newChatPhotoOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.newChatPhotoOrNull(): NewChatPhoto? = this as? NewChatPhoto - -@PreviewFeature -inline fun ChatEvent.newChatPhotoOrThrow(): NewChatPhoto = this as NewChatPhoto - -@PreviewFeature -inline fun ChatEvent.ifNewChatTitle(block: (NewChatTitle) -> T) = newChatTitleOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.newChatTitleOrNull(): NewChatTitle? = this as? NewChatTitle - -@PreviewFeature -inline fun ChatEvent.newChatTitleOrThrow(): NewChatTitle = this as NewChatTitle - -@PreviewFeature -inline fun ChatEvent.ifPinnedMessage(block: (PinnedMessage) -> T) = pinnedMessageOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.pinnedMessageOrNull(): PinnedMessage? = this as? PinnedMessage - -@PreviewFeature -inline fun ChatEvent.pinnedMessageOrThrow(): PinnedMessage = this as PinnedMessage - -@PreviewFeature -inline fun ChatEvent.ifSuccessfulPaymentEvent(block: (SuccessfulPaymentEvent) -> T) = - successfulPaymentEventOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.successfulPaymentEventOrNull(): SuccessfulPaymentEvent? = this as? SuccessfulPaymentEvent - -@PreviewFeature -inline fun ChatEvent.successfulPaymentEventOrThrow(): SuccessfulPaymentEvent = this as SuccessfulPaymentEvent - -@PreviewFeature -inline fun ChatEvent.ifProximityAlertTriggered(block: (ProximityAlertTriggered) -> T) = - proximityAlertTriggeredOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.proximityAlertTriggeredOrNull(): ProximityAlertTriggered? = this as? ProximityAlertTriggered - -@PreviewFeature -inline fun ChatEvent.proximityAlertTriggeredOrThrow(): ProximityAlertTriggered = this as ProximityAlertTriggered - -@PreviewFeature -inline fun ChatEvent.ifSupergroupChatCreated(block: (SupergroupChatCreated) -> T) = - supergroupChatCreatedOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.supergroupChatCreatedOrNull(): SupergroupChatCreated? = this as? SupergroupChatCreated - -@PreviewFeature -inline fun ChatEvent.supergroupChatCreatedOrThrow(): SupergroupChatCreated = this as SupergroupChatCreated - -@PreviewFeature -inline fun ChatEvent.ifMigratedToSupergroup(block: (MigratedToSupergroup) -> T) = - migratedToSupergroupOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.migratedToSupergroupOrNull(): MigratedToSupergroup? = this as? MigratedToSupergroup - -@PreviewFeature -inline fun ChatEvent.migratedToSupergroupOrThrow(): MigratedToSupergroup = this as MigratedToSupergroup - -@PreviewFeature -inline fun ChatEvent.ifChannelEvent(block: (ChannelEvent) -> T) = channelEventOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.channelEventOrNull(): ChannelEvent? = this as? ChannelEvent - -@PreviewFeature -inline fun ChatEvent.channelEventOrThrow(): ChannelEvent = this as ChannelEvent - -@PreviewFeature -inline fun ChatEvent.ifPublicChatEvent(block: (PublicChatEvent) -> T) = publicChatEventOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.publicChatEventOrNull(): PublicChatEvent? = this as? PublicChatEvent - -@PreviewFeature -inline fun ChatEvent.publicChatEventOrThrow(): PublicChatEvent = this as PublicChatEvent - -@PreviewFeature -inline fun ChatEvent.ifCommonEvent(block: (CommonEvent) -> T) = commonEventOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.commonEventOrNull(): CommonEvent? = this as? CommonEvent - -@PreviewFeature -inline fun ChatEvent.commonEventOrThrow(): CommonEvent = this as CommonEvent - -@PreviewFeature -inline fun ChatEvent.ifGroupEvent(block: (GroupEvent) -> T) = groupEventOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.groupEventOrNull(): GroupEvent? = this as? GroupEvent - -@PreviewFeature -inline fun ChatEvent.groupEventOrThrow(): GroupEvent = this as GroupEvent - -@PreviewFeature -inline fun ChatEvent.ifSupergroupEvent(block: (SupergroupEvent) -> T) = supergroupEventOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.supergroupEventOrNull(): SupergroupEvent? = this as? SupergroupEvent - -@PreviewFeature -inline fun ChatEvent.supergroupEventOrThrow(): SupergroupEvent = this as SupergroupEvent - -@PreviewFeature -inline fun ChatEvent.ifVideoChatEvent(block: (VideoChatEvent) -> T) = videoChatEventOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.videoChatEventOrNull(): VideoChatEvent? = this as? VideoChatEvent - -@PreviewFeature -inline fun ChatEvent.videoChatEventOrThrow(): VideoChatEvent = this as VideoChatEvent - -@PreviewFeature -inline fun ChatEvent.ifVideoChatEnded(block: (VideoChatEnded) -> T) = videoChatEndedOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.videoChatEndedOrNull(): VideoChatEnded? = this as? VideoChatEnded - -@PreviewFeature -inline fun ChatEvent.videoChatEndedOrThrow(): VideoChatEnded = this as VideoChatEnded - -@PreviewFeature -inline fun ChatEvent.ifVideoChatParticipantsInvited(block: (VideoChatParticipantsInvited) -> T) = - videoChatParticipantsInvitedOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.videoChatParticipantsInvitedOrNull(): VideoChatParticipantsInvited? = - this as? VideoChatParticipantsInvited - -@PreviewFeature -inline fun ChatEvent.videoChatParticipantsInvitedOrThrow(): VideoChatParticipantsInvited = - this as VideoChatParticipantsInvited - -@PreviewFeature -inline fun ChatEvent.ifVideoChatStarted(block: (VideoChatStarted) -> T) = videoChatStartedOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.videoChatStartedOrNull(): VideoChatStarted? = this as? VideoChatStarted - -@PreviewFeature -inline fun ChatEvent.videoChatStartedOrThrow(): VideoChatStarted = this as VideoChatStarted - -@PreviewFeature -inline fun ChatEvent.ifVideoChatScheduled(block: (VideoChatScheduled) -> T) = videoChatScheduledOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.videoChatScheduledOrNull(): VideoChatScheduled? = this as? VideoChatScheduled - -@PreviewFeature -inline fun ChatEvent.videoChatScheduledOrThrow(): VideoChatScheduled = this as VideoChatScheduled - -@PreviewFeature -inline fun ChatEvent.ifUserLoggedIn(block: (UserLoggedIn) -> T) = userLoggedInOrNull()?.let(block) - -@PreviewFeature -inline fun ChatEvent.userLoggedInOrNull(): UserLoggedIn? = this as? UserLoggedIn - -@PreviewFeature -inline fun ChatEvent.userLoggedInOrThrow(): UserLoggedIn = this as UserLoggedIn - -@PreviewFeature -inline fun CommonSendInvoiceData.ifSendInvoice(block: (SendInvoice) -> T) = sendInvoiceOrNull()?.let(block) - -@PreviewFeature -inline fun CommonSendInvoiceData.sendInvoiceOrNull(): SendInvoice? = this as? SendInvoice - -@PreviewFeature -inline fun CommonSendInvoiceData.sendInvoiceOrThrow(): SendInvoice = this as SendInvoice - -@PreviewFeature -inline fun CommonSendInvoiceData.ifCreateInvoiceLink(block: (CreateInvoiceLink) -> T) = - createInvoiceLinkOrNull()?.let(block) - -@PreviewFeature -inline fun CommonSendInvoiceData.createInvoiceLinkOrNull(): CreateInvoiceLink? = this as? CreateInvoiceLink - -@PreviewFeature -inline fun CommonSendInvoiceData.createInvoiceLinkOrThrow(): CreateInvoiceLink = this as CreateInvoiceLink - -@PreviewFeature -inline fun CommonSendInvoiceData.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T) = - inputInvoiceMessageContentOrNull()?.let(block) - -@PreviewFeature -inline fun CommonSendInvoiceData.inputInvoiceMessageContentOrNull(): InputInvoiceMessageContent? = - this as? InputInvoiceMessageContent - -@PreviewFeature -inline fun CommonSendInvoiceData.inputInvoiceMessageContentOrThrow(): InputInvoiceMessageContent = - this as InputInvoiceMessageContent - @PreviewFeature inline fun Any.ifFromUser(block: (FromUser) -> T) = fromUserOrNull()?.let(block) @@ -3561,196 +93,3 @@ inline fun Any.withOptionalLanguageCodeOrNull(): WithOptionalLanguageCode? = thi @PreviewFeature inline fun Any.withOptionalLanguageCodeOrThrow(): WithOptionalLanguageCode = this as WithOptionalLanguageCode - -@PreviewFeature -inline fun Location.ifStaticLocation(block: (StaticLocation) -> T) = staticLocationOrNull()?.let(block) - -@PreviewFeature -inline fun Location.staticLocationOrNull(): StaticLocation? = this as? StaticLocation - -@PreviewFeature -inline fun Location.staticLocationOrThrow(): StaticLocation = this as StaticLocation - -@PreviewFeature -inline fun Location.ifLiveLocation(block: (LiveLocation) -> T) = liveLocationOrNull()?.let(block) - -@PreviewFeature -inline fun Location.liveLocationOrNull(): LiveLocation? = this as? LiveLocation - -@PreviewFeature -inline fun Location.liveLocationOrThrow(): LiveLocation = this as LiveLocation - -@PreviewFeature -inline fun ChatInviteLink.ifPrimaryInviteLink(block: (PrimaryInviteLink) -> T) = - primaryInviteLinkOrNull()?.let(block) - -@PreviewFeature -inline fun ChatInviteLink.primaryInviteLinkOrNull(): PrimaryInviteLink? = this as? PrimaryInviteLink - -@PreviewFeature -inline fun ChatInviteLink.primaryInviteLinkOrThrow(): PrimaryInviteLink = this as PrimaryInviteLink - -@PreviewFeature -inline fun ChatInviteLink.ifSecondaryChatInviteLink(block: (SecondaryChatInviteLink) -> T) = - secondaryChatInviteLinkOrNull()?.let(block) - -@PreviewFeature -inline fun ChatInviteLink.secondaryChatInviteLinkOrNull(): SecondaryChatInviteLink? = this as? SecondaryChatInviteLink - -@PreviewFeature -inline fun ChatInviteLink.secondaryChatInviteLinkOrThrow(): SecondaryChatInviteLink = this as SecondaryChatInviteLink - -@PreviewFeature -inline fun ChatInviteLink.ifChatInviteLinkWithJoinRequest(block: (ChatInviteLinkWithJoinRequest) -> T) = - chatInviteLinkWithJoinRequestOrNull()?.let(block) - -@PreviewFeature -inline fun ChatInviteLink.chatInviteLinkWithJoinRequestOrNull(): ChatInviteLinkWithJoinRequest? = - this as? ChatInviteLinkWithJoinRequest - -@PreviewFeature -inline fun ChatInviteLink.chatInviteLinkWithJoinRequestOrThrow(): ChatInviteLinkWithJoinRequest = - this as ChatInviteLinkWithJoinRequest - -@PreviewFeature -inline fun ChatInviteLink.ifChatInviteLinkWithLimitedMembers(block: (ChatInviteLinkWithLimitedMembers) -> T) = - chatInviteLinkWithLimitedMembersOrNull()?.let(block) - -@PreviewFeature -inline fun ChatInviteLink.chatInviteLinkWithLimitedMembersOrNull(): ChatInviteLinkWithLimitedMembers? = - this as? ChatInviteLinkWithLimitedMembers - -@PreviewFeature -inline fun ChatInviteLink.chatInviteLinkWithLimitedMembersOrThrow(): ChatInviteLinkWithLimitedMembers = - this as ChatInviteLinkWithLimitedMembers - -@PreviewFeature -inline fun ChatInviteLink.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T) = - chatInviteLinkUnlimitedOrNull()?.let(block) - -@PreviewFeature -inline fun ChatInviteLink.chatInviteLinkUnlimitedOrNull(): ChatInviteLinkUnlimited? = this as? ChatInviteLinkUnlimited - -@PreviewFeature -inline fun ChatInviteLink.chatInviteLinkUnlimitedOrThrow(): ChatInviteLinkUnlimited = this as ChatInviteLinkUnlimited - -@PreviewFeature -inline fun ForwardInfo.ifAnonymousForwardInfo(block: (ForwardInfo.ByAnonymous) -> T) = - anonymousForwardInfoOrNull()?.let(block) - -@PreviewFeature -inline fun ForwardInfo.anonymousForwardInfoOrNull(): ForwardInfo.ByAnonymous? = this as? ForwardInfo.ByAnonymous - -@PreviewFeature -inline fun ForwardInfo.anonymousForwardInfoOrThrow(): ForwardInfo.ByAnonymous = this as ForwardInfo.ByAnonymous - -@PreviewFeature -inline fun ForwardInfo.ifUserForwardInfo(block: (ForwardInfo.ByUser) -> T) = userForwardInfoOrNull()?.let(block) - -@PreviewFeature -inline fun ForwardInfo.userForwardInfoOrNull(): ForwardInfo.ByUser? = this as? ForwardInfo.ByUser - -@PreviewFeature -inline fun ForwardInfo.userForwardInfoOrThrow(): ForwardInfo.ByUser = this as ForwardInfo.ByUser - -@PreviewFeature -inline fun ForwardInfo.ifForwardFromPublicChatInfo(block: (ForwardInfo.PublicChat) -> T) = - forwardFromPublicChatInfoOrNull()?.let(block) - -@PreviewFeature -inline fun ForwardInfo.forwardFromPublicChatInfoOrNull(): ForwardInfo.PublicChat? = - this as? ForwardInfo.PublicChat - -@PreviewFeature -inline fun ForwardInfo.forwardFromPublicChatInfoOrThrow(): ForwardInfo.PublicChat = this as ForwardInfo.PublicChat - -@PreviewFeature -inline fun ForwardInfo.ifForwardFromChannelInfo(block: (ForwardInfo.PublicChat.FromChannel) -> T) = - forwardFromChannelInfoOrNull()?.let(block) - -@PreviewFeature -inline fun ForwardInfo.forwardFromChannelInfoOrNull(): ForwardInfo.PublicChat.FromChannel? = - this as? ForwardInfo.PublicChat.FromChannel - -@PreviewFeature -inline fun ForwardInfo.forwardFromChannelInfoOrThrow(): ForwardInfo.PublicChat.FromChannel = - this as ForwardInfo.PublicChat.FromChannel - -@PreviewFeature -inline fun ForwardInfo.ifForwardSentByChannelInfo(block: (ForwardInfo.PublicChat.SentByChannel) -> T) = - forwardSentByChannelInfoOrNull()?.let(block) - -@PreviewFeature -inline fun ForwardInfo.forwardSentByChannelInfoOrNull(): ForwardInfo.PublicChat.SentByChannel? = - this as? ForwardInfo.PublicChat.SentByChannel - -@PreviewFeature -inline fun ForwardInfo.forwardSentByChannelInfoOrThrow(): ForwardInfo.PublicChat.SentByChannel = - this as ForwardInfo.PublicChat.SentByChannel - -@PreviewFeature -inline fun ForwardInfo.ifForwardFromSupergroupInfo(block: (ForwardInfo.PublicChat.FromSupergroup) -> T) = - forwardFromSupergroupInfoOrNull()?.let(block) - -@PreviewFeature -inline fun ForwardInfo.forwardFromSupergroupInfoOrNull(): ForwardInfo.PublicChat.FromSupergroup? = - this as? ForwardInfo.PublicChat.FromSupergroup - -@PreviewFeature -inline fun ForwardInfo.forwardFromSupergroupInfoOrThrow(): ForwardInfo.PublicChat.FromSupergroup = - this as ForwardInfo.PublicChat.FromSupergroup - -@PreviewFeature -inline fun MessageContent.ifTextedInput(block: (TextedInput) -> T) = textedInputOrNull()?.let(block) - -@PreviewFeature -inline fun MessageContent.textedInputOrNull(): TextedInput? = this as? TextedInput - -@PreviewFeature -inline fun MessageContent.textedInputOrThrow(): TextedInput = this as TextedInput - -@PreviewFeature -inline fun ScheduledCloseInfo.ifExactScheduledCloseInfo(block: (ExactScheduledCloseInfo) -> T) = - exactScheduledCloseInfoOrNull()?.let(block) - -@PreviewFeature -inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrNull(): ExactScheduledCloseInfo? = - this as? ExactScheduledCloseInfo - -@PreviewFeature -inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrThrow(): ExactScheduledCloseInfo = - this as ExactScheduledCloseInfo - -@PreviewFeature -inline fun ScheduledCloseInfo.ifApproximateScheduledCloseInfo(block: (ApproximateScheduledCloseInfo) -> T) = - approximateScheduledCloseInfoOrNull()?.let(block) - -@PreviewFeature -inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrNull(): ApproximateScheduledCloseInfo? = - this as? ApproximateScheduledCloseInfo - -@PreviewFeature -inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrThrow(): ApproximateScheduledCloseInfo = - this as ApproximateScheduledCloseInfo - -@PreviewFeature -inline fun ChosenInlineResult.ifLocationChosenInlineResult(block: (LocationChosenInlineResult) -> T) = - locationChosenInlineResultOrNull()?.let(block) - -@PreviewFeature -inline fun ChosenInlineResult.locationChosenInlineResultOrNull(): LocationChosenInlineResult? = - this as? LocationChosenInlineResult - -@PreviewFeature -inline fun ChosenInlineResult.locationChosenInlineResultOrThrow(): LocationChosenInlineResult = - this as LocationChosenInlineResult - -@PreviewFeature -inline fun ChosenInlineResult.ifBaseChosenInlineResult(block: (BaseChosenInlineResult) -> T) = - baseChosenInlineResultOrNull()?.let(block) - -@PreviewFeature -inline fun ChosenInlineResult.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this as? BaseChosenInlineResult - -@PreviewFeature -inline fun ChosenInlineResult.baseChosenInlineResultOrThrow(): BaseChosenInlineResult = this as BaseChosenInlineResult diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/NewClassCasts.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/NewClassCasts.kt new file mode 100644 index 0000000000..9547763e56 --- /dev/null +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/NewClassCasts.kt @@ -0,0 +1,4451 @@ +package dev.inmo.tgbotapi.extensions.utils + +import dev.inmo.tgbotapi.abstracts.CommonSendInvoiceData +import dev.inmo.tgbotapi.abstracts.FromUser +import dev.inmo.tgbotapi.abstracts.WithUser +import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink +import dev.inmo.tgbotapi.requests.send.payments.SendInvoice +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.InlineQueries.ChosenInlineResult.BaseChosenInlineResult +import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult +import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultContact +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGame +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultLocation +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultStickerCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVenue +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.DescribedInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.FileInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.OptionallyTitledInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.SizedInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbSizedInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedWithMimeTypeInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.TitledInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.UrlInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCommon +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocument +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCommon +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCommon +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCommon +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhoto +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCommon +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCommon +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCommon +import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputContactMessageContent +import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent +import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputLocationMessageContent +import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputMessageContent +import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent +import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessageContent +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.PrimaryInviteLink +import dev.inmo.tgbotapi.types.SecondaryChatInviteLink +import dev.inmo.tgbotapi.types.actions.BotAction +import dev.inmo.tgbotapi.types.actions.ChooseStickerAction +import dev.inmo.tgbotapi.types.actions.CustomBotAction +import dev.inmo.tgbotapi.types.actions.FindLocationAction +import dev.inmo.tgbotapi.types.actions.RecordVideoAction +import dev.inmo.tgbotapi.types.actions.RecordVideoNoteAction +import dev.inmo.tgbotapi.types.actions.RecordVoiceAction +import dev.inmo.tgbotapi.types.actions.TypingAction +import dev.inmo.tgbotapi.types.actions.UploadDocumentAction +import dev.inmo.tgbotapi.types.actions.UploadPhotoAction +import dev.inmo.tgbotapi.types.actions.UploadVideoAction +import dev.inmo.tgbotapi.types.actions.UploadVideoNoteAction +import dev.inmo.tgbotapi.types.actions.UploadVoiceAction +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackDataInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackGameInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.InlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.LoginURLInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.PayInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryCurrentChatInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.URLInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.UnknownInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.WebAppInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup +import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup +import dev.inmo.tgbotapi.types.buttons.ReplyForce +import dev.inmo.tgbotapi.types.buttons.ReplyKeyboardMarkup +import dev.inmo.tgbotapi.types.buttons.ReplyKeyboardRemove +import dev.inmo.tgbotapi.types.chat.AbleToAddInAttachmentMenuChat +import dev.inmo.tgbotapi.types.chat.Bot +import dev.inmo.tgbotapi.types.chat.ChannelChat +import dev.inmo.tgbotapi.types.chat.ChannelChatImpl +import dev.inmo.tgbotapi.types.chat.Chat +import dev.inmo.tgbotapi.types.chat.ChatJoinRequest +import dev.inmo.tgbotapi.types.chat.CommonBot +import dev.inmo.tgbotapi.types.chat.CommonUser +import dev.inmo.tgbotapi.types.chat.ExtendedBot +import dev.inmo.tgbotapi.types.chat.ExtendedChannelChat +import dev.inmo.tgbotapi.types.chat.ExtendedChannelChatImpl +import dev.inmo.tgbotapi.types.chat.ExtendedChat +import dev.inmo.tgbotapi.types.chat.ExtendedGroupChat +import dev.inmo.tgbotapi.types.chat.ExtendedGroupChatImpl +import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat +import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChatImpl +import dev.inmo.tgbotapi.types.chat.ExtendedPublicChat +import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat +import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChatImpl +import dev.inmo.tgbotapi.types.chat.GroupChat +import dev.inmo.tgbotapi.types.chat.GroupChatImpl +import dev.inmo.tgbotapi.types.chat.PossiblyPremiumChat +import dev.inmo.tgbotapi.types.chat.PrivateChat +import dev.inmo.tgbotapi.types.chat.PrivateChatImpl +import dev.inmo.tgbotapi.types.chat.PublicChat +import dev.inmo.tgbotapi.types.chat.SuperPublicChat +import dev.inmo.tgbotapi.types.chat.SupergroupChat +import dev.inmo.tgbotapi.types.chat.SupergroupChatImpl +import dev.inmo.tgbotapi.types.chat.UnknownChatType +import dev.inmo.tgbotapi.types.chat.UnknownExtendedChat +import dev.inmo.tgbotapi.types.chat.User +import dev.inmo.tgbotapi.types.chat.UsernameChat +import dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember +import dev.inmo.tgbotapi.types.chat.member.AdministratorChatMemberImpl +import dev.inmo.tgbotapi.types.chat.member.BannedChatMember +import dev.inmo.tgbotapi.types.chat.member.ChatMember +import dev.inmo.tgbotapi.types.chat.member.KickedChatMember +import dev.inmo.tgbotapi.types.chat.member.LeftChatMember +import dev.inmo.tgbotapi.types.chat.member.LeftChatMemberImpl +import dev.inmo.tgbotapi.types.chat.member.MemberChatMember +import dev.inmo.tgbotapi.types.chat.member.MemberChatMemberImpl +import dev.inmo.tgbotapi.types.chat.member.OwnerChatMember +import dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember +import dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember +import dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType +import dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType +import dev.inmo.tgbotapi.types.dice.CubeDiceAnimationType +import dev.inmo.tgbotapi.types.dice.CustomDiceAnimationType +import dev.inmo.tgbotapi.types.dice.DartsDiceAnimationType +import dev.inmo.tgbotapi.types.dice.DiceAnimationType +import dev.inmo.tgbotapi.types.dice.FootballDiceAnimationType +import dev.inmo.tgbotapi.types.dice.SlotMachineDiceAnimationType +import dev.inmo.tgbotapi.types.files.AnimatedSticker +import dev.inmo.tgbotapi.types.files.AnimationFile +import dev.inmo.tgbotapi.types.files.AudioFile +import dev.inmo.tgbotapi.types.files.DocumentFile +import dev.inmo.tgbotapi.types.files.File +import dev.inmo.tgbotapi.types.files.MimedMediaFile +import dev.inmo.tgbotapi.types.files.PassportFile +import dev.inmo.tgbotapi.types.files.PathedFile +import dev.inmo.tgbotapi.types.files.PhotoSize +import dev.inmo.tgbotapi.types.files.PlayableMediaFile +import dev.inmo.tgbotapi.types.files.SimpleSticker +import dev.inmo.tgbotapi.types.files.SizedMediaFile +import dev.inmo.tgbotapi.types.files.Sticker +import dev.inmo.tgbotapi.types.files.TelegramMediaFile +import dev.inmo.tgbotapi.types.files.ThumbedMediaFile +import dev.inmo.tgbotapi.types.files.VideoFile +import dev.inmo.tgbotapi.types.files.VideoNoteFile +import dev.inmo.tgbotapi.types.files.VideoSticker +import dev.inmo.tgbotapi.types.files.VoiceFile +import dev.inmo.tgbotapi.types.location.LiveLocation +import dev.inmo.tgbotapi.types.location.Location +import dev.inmo.tgbotapi.types.location.StaticLocation +import dev.inmo.tgbotapi.types.media.AudioMediaGroupMemberTelegramMedia +import dev.inmo.tgbotapi.types.media.DocumentMediaGroupMemberTelegramMedia +import dev.inmo.tgbotapi.types.media.DuratedTelegramMedia +import dev.inmo.tgbotapi.types.media.MediaGroupMemberTelegramMedia +import dev.inmo.tgbotapi.types.media.SizedTelegramMedia +import dev.inmo.tgbotapi.types.media.TelegramMedia +import dev.inmo.tgbotapi.types.media.TelegramMediaAnimation +import dev.inmo.tgbotapi.types.media.TelegramMediaAudio +import dev.inmo.tgbotapi.types.media.TelegramMediaDocument +import dev.inmo.tgbotapi.types.media.TelegramMediaPhoto +import dev.inmo.tgbotapi.types.media.TelegramMediaVideo +import dev.inmo.tgbotapi.types.media.ThumbedTelegramMedia +import dev.inmo.tgbotapi.types.media.TitledTelegramMedia +import dev.inmo.tgbotapi.types.media.VisualMediaGroupMemberTelegramMedia +import dev.inmo.tgbotapi.types.message.AnonymousGroupContentMessageImpl +import dev.inmo.tgbotapi.types.message.ChannelContentMessageImpl +import dev.inmo.tgbotapi.types.message.ChannelEventMessage +import dev.inmo.tgbotapi.types.message.ChannelMediaGroupMessage +import dev.inmo.tgbotapi.types.message.ChatEvents.ChannelChatCreated +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.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.GroupEvent +import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateEvent +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.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.CommonGroupContentMessageImpl +import dev.inmo.tgbotapi.types.message.CommonGroupEventMessage +import dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage +import dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage +import dev.inmo.tgbotapi.types.message.ConnectedFromChannelGroupContentMessageImpl +import dev.inmo.tgbotapi.types.message.ForwardInfo +import dev.inmo.tgbotapi.types.message.PassportMessage +import dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl +import dev.inmo.tgbotapi.types.message.PrivateEventMessage +import dev.inmo.tgbotapi.types.message.UnconnectedFromChannelGroupContentMessageImpl +import dev.inmo.tgbotapi.types.message.abstracts.AnonymousGroupContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage +import dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage +import dev.inmo.tgbotapi.types.message.abstracts.ConnectedFromChannelGroupContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.FromChannelGroupContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage +import dev.inmo.tgbotapi.types.message.abstracts.GroupContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage +import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage +import dev.inmo.tgbotapi.types.message.abstracts.Message +import dev.inmo.tgbotapi.types.message.abstracts.PossiblyEditedMessage +import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage +import dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage +import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage +import dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.PublicContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.SignedMessage +import dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage +import dev.inmo.tgbotapi.types.message.abstracts.UnconnectedFromChannelGroupContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.UnknownMessageType +import dev.inmo.tgbotapi.types.message.content.AnimationContent +import dev.inmo.tgbotapi.types.message.content.AudioContent +import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent +import dev.inmo.tgbotapi.types.message.content.ContactContent +import dev.inmo.tgbotapi.types.message.content.DiceContent +import dev.inmo.tgbotapi.types.message.content.DocumentContent +import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent +import dev.inmo.tgbotapi.types.message.content.GameContent +import dev.inmo.tgbotapi.types.message.content.InvoiceContent +import dev.inmo.tgbotapi.types.message.content.LiveLocationContent +import dev.inmo.tgbotapi.types.message.content.LocationContent +import dev.inmo.tgbotapi.types.message.content.MediaCollectionContent +import dev.inmo.tgbotapi.types.message.content.MediaContent +import dev.inmo.tgbotapi.types.message.content.MediaGroupContent +import dev.inmo.tgbotapi.types.message.content.MessageContent +import dev.inmo.tgbotapi.types.message.content.PhotoContent +import dev.inmo.tgbotapi.types.message.content.PollContent +import dev.inmo.tgbotapi.types.message.content.ResendableContent +import dev.inmo.tgbotapi.types.message.content.StaticLocationContent +import dev.inmo.tgbotapi.types.message.content.StickerContent +import dev.inmo.tgbotapi.types.message.content.TextContent +import dev.inmo.tgbotapi.types.message.content.TextedMediaContent +import dev.inmo.tgbotapi.types.message.content.VenueContent +import dev.inmo.tgbotapi.types.message.content.VideoContent +import dev.inmo.tgbotapi.types.message.content.VideoNoteContent +import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent +import dev.inmo.tgbotapi.types.message.content.VoiceContent +import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent +import dev.inmo.tgbotapi.types.message.textsources.BoldTextSource +import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource +import dev.inmo.tgbotapi.types.message.textsources.CashTagTextSource +import dev.inmo.tgbotapi.types.message.textsources.CodeTextSource +import dev.inmo.tgbotapi.types.message.textsources.EMailTextSource +import dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource +import dev.inmo.tgbotapi.types.message.textsources.ItalicTextSource +import dev.inmo.tgbotapi.types.message.textsources.MentionTextSource +import dev.inmo.tgbotapi.types.message.textsources.MultilevelTextSource +import dev.inmo.tgbotapi.types.message.textsources.PhoneNumberTextSource +import dev.inmo.tgbotapi.types.message.textsources.PreTextSource +import dev.inmo.tgbotapi.types.message.textsources.RegularTextSource +import dev.inmo.tgbotapi.types.message.textsources.SpoilerTextSource +import dev.inmo.tgbotapi.types.message.textsources.StrikethroughTextSource +import dev.inmo.tgbotapi.types.message.textsources.TextLinkTextSource +import dev.inmo.tgbotapi.types.message.textsources.TextMentionTextSource +import dev.inmo.tgbotapi.types.message.textsources.TextSource +import dev.inmo.tgbotapi.types.message.textsources.URLTextSource +import dev.inmo.tgbotapi.types.message.textsources.UnderlineTextSource +import dev.inmo.tgbotapi.types.passport.PassportElementError +import dev.inmo.tgbotapi.types.passport.PassportElementErrorDataField +import dev.inmo.tgbotapi.types.passport.PassportElementErrorFile +import dev.inmo.tgbotapi.types.passport.PassportElementErrorFiles +import dev.inmo.tgbotapi.types.passport.PassportElementErrorFrontSide +import dev.inmo.tgbotapi.types.passport.PassportElementErrorReverseSide +import dev.inmo.tgbotapi.types.passport.PassportElementErrorSelfie +import dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFile +import dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFiles +import dev.inmo.tgbotapi.types.passport.PassportElementErrorUnspecified +import dev.inmo.tgbotapi.types.passport.PassportElementFileError +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 +import dev.inmo.tgbotapi.types.passport.encrypted.Email +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedAddress +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableFilesCollection +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableIDDocument +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPersonalDetails +import dev.inmo.tgbotapi.types.passport.encrypted.IdentityCard +import dev.inmo.tgbotapi.types.passport.encrypted.InternalPassport +import dev.inmo.tgbotapi.types.passport.encrypted.Passport +import dev.inmo.tgbotapi.types.passport.encrypted.PassportRegistration +import dev.inmo.tgbotapi.types.passport.encrypted.PhoneNumber +import dev.inmo.tgbotapi.types.passport.encrypted.RentalAgreement +import dev.inmo.tgbotapi.types.passport.encrypted.TemporaryRegistration +import dev.inmo.tgbotapi.types.passport.encrypted.UtilityBill +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementTranslatable +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithData +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithEmail +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFilesCollection +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFrontSide +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithPhoneNumber +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithReverseSide +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithSelfie +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.UnknownEncryptedPassportElement +import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery +import dev.inmo.tgbotapi.types.payments.ShippingQuery +import dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo +import dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo +import dev.inmo.tgbotapi.types.polls.MultipleAnswersPoll +import dev.inmo.tgbotapi.types.polls.Poll +import dev.inmo.tgbotapi.types.polls.PollAnswer +import dev.inmo.tgbotapi.types.polls.QuizPoll +import dev.inmo.tgbotapi.types.polls.RegularPoll +import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo +import dev.inmo.tgbotapi.types.polls.UnknownPollType +import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType +import dev.inmo.tgbotapi.types.update.CallbackQueryUpdate +import dev.inmo.tgbotapi.types.update.ChannelPostUpdate +import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate +import dev.inmo.tgbotapi.types.update.ChosenInlineResultUpdate +import dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate +import dev.inmo.tgbotapi.types.update.EditChannelPostUpdate +import dev.inmo.tgbotapi.types.update.EditMessageUpdate +import dev.inmo.tgbotapi.types.update.InlineQueryUpdate +import dev.inmo.tgbotapi.types.update.MessageUpdate +import dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate +import dev.inmo.tgbotapi.types.update.PollAnswerUpdate +import dev.inmo.tgbotapi.types.update.PollUpdate +import dev.inmo.tgbotapi.types.update.PreCheckoutQueryUpdate +import dev.inmo.tgbotapi.types.update.ShippingQueryUpdate +import dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate +import dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate +import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate +import dev.inmo.tgbotapi.types.update.abstracts.ChatMemberUpdatedUpdate +import dev.inmo.tgbotapi.types.update.abstracts.UnknownUpdate +import dev.inmo.tgbotapi.types.update.abstracts.Update +import dev.inmo.tgbotapi.types.update.media_group.ChannelPostMediaGroupUpdate +import dev.inmo.tgbotapi.types.update.media_group.EditChannelPostMediaGroupUpdate +import dev.inmo.tgbotapi.types.update.media_group.EditMediaGroupUpdate +import dev.inmo.tgbotapi.types.update.media_group.EditMessageMediaGroupUpdate +import dev.inmo.tgbotapi.types.update.media_group.MediaGroupUpdate +import dev.inmo.tgbotapi.types.update.media_group.MessageMediaGroupUpdate +import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate + +public inline fun CommonSendInvoiceData.createInvoiceLinkOrNull(): CreateInvoiceLink? = this as? + dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink + +public inline fun CommonSendInvoiceData.createInvoiceLinkOrThrow(): CreateInvoiceLink = this as + dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink + +public inline fun CommonSendInvoiceData.ifCreateInvoiceLink(block: (CreateInvoiceLink) -> T): T? + = createInvoiceLinkOrNull() ?.let(block) + +public inline fun CommonSendInvoiceData.sendInvoiceOrNull(): SendInvoice? = this as? + dev.inmo.tgbotapi.requests.send.payments.SendInvoice + +public inline fun CommonSendInvoiceData.sendInvoiceOrThrow(): SendInvoice = this as + dev.inmo.tgbotapi.requests.send.payments.SendInvoice + +public inline fun CommonSendInvoiceData.ifSendInvoice(block: (SendInvoice) -> T): T? = + sendInvoiceOrNull() ?.let(block) + +public inline fun CommonSendInvoiceData.inputInvoiceMessageContentOrNull(): + InputInvoiceMessageContent? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent + +public inline fun CommonSendInvoiceData.inputInvoiceMessageContentOrThrow(): + InputInvoiceMessageContent = this as + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent + +public inline fun + CommonSendInvoiceData.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T): T? + = inputInvoiceMessageContentOrNull() ?.let(block) + +public inline fun WithUser.fromUserOrNull(): FromUser? = this as? + dev.inmo.tgbotapi.abstracts.FromUser + +public inline fun WithUser.fromUserOrThrow(): FromUser = this as + dev.inmo.tgbotapi.abstracts.FromUser + +public inline fun WithUser.ifFromUser(block: (FromUser) -> T): T? = fromUserOrNull() + ?.let(block) + +public inline fun WithUser.chatInviteLinkOrNull(): ChatInviteLink? = this as? + dev.inmo.tgbotapi.types.ChatInviteLink + +public inline fun WithUser.chatInviteLinkOrThrow(): ChatInviteLink = this as + dev.inmo.tgbotapi.types.ChatInviteLink + +public inline fun WithUser.ifChatInviteLink(block: (ChatInviteLink) -> T): T? = + chatInviteLinkOrNull() ?.let(block) + +public inline fun WithUser.secondaryChatInviteLinkOrNull(): SecondaryChatInviteLink? = this as? + dev.inmo.tgbotapi.types.SecondaryChatInviteLink + +public inline fun WithUser.secondaryChatInviteLinkOrThrow(): SecondaryChatInviteLink = this as + dev.inmo.tgbotapi.types.SecondaryChatInviteLink + +public inline fun WithUser.ifSecondaryChatInviteLink(block: (SecondaryChatInviteLink) -> T): T? + = secondaryChatInviteLinkOrNull() ?.let(block) + +public inline fun WithUser.primaryInviteLinkOrNull(): PrimaryInviteLink? = this as? + dev.inmo.tgbotapi.types.PrimaryInviteLink + +public inline fun WithUser.primaryInviteLinkOrThrow(): PrimaryInviteLink = this as + dev.inmo.tgbotapi.types.PrimaryInviteLink + +public inline fun WithUser.ifPrimaryInviteLink(block: (PrimaryInviteLink) -> T): T? = + primaryInviteLinkOrNull() ?.let(block) + +public inline fun WithUser.chatInviteLinkWithJoinRequestOrNull(): ChatInviteLinkWithJoinRequest? = + this as? dev.inmo.tgbotapi.types.ChatInviteLinkWithJoinRequest + +public inline fun WithUser.chatInviteLinkWithJoinRequestOrThrow(): ChatInviteLinkWithJoinRequest = + this as dev.inmo.tgbotapi.types.ChatInviteLinkWithJoinRequest + +public inline fun + WithUser.ifChatInviteLinkWithJoinRequest(block: (ChatInviteLinkWithJoinRequest) -> T): T? = + chatInviteLinkWithJoinRequestOrNull() ?.let(block) + +public inline fun WithUser.chatInviteLinkWithLimitedMembersOrNull(): + ChatInviteLinkWithLimitedMembers? = this as? + dev.inmo.tgbotapi.types.ChatInviteLinkWithLimitedMembers + +public inline fun WithUser.chatInviteLinkWithLimitedMembersOrThrow(): + ChatInviteLinkWithLimitedMembers = this as + dev.inmo.tgbotapi.types.ChatInviteLinkWithLimitedMembers + +public inline fun + WithUser.ifChatInviteLinkWithLimitedMembers(block: (ChatInviteLinkWithLimitedMembers) -> T): T? + = chatInviteLinkWithLimitedMembersOrNull() ?.let(block) + +public inline fun WithUser.chatInviteLinkUnlimitedOrNull(): ChatInviteLinkUnlimited? = this as? + dev.inmo.tgbotapi.types.ChatInviteLinkUnlimited + +public inline fun WithUser.chatInviteLinkUnlimitedOrThrow(): ChatInviteLinkUnlimited = this as + dev.inmo.tgbotapi.types.ChatInviteLinkUnlimited + +public inline fun WithUser.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T): T? + = chatInviteLinkUnlimitedOrNull() ?.let(block) + +public inline fun WithUser.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult + +public inline fun WithUser.baseChosenInlineResultOrThrow(): BaseChosenInlineResult = this as + dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult + +public inline fun WithUser.ifBaseChosenInlineResult(block: (BaseChosenInlineResult) -> T): T? = + baseChosenInlineResultOrNull() ?.let(block) + +public inline fun WithUser.chosenInlineResultOrNull(): ChosenInlineResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult + +public inline fun WithUser.chosenInlineResultOrThrow(): ChosenInlineResult = this as + dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult + +public inline fun WithUser.ifChosenInlineResult(block: (ChosenInlineResult) -> T): T? = + chosenInlineResultOrNull() ?.let(block) + +public inline fun WithUser.locationChosenInlineResultOrNull(): LocationChosenInlineResult? = this + as? dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult + +public inline fun WithUser.locationChosenInlineResultOrThrow(): LocationChosenInlineResult = this as + dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult + +public inline fun + WithUser.ifLocationChosenInlineResult(block: (LocationChosenInlineResult) -> T): T? = + locationChosenInlineResultOrNull() ?.let(block) + +public inline fun WithUser.baseInlineQueryOrNull(): BaseInlineQuery? = this as? + dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery + +public inline fun WithUser.baseInlineQueryOrThrow(): BaseInlineQuery = this as + dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery + +public inline fun WithUser.ifBaseInlineQuery(block: (BaseInlineQuery) -> T): T? = + baseInlineQueryOrNull() ?.let(block) + +public inline fun WithUser.inlineQueryOrNull(): InlineQuery? = this as? + dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery + +public inline fun WithUser.inlineQueryOrThrow(): InlineQuery = this as + dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery + +public inline fun WithUser.ifInlineQuery(block: (InlineQuery) -> T): T? = inlineQueryOrNull() + ?.let(block) + +public inline fun WithUser.locationInlineQueryOrNull(): LocationInlineQuery? = this as? + dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery + +public inline fun WithUser.locationInlineQueryOrThrow(): LocationInlineQuery = this as + dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery + +public inline fun WithUser.ifLocationInlineQuery(block: (LocationInlineQuery) -> T): T? = + locationInlineQueryOrNull() ?.let(block) + +public inline fun WithUser.chatJoinRequestOrNull(): ChatJoinRequest? = this as? + dev.inmo.tgbotapi.types.chat.ChatJoinRequest + +public inline fun WithUser.chatJoinRequestOrThrow(): ChatJoinRequest = this as + dev.inmo.tgbotapi.types.chat.ChatJoinRequest + +public inline fun WithUser.ifChatJoinRequest(block: (ChatJoinRequest) -> T): T? = + chatJoinRequestOrNull() ?.let(block) + +public inline fun WithUser.administratorChatMemberOrNull(): AdministratorChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember + +public inline fun WithUser.administratorChatMemberOrThrow(): AdministratorChatMember = this as + dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember + +public inline fun WithUser.ifAdministratorChatMember(block: (AdministratorChatMember) -> T): T? + = administratorChatMemberOrNull() ?.let(block) + +public inline fun WithUser.administratorChatMemberImplOrNull(): AdministratorChatMemberImpl? = this + as? dev.inmo.tgbotapi.types.chat.member.AdministratorChatMemberImpl + +public inline fun WithUser.administratorChatMemberImplOrThrow(): AdministratorChatMemberImpl = this + as dev.inmo.tgbotapi.types.chat.member.AdministratorChatMemberImpl + +public inline fun + WithUser.ifAdministratorChatMemberImpl(block: (AdministratorChatMemberImpl) -> T): T? = + administratorChatMemberImplOrNull() ?.let(block) + +public inline fun WithUser.bannedChatMemberOrNull(): BannedChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.BannedChatMember + +public inline fun WithUser.bannedChatMemberOrThrow(): BannedChatMember = this as + dev.inmo.tgbotapi.types.chat.member.BannedChatMember + +public inline fun WithUser.ifBannedChatMember(block: (BannedChatMember) -> T): T? = + bannedChatMemberOrNull() ?.let(block) + +public inline fun WithUser.chatMemberOrNull(): ChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.ChatMember + +public inline fun WithUser.chatMemberOrThrow(): ChatMember = this as + dev.inmo.tgbotapi.types.chat.member.ChatMember + +public inline fun WithUser.ifChatMember(block: (ChatMember) -> T): T? = chatMemberOrNull() + ?.let(block) + +public inline fun WithUser.kickedChatMemberOrNull(): KickedChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.KickedChatMember + +public inline fun WithUser.kickedChatMemberOrThrow(): KickedChatMember = this as + dev.inmo.tgbotapi.types.chat.member.KickedChatMember + +public inline fun WithUser.ifKickedChatMember(block: (KickedChatMember) -> T): T? = + kickedChatMemberOrNull() ?.let(block) + +public inline fun WithUser.leftChatMemberOrNull(): LeftChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.LeftChatMember + +public inline fun WithUser.leftChatMemberOrThrow(): LeftChatMember = this as + dev.inmo.tgbotapi.types.chat.member.LeftChatMember + +public inline fun WithUser.ifLeftChatMember(block: (LeftChatMember) -> T): T? = + leftChatMemberOrNull() ?.let(block) + +public inline fun WithUser.leftChatMemberImplOrNull(): LeftChatMemberImpl? = this as? + dev.inmo.tgbotapi.types.chat.member.LeftChatMemberImpl + +public inline fun WithUser.leftChatMemberImplOrThrow(): LeftChatMemberImpl = this as + dev.inmo.tgbotapi.types.chat.member.LeftChatMemberImpl + +public inline fun WithUser.ifLeftChatMemberImpl(block: (LeftChatMemberImpl) -> T): T? = + leftChatMemberImplOrNull() ?.let(block) + +public inline fun WithUser.memberChatMemberOrNull(): MemberChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.MemberChatMember + +public inline fun WithUser.memberChatMemberOrThrow(): MemberChatMember = this as + dev.inmo.tgbotapi.types.chat.member.MemberChatMember + +public inline fun WithUser.ifMemberChatMember(block: (MemberChatMember) -> T): T? = + memberChatMemberOrNull() ?.let(block) + +public inline fun WithUser.memberChatMemberImplOrNull(): MemberChatMemberImpl? = this as? + dev.inmo.tgbotapi.types.chat.member.MemberChatMemberImpl + +public inline fun WithUser.memberChatMemberImplOrThrow(): MemberChatMemberImpl = this as + dev.inmo.tgbotapi.types.chat.member.MemberChatMemberImpl + +public inline fun WithUser.ifMemberChatMemberImpl(block: (MemberChatMemberImpl) -> T): T? = + memberChatMemberImplOrNull() ?.let(block) + +public inline fun WithUser.ownerChatMemberOrNull(): OwnerChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.OwnerChatMember + +public inline fun WithUser.ownerChatMemberOrThrow(): OwnerChatMember = this as + dev.inmo.tgbotapi.types.chat.member.OwnerChatMember + +public inline fun WithUser.ifOwnerChatMember(block: (OwnerChatMember) -> T): T? = + ownerChatMemberOrNull() ?.let(block) + +public inline fun WithUser.restrictedChatMemberOrNull(): RestrictedChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember + +public inline fun WithUser.restrictedChatMemberOrThrow(): RestrictedChatMember = this as + dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember + +public inline fun WithUser.ifRestrictedChatMember(block: (RestrictedChatMember) -> T): T? = + restrictedChatMemberOrNull() ?.let(block) + +public inline fun WithUser.specialRightsChatMemberOrNull(): SpecialRightsChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember + +public inline fun WithUser.specialRightsChatMemberOrThrow(): SpecialRightsChatMember = this as + dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember + +public inline fun WithUser.ifSpecialRightsChatMember(block: (SpecialRightsChatMember) -> T): T? + = specialRightsChatMemberOrNull() ?.let(block) + +public inline fun WithUser.leftChatMemberEventOrNull(): LeftChatMemberEvent? = this as? + dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent + +public inline fun WithUser.leftChatMemberEventOrThrow(): LeftChatMemberEvent = this as + dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent + +public inline fun WithUser.ifLeftChatMemberEvent(block: (LeftChatMemberEvent) -> T): T? = + leftChatMemberEventOrNull() ?.let(block) + +public inline fun WithUser.commonGroupEventMessageOrNull(): CommonGroupEventMessage? = + this as? + dev.inmo.tgbotapi.types.message.CommonGroupEventMessage + +public inline fun WithUser.commonGroupEventMessageOrThrow(): CommonGroupEventMessage = + this as + dev.inmo.tgbotapi.types.message.CommonGroupEventMessage + +public inline fun + WithUser.ifCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T): T? = + commonGroupEventMessageOrNull() ?.let(block) + +public inline fun WithUser.commonMediaGroupMessageOrNull(): + CommonMediaGroupMessage? = this as? + dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage + +public inline fun WithUser.commonMediaGroupMessageOrThrow(): + CommonMediaGroupMessage = this as + dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage + +public inline fun + WithUser.ifCommonMediaGroupMessage(block: (CommonMediaGroupMessage) -> T): T? + = commonMediaGroupMessageOrNull() ?.let(block) + +public inline fun WithUser.commonSupergroupEventMessageOrNull(): + CommonSupergroupEventMessage? = this as? + dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage + +public inline fun WithUser.commonSupergroupEventMessageOrThrow(): + CommonSupergroupEventMessage = this as + dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage + +public inline fun + WithUser.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T): + T? = commonSupergroupEventMessageOrNull() ?.let(block) + +public inline fun WithUser.commonGroupContentMessageImplOrNull(): + CommonGroupContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.CommonGroupContentMessageImpl + +public inline fun WithUser.commonGroupContentMessageImplOrThrow(): + CommonGroupContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.CommonGroupContentMessageImpl + +public inline fun + WithUser.ifCommonGroupContentMessageImpl(block: (CommonGroupContentMessageImpl) -> T): + T? = commonGroupContentMessageImplOrNull() ?.let(block) + +public inline fun WithUser.passportMessageOrNull(): PassportMessage? = this as? + dev.inmo.tgbotapi.types.message.PassportMessage + +public inline fun WithUser.passportMessageOrThrow(): PassportMessage = this as + dev.inmo.tgbotapi.types.message.PassportMessage + +public inline fun WithUser.ifPassportMessage(block: (PassportMessage) -> T): T? = + passportMessageOrNull() ?.let(block) + +public inline fun WithUser.privateContentMessageImplOrNull(): + PrivateContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl + +public inline fun WithUser.privateContentMessageImplOrThrow(): + PrivateContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl + +public inline fun + WithUser.ifPrivateContentMessageImpl(block: (PrivateContentMessageImpl) -> T): + T? = privateContentMessageImplOrNull() ?.let(block) + +public inline fun WithUser.fromUserMessageOrNull(): FromUserMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage + +public inline fun WithUser.fromUserMessageOrThrow(): FromUserMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage + +public inline fun WithUser.ifFromUserMessage(block: (FromUserMessage) -> T): T? = + fromUserMessageOrNull() ?.let(block) + +public inline fun WithUser.groupEventMessageOrNull(): GroupEventMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage + +public inline fun WithUser.groupEventMessageOrThrow(): GroupEventMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage + +public inline fun WithUser.ifGroupEventMessage(block: (GroupEventMessage) -> T): T? + = groupEventMessageOrNull() ?.let(block) + +public inline fun WithUser.commonGroupContentMessageOrNull(): + CommonGroupContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage + +public inline fun WithUser.commonGroupContentMessageOrThrow(): + CommonGroupContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage + +public inline fun + WithUser.ifCommonGroupContentMessage(block: (CommonGroupContentMessage) -> T): + T? = commonGroupContentMessageOrNull() ?.let(block) + +public inline fun WithUser.privateContentMessageOrNull(): PrivateContentMessage? = + this as? + dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage + +public inline fun WithUser.privateContentMessageOrThrow(): PrivateContentMessage = + this as + dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage + +public inline fun + WithUser.ifPrivateContentMessage(block: (PrivateContentMessage) -> T): T? = + privateContentMessageOrNull() ?.let(block) + +public inline fun WithUser.supergroupEventMessageOrNull(): SupergroupEventMessage? + = this as? + dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage + +public inline fun WithUser.supergroupEventMessageOrThrow(): SupergroupEventMessage + = this as + dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage + +public inline fun + WithUser.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T): T? = + supergroupEventMessageOrNull() ?.let(block) + +public inline fun WithUser.preCheckoutQueryOrNull(): PreCheckoutQuery? = this as? + dev.inmo.tgbotapi.types.payments.PreCheckoutQuery + +public inline fun WithUser.preCheckoutQueryOrThrow(): PreCheckoutQuery = this as + dev.inmo.tgbotapi.types.payments.PreCheckoutQuery + +public inline fun WithUser.ifPreCheckoutQuery(block: (PreCheckoutQuery) -> T): T? = + preCheckoutQueryOrNull() ?.let(block) + +public inline fun WithUser.shippingQueryOrNull(): ShippingQuery? = this as? + dev.inmo.tgbotapi.types.payments.ShippingQuery + +public inline fun WithUser.shippingQueryOrThrow(): ShippingQuery = this as + dev.inmo.tgbotapi.types.payments.ShippingQuery + +public inline fun WithUser.ifShippingQuery(block: (ShippingQuery) -> T): T? = + shippingQueryOrNull() ?.let(block) + +public inline fun WithUser.pollAnswerOrNull(): PollAnswer? = this as? + dev.inmo.tgbotapi.types.polls.PollAnswer + +public inline fun WithUser.pollAnswerOrThrow(): PollAnswer = this as + dev.inmo.tgbotapi.types.polls.PollAnswer + +public inline fun WithUser.ifPollAnswer(block: (PollAnswer) -> T): T? = pollAnswerOrNull() + ?.let(block) + +public inline fun WithUser.callbackQueryOrNull(): CallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.CallbackQuery + +public inline fun WithUser.callbackQueryOrThrow(): CallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.CallbackQuery + +public inline fun WithUser.ifCallbackQuery(block: (CallbackQuery) -> T): T? = + callbackQueryOrNull() ?.let(block) + +public inline fun WithUser.unknownCallbackQueryTypeOrNull(): UnknownCallbackQueryType? = this as? + dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType + +public inline fun WithUser.unknownCallbackQueryTypeOrThrow(): UnknownCallbackQueryType = this as + dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType + +public inline fun WithUser.ifUnknownCallbackQueryType(block: (UnknownCallbackQueryType) -> T): + T? = unknownCallbackQueryTypeOrNull() ?.let(block) + +public inline fun WithUser.dataCallbackQueryOrNull(): DataCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery + +public inline fun WithUser.dataCallbackQueryOrThrow(): DataCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery + +public inline fun WithUser.ifDataCallbackQuery(block: (DataCallbackQuery) -> T): T? = + dataCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.gameShortNameCallbackQueryOrNull(): GameShortNameCallbackQuery? = this + as? dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery + +public inline fun WithUser.gameShortNameCallbackQueryOrThrow(): GameShortNameCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery + +public inline fun + WithUser.ifGameShortNameCallbackQuery(block: (GameShortNameCallbackQuery) -> T): T? = + gameShortNameCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.inlineMessageIdCallbackQueryOrNull(): InlineMessageIdCallbackQuery? = + this as? dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery + +public inline fun WithUser.inlineMessageIdCallbackQueryOrThrow(): InlineMessageIdCallbackQuery = + this as dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery + +public inline fun + WithUser.ifInlineMessageIdCallbackQuery(block: (InlineMessageIdCallbackQuery) -> T): T? = + inlineMessageIdCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.inlineMessageIdDataCallbackQueryOrNull(): + InlineMessageIdDataCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery + +public inline fun WithUser.inlineMessageIdDataCallbackQueryOrThrow(): + InlineMessageIdDataCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery + +public inline fun + WithUser.ifInlineMessageIdDataCallbackQuery(block: (InlineMessageIdDataCallbackQuery) -> T): T? + = inlineMessageIdDataCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.inlineMessageIdGameShortNameCallbackQueryOrNull(): + InlineMessageIdGameShortNameCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery + +public inline fun WithUser.inlineMessageIdGameShortNameCallbackQueryOrThrow(): + InlineMessageIdGameShortNameCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery + +public inline fun + WithUser.ifInlineMessageIdGameShortNameCallbackQuery(block: (InlineMessageIdGameShortNameCallbackQuery) -> T): + T? = inlineMessageIdGameShortNameCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.messageCallbackQueryOrNull(): MessageCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery + +public inline fun WithUser.messageCallbackQueryOrThrow(): MessageCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery + +public inline fun WithUser.ifMessageCallbackQuery(block: (MessageCallbackQuery) -> T): T? = + messageCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.messageDataCallbackQueryOrNull(): MessageDataCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery + +public inline fun WithUser.messageDataCallbackQueryOrThrow(): MessageDataCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery + +public inline fun WithUser.ifMessageDataCallbackQuery(block: (MessageDataCallbackQuery) -> T): + T? = messageDataCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.messageGameShortNameCallbackQueryOrNull(): + MessageGameShortNameCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery + +public inline fun WithUser.messageGameShortNameCallbackQueryOrThrow(): + MessageGameShortNameCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery + +public inline fun + WithUser.ifMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T): + T? = messageGameShortNameCallbackQueryOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultArticleOrNull(): InlineQueryResultArticle? = + this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle + +public inline fun InlineQueryResult.inlineQueryResultArticleOrThrow(): InlineQueryResultArticle = + this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle + +public inline fun + InlineQueryResult.ifInlineQueryResultArticle(block: (InlineQueryResultArticle) -> T): T? = + inlineQueryResultArticleOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultAudioCachedImplOrNull(): + InlineQueryResultAudioCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultAudioCachedImplOrThrow(): + InlineQueryResultAudioCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultAudioCachedImpl(block: (InlineQueryResultAudioCachedImpl) -> T): + T? = inlineQueryResultAudioCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultAudioImplOrNull(): InlineQueryResultAudioImpl? + = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioImpl + +public inline fun InlineQueryResult.inlineQueryResultAudioImplOrThrow(): InlineQueryResultAudioImpl + = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultAudioImpl(block: (InlineQueryResultAudioImpl) -> T): T? = + inlineQueryResultAudioImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultContactOrNull(): InlineQueryResultContact? = + this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultContact + +public inline fun InlineQueryResult.inlineQueryResultContactOrThrow(): InlineQueryResultContact = + this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultContact + +public inline fun + InlineQueryResult.ifInlineQueryResultContact(block: (InlineQueryResultContact) -> T): T? = + inlineQueryResultContactOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultDocumentCachedImplOrNull(): + InlineQueryResultDocumentCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultDocumentCachedImplOrThrow(): + InlineQueryResultDocumentCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultDocumentCachedImpl(block: (InlineQueryResultDocumentCachedImpl) -> T): + T? = inlineQueryResultDocumentCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultDocumentImplOrNull(): + InlineQueryResultDocumentImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentImpl + +public inline fun InlineQueryResult.inlineQueryResultDocumentImplOrThrow(): + InlineQueryResultDocumentImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultDocumentImpl(block: (InlineQueryResultDocumentImpl) -> T): + T? = inlineQueryResultDocumentImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultGameOrNull(): InlineQueryResultGame? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGame + +public inline fun InlineQueryResult.inlineQueryResultGameOrThrow(): InlineQueryResultGame = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGame + +public inline fun + InlineQueryResult.ifInlineQueryResultGame(block: (InlineQueryResultGame) -> T): T? = + inlineQueryResultGameOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultGifCachedImplOrNull(): + InlineQueryResultGifCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultGifCachedImplOrThrow(): + InlineQueryResultGifCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultGifCachedImpl(block: (InlineQueryResultGifCachedImpl) -> T): + T? = inlineQueryResultGifCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultGifImplOrNull(): InlineQueryResultGifImpl? = + this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifImpl + +public inline fun InlineQueryResult.inlineQueryResultGifImplOrThrow(): InlineQueryResultGifImpl = + this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultGifImpl(block: (InlineQueryResultGifImpl) -> T): T? = + inlineQueryResultGifImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultLocationOrNull(): InlineQueryResultLocation? = + this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultLocation + +public inline fun InlineQueryResult.inlineQueryResultLocationOrThrow(): InlineQueryResultLocation = + this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultLocation + +public inline fun + InlineQueryResult.ifInlineQueryResultLocation(block: (InlineQueryResultLocation) -> T): T? = + inlineQueryResultLocationOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedImplOrNull(): + InlineQueryResultMpeg4GifCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedImplOrThrow(): + InlineQueryResultMpeg4GifCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultMpeg4GifCachedImpl(block: (InlineQueryResultMpeg4GifCachedImpl) -> T): + T? = inlineQueryResultMpeg4GifCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifImplOrNull(): + InlineQueryResultMpeg4GifImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifImpl + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifImplOrThrow(): + InlineQueryResultMpeg4GifImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultMpeg4GifImpl(block: (InlineQueryResultMpeg4GifImpl) -> T): + T? = inlineQueryResultMpeg4GifImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultPhotoCachedImplOrNull(): + InlineQueryResultPhotoCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultPhotoCachedImplOrThrow(): + InlineQueryResultPhotoCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultPhotoCachedImpl(block: (InlineQueryResultPhotoCachedImpl) -> T): + T? = inlineQueryResultPhotoCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultPhotoImplOrNull(): InlineQueryResultPhotoImpl? + = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoImpl + +public inline fun InlineQueryResult.inlineQueryResultPhotoImplOrThrow(): InlineQueryResultPhotoImpl + = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultPhotoImpl(block: (InlineQueryResultPhotoImpl) -> T): T? = + inlineQueryResultPhotoImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultStickerCachedOrNull(): + InlineQueryResultStickerCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultStickerCached + +public inline fun InlineQueryResult.inlineQueryResultStickerCachedOrThrow(): + InlineQueryResultStickerCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultStickerCached + +public inline fun + InlineQueryResult.ifInlineQueryResultStickerCached(block: (InlineQueryResultStickerCached) -> T): + T? = inlineQueryResultStickerCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVenueOrNull(): InlineQueryResultVenue? = this + as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVenue + +public inline fun InlineQueryResult.inlineQueryResultVenueOrThrow(): InlineQueryResultVenue = this + as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVenue + +public inline fun + InlineQueryResult.ifInlineQueryResultVenue(block: (InlineQueryResultVenue) -> T): T? = + inlineQueryResultVenueOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVideoCachedImplOrNull(): + InlineQueryResultVideoCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultVideoCachedImplOrThrow(): + InlineQueryResultVideoCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultVideoCachedImpl(block: (InlineQueryResultVideoCachedImpl) -> T): + T? = inlineQueryResultVideoCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVideoImplOrNull(): InlineQueryResultVideoImpl? + = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoImpl + +public inline fun InlineQueryResult.inlineQueryResultVideoImplOrThrow(): InlineQueryResultVideoImpl + = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultVideoImpl(block: (InlineQueryResultVideoImpl) -> T): T? = + inlineQueryResultVideoImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVoiceCachedImplOrNull(): + InlineQueryResultVoiceCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultVoiceCachedImplOrThrow(): + InlineQueryResultVoiceCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultVoiceCachedImpl(block: (InlineQueryResultVoiceCachedImpl) -> T): + T? = inlineQueryResultVoiceCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVoiceImplOrNull(): InlineQueryResultVoiceImpl? + = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceImpl + +public inline fun InlineQueryResult.inlineQueryResultVoiceImplOrThrow(): InlineQueryResultVoiceImpl + = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultVoiceImpl(block: (InlineQueryResultVoiceImpl) -> T): T? = + inlineQueryResultVoiceImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.describedInlineQueryResultOrNull(): DescribedInlineQueryResult? + = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.DescribedInlineQueryResult + +public inline fun InlineQueryResult.describedInlineQueryResultOrThrow(): DescribedInlineQueryResult + = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.DescribedInlineQueryResult + +public inline fun + InlineQueryResult.ifDescribedInlineQueryResult(block: (DescribedInlineQueryResult) -> T): T? = + describedInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.fileInlineQueryResultOrNull(): FileInlineQueryResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.FileInlineQueryResult + +public inline fun InlineQueryResult.fileInlineQueryResultOrThrow(): FileInlineQueryResult = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.FileInlineQueryResult + +public inline fun + InlineQueryResult.ifFileInlineQueryResult(block: (FileInlineQueryResult) -> T): T? = + fileInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.optionallyTitledInlineQueryResultOrNull(): + OptionallyTitledInlineQueryResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.OptionallyTitledInlineQueryResult + +public inline fun InlineQueryResult.optionallyTitledInlineQueryResultOrThrow(): + OptionallyTitledInlineQueryResult = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.OptionallyTitledInlineQueryResult + +public inline fun + InlineQueryResult.ifOptionallyTitledInlineQueryResult(block: (OptionallyTitledInlineQueryResult) -> T): + T? = optionallyTitledInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.sizedInlineQueryResultOrNull(): SizedInlineQueryResult? = this + as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.SizedInlineQueryResult + +public inline fun InlineQueryResult.sizedInlineQueryResultOrThrow(): SizedInlineQueryResult = this + as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.SizedInlineQueryResult + +public inline fun + InlineQueryResult.ifSizedInlineQueryResult(block: (SizedInlineQueryResult) -> T): T? = + sizedInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.thumbSizedInlineQueryResultOrNull(): + ThumbSizedInlineQueryResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbSizedInlineQueryResult + +public inline fun InlineQueryResult.thumbSizedInlineQueryResultOrThrow(): + ThumbSizedInlineQueryResult = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbSizedInlineQueryResult + +public inline fun + InlineQueryResult.ifThumbSizedInlineQueryResult(block: (ThumbSizedInlineQueryResult) -> T): T? = + thumbSizedInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.thumbedInlineQueryResultOrNull(): ThumbedInlineQueryResult? = + this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedInlineQueryResult + +public inline fun InlineQueryResult.thumbedInlineQueryResultOrThrow(): ThumbedInlineQueryResult = + this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedInlineQueryResult + +public inline fun + InlineQueryResult.ifThumbedInlineQueryResult(block: (ThumbedInlineQueryResult) -> T): T? = + thumbedInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.thumbedWithMimeTypeInlineQueryResultOrNull(): + ThumbedWithMimeTypeInlineQueryResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedWithMimeTypeInlineQueryResult + +public inline fun InlineQueryResult.thumbedWithMimeTypeInlineQueryResultOrThrow(): + ThumbedWithMimeTypeInlineQueryResult = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedWithMimeTypeInlineQueryResult + +public inline fun + InlineQueryResult.ifThumbedWithMimeTypeInlineQueryResult(block: (ThumbedWithMimeTypeInlineQueryResult) -> T): + T? = thumbedWithMimeTypeInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.titledInlineQueryResultOrNull(): TitledInlineQueryResult? = this + as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.TitledInlineQueryResult + +public inline fun InlineQueryResult.titledInlineQueryResultOrThrow(): TitledInlineQueryResult = this + as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.TitledInlineQueryResult + +public inline fun + InlineQueryResult.ifTitledInlineQueryResult(block: (TitledInlineQueryResult) -> T): T? = + titledInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.urlInlineQueryResultOrNull(): UrlInlineQueryResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.UrlInlineQueryResult + +public inline fun InlineQueryResult.urlInlineQueryResultOrThrow(): UrlInlineQueryResult = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.UrlInlineQueryResult + +public inline fun InlineQueryResult.ifUrlInlineQueryResult(block: (UrlInlineQueryResult) -> T): + T? = urlInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrNull(): + WithInputMessageContentInlineQueryResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult + +public inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrThrow(): + WithInputMessageContentInlineQueryResult = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult + +public inline fun + InlineQueryResult.ifWithInputMessageContentInlineQueryResult(block: (WithInputMessageContentInlineQueryResult) -> T): + T? = withInputMessageContentInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultAudioOrNull(): InlineQueryResultAudio? = this + as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio + +public inline fun InlineQueryResult.inlineQueryResultAudioOrThrow(): InlineQueryResultAudio = this + as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio + +public inline fun + InlineQueryResult.ifInlineQueryResultAudio(block: (InlineQueryResultAudio) -> T): T? = + inlineQueryResultAudioOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultAudioCachedOrNull(): + InlineQueryResultAudioCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached + +public inline fun InlineQueryResult.inlineQueryResultAudioCachedOrThrow(): + InlineQueryResultAudioCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached + +public inline fun + InlineQueryResult.ifInlineQueryResultAudioCached(block: (InlineQueryResultAudioCached) -> T): T? + = inlineQueryResultAudioCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultAudioCommonOrNull(): + InlineQueryResultAudioCommon? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCommon + +public inline fun InlineQueryResult.inlineQueryResultAudioCommonOrThrow(): + InlineQueryResultAudioCommon = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultAudioCommon(block: (InlineQueryResultAudioCommon) -> T): T? + = inlineQueryResultAudioCommonOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultDocumentOrNull(): InlineQueryResultDocument? = + this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocument + +public inline fun InlineQueryResult.inlineQueryResultDocumentOrThrow(): InlineQueryResultDocument = + this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocument + +public inline fun + InlineQueryResult.ifInlineQueryResultDocument(block: (InlineQueryResultDocument) -> T): T? = + inlineQueryResultDocumentOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultDocumentCachedOrNull(): + InlineQueryResultDocumentCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCached + +public inline fun InlineQueryResult.inlineQueryResultDocumentCachedOrThrow(): + InlineQueryResultDocumentCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCached + +public inline fun + InlineQueryResult.ifInlineQueryResultDocumentCached(block: (InlineQueryResultDocumentCached) -> T): + T? = inlineQueryResultDocumentCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultDocumentCommonOrNull(): + InlineQueryResultDocumentCommon? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCommon + +public inline fun InlineQueryResult.inlineQueryResultDocumentCommonOrThrow(): + InlineQueryResultDocumentCommon = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultDocumentCommon(block: (InlineQueryResultDocumentCommon) -> T): + T? = inlineQueryResultDocumentCommonOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultGifOrNull(): InlineQueryResultGif? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif + +public inline fun InlineQueryResult.inlineQueryResultGifOrThrow(): InlineQueryResultGif = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif + +public inline fun InlineQueryResult.ifInlineQueryResultGif(block: (InlineQueryResultGif) -> T): + T? = inlineQueryResultGifOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultGifCachedOrNull(): InlineQueryResultGifCached? + = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached + +public inline fun InlineQueryResult.inlineQueryResultGifCachedOrThrow(): InlineQueryResultGifCached + = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached + +public inline fun + InlineQueryResult.ifInlineQueryResultGifCached(block: (InlineQueryResultGifCached) -> T): T? = + inlineQueryResultGifCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultGifCommonOrNull(): InlineQueryResultGifCommon? + = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCommon + +public inline fun InlineQueryResult.inlineQueryResultGifCommonOrThrow(): InlineQueryResultGifCommon + = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultGifCommon(block: (InlineQueryResultGifCommon) -> T): T? = + inlineQueryResultGifCommonOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifOrNull(): InlineQueryResultMpeg4Gif? = + this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifOrThrow(): InlineQueryResultMpeg4Gif = + this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif + +public inline fun + InlineQueryResult.ifInlineQueryResultMpeg4Gif(block: (InlineQueryResultMpeg4Gif) -> T): T? = + inlineQueryResultMpeg4GifOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedOrNull(): + InlineQueryResultMpeg4GifCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCached + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedOrThrow(): + InlineQueryResultMpeg4GifCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCached + +public inline fun + InlineQueryResult.ifInlineQueryResultMpeg4GifCached(block: (InlineQueryResultMpeg4GifCached) -> T): + T? = inlineQueryResultMpeg4GifCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCommonOrNull(): + InlineQueryResultMpeg4GifCommon? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCommon + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCommonOrThrow(): + InlineQueryResultMpeg4GifCommon = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultMpeg4GifCommon(block: (InlineQueryResultMpeg4GifCommon) -> T): + T? = inlineQueryResultMpeg4GifCommonOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultPhotoOrNull(): InlineQueryResultPhoto? = this + as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhoto + +public inline fun InlineQueryResult.inlineQueryResultPhotoOrThrow(): InlineQueryResultPhoto = this + as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhoto + +public inline fun + InlineQueryResult.ifInlineQueryResultPhoto(block: (InlineQueryResultPhoto) -> T): T? = + inlineQueryResultPhotoOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultPhotoCachedOrNull(): + InlineQueryResultPhotoCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCached + +public inline fun InlineQueryResult.inlineQueryResultPhotoCachedOrThrow(): + InlineQueryResultPhotoCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCached + +public inline fun + InlineQueryResult.ifInlineQueryResultPhotoCached(block: (InlineQueryResultPhotoCached) -> T): T? + = inlineQueryResultPhotoCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultPhotoCommonOrNull(): + InlineQueryResultPhotoCommon? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCommon + +public inline fun InlineQueryResult.inlineQueryResultPhotoCommonOrThrow(): + InlineQueryResultPhotoCommon = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultPhotoCommon(block: (InlineQueryResultPhotoCommon) -> T): T? + = inlineQueryResultPhotoCommonOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVideoOrNull(): InlineQueryResultVideo? = this + as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo + +public inline fun InlineQueryResult.inlineQueryResultVideoOrThrow(): InlineQueryResultVideo = this + as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo + +public inline fun + InlineQueryResult.ifInlineQueryResultVideo(block: (InlineQueryResultVideo) -> T): T? = + inlineQueryResultVideoOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVideoCachedOrNull(): + InlineQueryResultVideoCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCached + +public inline fun InlineQueryResult.inlineQueryResultVideoCachedOrThrow(): + InlineQueryResultVideoCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCached + +public inline fun + InlineQueryResult.ifInlineQueryResultVideoCached(block: (InlineQueryResultVideoCached) -> T): T? + = inlineQueryResultVideoCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVideoCommonOrNull(): + InlineQueryResultVideoCommon? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCommon + +public inline fun InlineQueryResult.inlineQueryResultVideoCommonOrThrow(): + InlineQueryResultVideoCommon = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultVideoCommon(block: (InlineQueryResultVideoCommon) -> T): T? + = inlineQueryResultVideoCommonOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVoiceOrNull(): InlineQueryResultVoice? = this + as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice + +public inline fun InlineQueryResult.inlineQueryResultVoiceOrThrow(): InlineQueryResultVoice = this + as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice + +public inline fun + InlineQueryResult.ifInlineQueryResultVoice(block: (InlineQueryResultVoice) -> T): T? = + inlineQueryResultVoiceOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVoiceCachedOrNull(): + InlineQueryResultVoiceCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached + +public inline fun InlineQueryResult.inlineQueryResultVoiceCachedOrThrow(): + InlineQueryResultVoiceCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached + +public inline fun + InlineQueryResult.ifInlineQueryResultVoiceCached(block: (InlineQueryResultVoiceCached) -> T): T? + = inlineQueryResultVoiceCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVoiceCommonOrNull(): + InlineQueryResultVoiceCommon? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCommon + +public inline fun InlineQueryResult.inlineQueryResultVoiceCommonOrThrow(): + InlineQueryResultVoiceCommon = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultVoiceCommon(block: (InlineQueryResultVoiceCommon) -> T): T? + = inlineQueryResultVoiceCommonOrNull() ?.let(block) + +public inline fun InputMessageContent.inputContactMessageContentOrNull(): + InputContactMessageContent? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputContactMessageContent + +public inline fun InputMessageContent.inputContactMessageContentOrThrow(): + InputContactMessageContent = this as + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputContactMessageContent + +public inline fun + InputMessageContent.ifInputContactMessageContent(block: (InputContactMessageContent) -> T): T? = + inputContactMessageContentOrNull() ?.let(block) + +public inline fun InputMessageContent.inputInvoiceMessageContentOrNull(): + InputInvoiceMessageContent? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent + +public inline fun InputMessageContent.inputInvoiceMessageContentOrThrow(): + InputInvoiceMessageContent = this as + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent + +public inline fun + InputMessageContent.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T): T? = + inputInvoiceMessageContentOrNull() ?.let(block) + +public inline fun InputMessageContent.inputLocationMessageContentOrNull(): + InputLocationMessageContent? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputLocationMessageContent + +public inline fun InputMessageContent.inputLocationMessageContentOrThrow(): + InputLocationMessageContent = this as + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputLocationMessageContent + +public inline fun + InputMessageContent.ifInputLocationMessageContent(block: (InputLocationMessageContent) -> T): T? + = inputLocationMessageContentOrNull() ?.let(block) + +public inline fun InputMessageContent.inputTextMessageContentOrNull(): InputTextMessageContent? = + this as? dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent + +public inline fun InputMessageContent.inputTextMessageContentOrThrow(): InputTextMessageContent = + this as dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent + +public inline fun + InputMessageContent.ifInputTextMessageContent(block: (InputTextMessageContent) -> T): T? = + inputTextMessageContentOrNull() ?.let(block) + +public inline fun InputMessageContent.inputVenueMessageContentOrNull(): InputVenueMessageContent? = + this as? dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessageContent + +public inline fun InputMessageContent.inputVenueMessageContentOrThrow(): InputVenueMessageContent = + this as dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessageContent + +public inline fun + InputMessageContent.ifInputVenueMessageContent(block: (InputVenueMessageContent) -> T): T? = + inputVenueMessageContentOrNull() ?.let(block) + +public inline fun BotAction.typingActionOrNull(): TypingAction? = this as? + dev.inmo.tgbotapi.types.actions.TypingAction + +public inline fun BotAction.typingActionOrThrow(): TypingAction = this as + dev.inmo.tgbotapi.types.actions.TypingAction + +public inline fun BotAction.ifTypingAction(block: (TypingAction) -> T): T? = + typingActionOrNull() ?.let(block) + +public inline fun BotAction.uploadPhotoActionOrNull(): UploadPhotoAction? = this as? + dev.inmo.tgbotapi.types.actions.UploadPhotoAction + +public inline fun BotAction.uploadPhotoActionOrThrow(): UploadPhotoAction = this as + dev.inmo.tgbotapi.types.actions.UploadPhotoAction + +public inline fun BotAction.ifUploadPhotoAction(block: (UploadPhotoAction) -> T): T? = + uploadPhotoActionOrNull() ?.let(block) + +public inline fun BotAction.recordVideoActionOrNull(): RecordVideoAction? = this as? + dev.inmo.tgbotapi.types.actions.RecordVideoAction + +public inline fun BotAction.recordVideoActionOrThrow(): RecordVideoAction = this as + dev.inmo.tgbotapi.types.actions.RecordVideoAction + +public inline fun BotAction.ifRecordVideoAction(block: (RecordVideoAction) -> T): T? = + recordVideoActionOrNull() ?.let(block) + +public inline fun BotAction.uploadVideoActionOrNull(): UploadVideoAction? = this as? + dev.inmo.tgbotapi.types.actions.UploadVideoAction + +public inline fun BotAction.uploadVideoActionOrThrow(): UploadVideoAction = this as + dev.inmo.tgbotapi.types.actions.UploadVideoAction + +public inline fun BotAction.ifUploadVideoAction(block: (UploadVideoAction) -> T): T? = + uploadVideoActionOrNull() ?.let(block) + +public inline fun BotAction.recordVoiceActionOrNull(): RecordVoiceAction? = this as? + dev.inmo.tgbotapi.types.actions.RecordVoiceAction + +public inline fun BotAction.recordVoiceActionOrThrow(): RecordVoiceAction = this as + dev.inmo.tgbotapi.types.actions.RecordVoiceAction + +public inline fun BotAction.ifRecordVoiceAction(block: (RecordVoiceAction) -> T): T? = + recordVoiceActionOrNull() ?.let(block) + +public inline fun BotAction.uploadVoiceActionOrNull(): UploadVoiceAction? = this as? + dev.inmo.tgbotapi.types.actions.UploadVoiceAction + +public inline fun BotAction.uploadVoiceActionOrThrow(): UploadVoiceAction = this as + dev.inmo.tgbotapi.types.actions.UploadVoiceAction + +public inline fun BotAction.ifUploadVoiceAction(block: (UploadVoiceAction) -> T): T? = + uploadVoiceActionOrNull() ?.let(block) + +public inline fun BotAction.uploadDocumentActionOrNull(): UploadDocumentAction? = this as? + dev.inmo.tgbotapi.types.actions.UploadDocumentAction + +public inline fun BotAction.uploadDocumentActionOrThrow(): UploadDocumentAction = this as + dev.inmo.tgbotapi.types.actions.UploadDocumentAction + +public inline fun BotAction.ifUploadDocumentAction(block: (UploadDocumentAction) -> T): T? = + uploadDocumentActionOrNull() ?.let(block) + +public inline fun BotAction.findLocationActionOrNull(): FindLocationAction? = this as? + dev.inmo.tgbotapi.types.actions.FindLocationAction + +public inline fun BotAction.findLocationActionOrThrow(): FindLocationAction = this as + dev.inmo.tgbotapi.types.actions.FindLocationAction + +public inline fun BotAction.ifFindLocationAction(block: (FindLocationAction) -> T): T? = + findLocationActionOrNull() ?.let(block) + +public inline fun BotAction.recordVideoNoteActionOrNull(): RecordVideoNoteAction? = this as? + dev.inmo.tgbotapi.types.actions.RecordVideoNoteAction + +public inline fun BotAction.recordVideoNoteActionOrThrow(): RecordVideoNoteAction = this as + dev.inmo.tgbotapi.types.actions.RecordVideoNoteAction + +public inline fun BotAction.ifRecordVideoNoteAction(block: (RecordVideoNoteAction) -> T): T? = + recordVideoNoteActionOrNull() ?.let(block) + +public inline fun BotAction.uploadVideoNoteActionOrNull(): UploadVideoNoteAction? = this as? + dev.inmo.tgbotapi.types.actions.UploadVideoNoteAction + +public inline fun BotAction.uploadVideoNoteActionOrThrow(): UploadVideoNoteAction = this as + dev.inmo.tgbotapi.types.actions.UploadVideoNoteAction + +public inline fun BotAction.ifUploadVideoNoteAction(block: (UploadVideoNoteAction) -> T): T? = + uploadVideoNoteActionOrNull() ?.let(block) + +public inline fun BotAction.chooseStickerActionOrNull(): ChooseStickerAction? = this as? + dev.inmo.tgbotapi.types.actions.ChooseStickerAction + +public inline fun BotAction.chooseStickerActionOrThrow(): ChooseStickerAction = this as + dev.inmo.tgbotapi.types.actions.ChooseStickerAction + +public inline fun BotAction.ifChooseStickerAction(block: (ChooseStickerAction) -> T): T? = + chooseStickerActionOrNull() ?.let(block) + +public inline fun BotAction.customBotActionOrNull(): CustomBotAction? = this as? + dev.inmo.tgbotapi.types.actions.CustomBotAction + +public inline fun BotAction.customBotActionOrThrow(): CustomBotAction = this as + dev.inmo.tgbotapi.types.actions.CustomBotAction + +public inline fun BotAction.ifCustomBotAction(block: (CustomBotAction) -> T): T? = + customBotActionOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.unknownInlineKeyboardButtonOrNull(): + UnknownInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.UnknownInlineKeyboardButton + +public inline fun InlineKeyboardButton.unknownInlineKeyboardButtonOrThrow(): + UnknownInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.UnknownInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifUnknownInlineKeyboardButton(block: (UnknownInlineKeyboardButton) -> T): + T? = unknownInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.payInlineKeyboardButtonOrNull(): PayInlineKeyboardButton? = + this as? dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.PayInlineKeyboardButton + +public inline fun InlineKeyboardButton.payInlineKeyboardButtonOrThrow(): PayInlineKeyboardButton = + this as dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.PayInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifPayInlineKeyboardButton(block: (PayInlineKeyboardButton) -> T): T? = + payInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.callbackDataInlineKeyboardButtonOrNull(): + CallbackDataInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackDataInlineKeyboardButton + +public inline fun InlineKeyboardButton.callbackDataInlineKeyboardButtonOrThrow(): + CallbackDataInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackDataInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifCallbackDataInlineKeyboardButton(block: (CallbackDataInlineKeyboardButton) -> T): + T? = callbackDataInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.callbackGameInlineKeyboardButtonOrNull(): + CallbackGameInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackGameInlineKeyboardButton + +public inline fun InlineKeyboardButton.callbackGameInlineKeyboardButtonOrThrow(): + CallbackGameInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackGameInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifCallbackGameInlineKeyboardButton(block: (CallbackGameInlineKeyboardButton) -> T): + T? = callbackGameInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.loginURLInlineKeyboardButtonOrNull(): + LoginURLInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.LoginURLInlineKeyboardButton + +public inline fun InlineKeyboardButton.loginURLInlineKeyboardButtonOrThrow(): + LoginURLInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.LoginURLInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifLoginURLInlineKeyboardButton(block: (LoginURLInlineKeyboardButton) -> T): + T? = loginURLInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.switchInlineQueryCurrentChatInlineKeyboardButtonOrNull(): + SwitchInlineQueryCurrentChatInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryCurrentChatInlineKeyboardButton + +public inline fun InlineKeyboardButton.switchInlineQueryCurrentChatInlineKeyboardButtonOrThrow(): + SwitchInlineQueryCurrentChatInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryCurrentChatInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifSwitchInlineQueryCurrentChatInlineKeyboardButton(block: (SwitchInlineQueryCurrentChatInlineKeyboardButton) -> T): + T? = switchInlineQueryCurrentChatInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.switchInlineQueryInlineKeyboardButtonOrNull(): + SwitchInlineQueryInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryInlineKeyboardButton + +public inline fun InlineKeyboardButton.switchInlineQueryInlineKeyboardButtonOrThrow(): + SwitchInlineQueryInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifSwitchInlineQueryInlineKeyboardButton(block: (SwitchInlineQueryInlineKeyboardButton) -> T): + T? = switchInlineQueryInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.uRLInlineKeyboardButtonOrNull(): URLInlineKeyboardButton? = + this as? dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.URLInlineKeyboardButton + +public inline fun InlineKeyboardButton.uRLInlineKeyboardButtonOrThrow(): URLInlineKeyboardButton = + this as dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.URLInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifURLInlineKeyboardButton(block: (URLInlineKeyboardButton) -> T): T? = + uRLInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.webAppInlineKeyboardButtonOrNull(): + WebAppInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.WebAppInlineKeyboardButton + +public inline fun InlineKeyboardButton.webAppInlineKeyboardButtonOrThrow(): + WebAppInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.WebAppInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifWebAppInlineKeyboardButton(block: (WebAppInlineKeyboardButton) -> T): T? + = webAppInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun KeyboardMarkup.inlineKeyboardMarkupOrNull(): InlineKeyboardMarkup? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup + +public inline fun KeyboardMarkup.inlineKeyboardMarkupOrThrow(): InlineKeyboardMarkup = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup + +public inline fun KeyboardMarkup.ifInlineKeyboardMarkup(block: (InlineKeyboardMarkup) -> T): T? + = inlineKeyboardMarkupOrNull() ?.let(block) + +public inline fun KeyboardMarkup.replyForceOrNull(): ReplyForce? = this as? + dev.inmo.tgbotapi.types.buttons.ReplyForce + +public inline fun KeyboardMarkup.replyForceOrThrow(): ReplyForce = this as + dev.inmo.tgbotapi.types.buttons.ReplyForce + +public inline fun KeyboardMarkup.ifReplyForce(block: (ReplyForce) -> T): T? = replyForceOrNull() + ?.let(block) + +public inline fun KeyboardMarkup.replyKeyboardMarkupOrNull(): ReplyKeyboardMarkup? = this as? + dev.inmo.tgbotapi.types.buttons.ReplyKeyboardMarkup + +public inline fun KeyboardMarkup.replyKeyboardMarkupOrThrow(): ReplyKeyboardMarkup = this as + dev.inmo.tgbotapi.types.buttons.ReplyKeyboardMarkup + +public inline fun KeyboardMarkup.ifReplyKeyboardMarkup(block: (ReplyKeyboardMarkup) -> T): T? = + replyKeyboardMarkupOrNull() ?.let(block) + +public inline fun KeyboardMarkup.replyKeyboardRemoveOrNull(): ReplyKeyboardRemove? = this as? + dev.inmo.tgbotapi.types.buttons.ReplyKeyboardRemove + +public inline fun KeyboardMarkup.replyKeyboardRemoveOrThrow(): ReplyKeyboardRemove = this as + dev.inmo.tgbotapi.types.buttons.ReplyKeyboardRemove + +public inline fun KeyboardMarkup.ifReplyKeyboardRemove(block: (ReplyKeyboardRemove) -> T): T? = + replyKeyboardRemoveOrNull() ?.let(block) + +public inline fun Chat.channelChatOrNull(): ChannelChat? = this as? + dev.inmo.tgbotapi.types.chat.ChannelChat + +public inline fun Chat.channelChatOrThrow(): ChannelChat = this as + dev.inmo.tgbotapi.types.chat.ChannelChat + +public inline fun Chat.ifChannelChat(block: (ChannelChat) -> T): T? = channelChatOrNull() + ?.let(block) + +public inline fun Chat.groupChatOrNull(): GroupChat? = this as? + dev.inmo.tgbotapi.types.chat.GroupChat + +public inline fun Chat.groupChatOrThrow(): GroupChat = this as + dev.inmo.tgbotapi.types.chat.GroupChat + +public inline fun Chat.ifGroupChat(block: (GroupChat) -> T): T? = groupChatOrNull() ?.let(block) + +public inline fun Chat.privateChatOrNull(): PrivateChat? = this as? + dev.inmo.tgbotapi.types.chat.PrivateChat + +public inline fun Chat.privateChatOrThrow(): PrivateChat = this as + dev.inmo.tgbotapi.types.chat.PrivateChat + +public inline fun Chat.ifPrivateChat(block: (PrivateChat) -> T): T? = privateChatOrNull() + ?.let(block) + +public inline fun Chat.publicChatOrNull(): PublicChat? = this as? + dev.inmo.tgbotapi.types.chat.PublicChat + +public inline fun Chat.publicChatOrThrow(): PublicChat = this as + dev.inmo.tgbotapi.types.chat.PublicChat + +public inline fun Chat.ifPublicChat(block: (PublicChat) -> T): T? = publicChatOrNull() + ?.let(block) + +public inline fun Chat.supergroupChatOrNull(): SupergroupChat? = this as? + dev.inmo.tgbotapi.types.chat.SupergroupChat + +public inline fun Chat.supergroupChatOrThrow(): SupergroupChat = this as + dev.inmo.tgbotapi.types.chat.SupergroupChat + +public inline fun Chat.ifSupergroupChat(block: (SupergroupChat) -> T): T? = + supergroupChatOrNull() ?.let(block) + +public inline fun Chat.superPublicChatOrNull(): SuperPublicChat? = this as? + dev.inmo.tgbotapi.types.chat.SuperPublicChat + +public inline fun Chat.superPublicChatOrThrow(): SuperPublicChat = this as + dev.inmo.tgbotapi.types.chat.SuperPublicChat + +public inline fun Chat.ifSuperPublicChat(block: (SuperPublicChat) -> T): T? = + superPublicChatOrNull() ?.let(block) + +public inline fun Chat.usernameChatOrNull(): UsernameChat? = this as? + dev.inmo.tgbotapi.types.chat.UsernameChat + +public inline fun Chat.usernameChatOrThrow(): UsernameChat = this as + dev.inmo.tgbotapi.types.chat.UsernameChat + +public inline fun Chat.ifUsernameChat(block: (UsernameChat) -> T): T? = usernameChatOrNull() + ?.let(block) + +public inline fun Chat.possiblyPremiumChatOrNull(): PossiblyPremiumChat? = this as? + dev.inmo.tgbotapi.types.chat.PossiblyPremiumChat + +public inline fun Chat.possiblyPremiumChatOrThrow(): PossiblyPremiumChat = this as + dev.inmo.tgbotapi.types.chat.PossiblyPremiumChat + +public inline fun Chat.ifPossiblyPremiumChat(block: (PossiblyPremiumChat) -> T): T? = + possiblyPremiumChatOrNull() ?.let(block) + +public inline fun Chat.ableToAddInAttachmentMenuChatOrNull(): AbleToAddInAttachmentMenuChat? = this + as? dev.inmo.tgbotapi.types.chat.AbleToAddInAttachmentMenuChat + +public inline fun Chat.ableToAddInAttachmentMenuChatOrThrow(): AbleToAddInAttachmentMenuChat = this + as dev.inmo.tgbotapi.types.chat.AbleToAddInAttachmentMenuChat + +public inline fun + Chat.ifAbleToAddInAttachmentMenuChat(block: (AbleToAddInAttachmentMenuChat) -> T): T? = + ableToAddInAttachmentMenuChatOrNull() ?.let(block) + +public inline fun Chat.extendedChannelChatImplOrNull(): ExtendedChannelChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedChannelChatImpl + +public inline fun Chat.extendedChannelChatImplOrThrow(): ExtendedChannelChatImpl = this as + dev.inmo.tgbotapi.types.chat.ExtendedChannelChatImpl + +public inline fun Chat.ifExtendedChannelChatImpl(block: (ExtendedChannelChatImpl) -> T): T? = + extendedChannelChatImplOrNull() ?.let(block) + +public inline fun Chat.extendedGroupChatImplOrNull(): ExtendedGroupChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedGroupChatImpl + +public inline fun Chat.extendedGroupChatImplOrThrow(): ExtendedGroupChatImpl = this as + dev.inmo.tgbotapi.types.chat.ExtendedGroupChatImpl + +public inline fun Chat.ifExtendedGroupChatImpl(block: (ExtendedGroupChatImpl) -> T): T? = + extendedGroupChatImplOrNull() ?.let(block) + +public inline fun Chat.extendedPrivateChatImplOrNull(): ExtendedPrivateChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedPrivateChatImpl + +public inline fun Chat.extendedPrivateChatImplOrThrow(): ExtendedPrivateChatImpl = this as + dev.inmo.tgbotapi.types.chat.ExtendedPrivateChatImpl + +public inline fun Chat.ifExtendedPrivateChatImpl(block: (ExtendedPrivateChatImpl) -> T): T? = + extendedPrivateChatImplOrNull() ?.let(block) + +public inline fun Chat.extendedSupergroupChatImplOrNull(): ExtendedSupergroupChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChatImpl + +public inline fun Chat.extendedSupergroupChatImplOrThrow(): ExtendedSupergroupChatImpl = this as + dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChatImpl + +public inline fun Chat.ifExtendedSupergroupChatImpl(block: (ExtendedSupergroupChatImpl) -> T): + T? = extendedSupergroupChatImplOrNull() ?.let(block) + +public inline fun Chat.extendedBotOrNull(): ExtendedBot? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedBot + +public inline fun Chat.extendedBotOrThrow(): ExtendedBot = this as + dev.inmo.tgbotapi.types.chat.ExtendedBot + +public inline fun Chat.ifExtendedBot(block: (ExtendedBot) -> T): T? = extendedBotOrNull() + ?.let(block) + +public inline fun Chat.unknownExtendedChatOrNull(): UnknownExtendedChat? = this as? + dev.inmo.tgbotapi.types.chat.UnknownExtendedChat + +public inline fun Chat.unknownExtendedChatOrThrow(): UnknownExtendedChat = this as + dev.inmo.tgbotapi.types.chat.UnknownExtendedChat + +public inline fun Chat.ifUnknownExtendedChat(block: (UnknownExtendedChat) -> T): T? = + unknownExtendedChatOrNull() ?.let(block) + +public inline fun Chat.extendedChannelChatOrNull(): ExtendedChannelChat? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedChannelChat + +public inline fun Chat.extendedChannelChatOrThrow(): ExtendedChannelChat = this as + dev.inmo.tgbotapi.types.chat.ExtendedChannelChat + +public inline fun Chat.ifExtendedChannelChat(block: (ExtendedChannelChat) -> T): T? = + extendedChannelChatOrNull() ?.let(block) + +public inline fun Chat.extendedGroupChatOrNull(): ExtendedGroupChat? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedGroupChat + +public inline fun Chat.extendedGroupChatOrThrow(): ExtendedGroupChat = this as + dev.inmo.tgbotapi.types.chat.ExtendedGroupChat + +public inline fun Chat.ifExtendedGroupChat(block: (ExtendedGroupChat) -> T): T? = + extendedGroupChatOrNull() ?.let(block) + +public inline fun Chat.extendedPrivateChatOrNull(): ExtendedPrivateChat? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat + +public inline fun Chat.extendedPrivateChatOrThrow(): ExtendedPrivateChat = this as + dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat + +public inline fun Chat.ifExtendedPrivateChat(block: (ExtendedPrivateChat) -> T): T? = + extendedPrivateChatOrNull() ?.let(block) + +public inline fun Chat.extendedPublicChatOrNull(): ExtendedPublicChat? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedPublicChat + +public inline fun Chat.extendedPublicChatOrThrow(): ExtendedPublicChat = this as + dev.inmo.tgbotapi.types.chat.ExtendedPublicChat + +public inline fun Chat.ifExtendedPublicChat(block: (ExtendedPublicChat) -> T): T? = + extendedPublicChatOrNull() ?.let(block) + +public inline fun Chat.extendedSupergroupChatOrNull(): ExtendedSupergroupChat? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat + +public inline fun Chat.extendedSupergroupChatOrThrow(): ExtendedSupergroupChat = this as + dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat + +public inline fun Chat.ifExtendedSupergroupChat(block: (ExtendedSupergroupChat) -> T): T? = + extendedSupergroupChatOrNull() ?.let(block) + +public inline fun Chat.extendedChatOrNull(): ExtendedChat? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedChat + +public inline fun Chat.extendedChatOrThrow(): ExtendedChat = this as + dev.inmo.tgbotapi.types.chat.ExtendedChat + +public inline fun Chat.ifExtendedChat(block: (ExtendedChat) -> T): T? = extendedChatOrNull() + ?.let(block) + +public inline fun Chat.groupChatImplOrNull(): GroupChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.GroupChatImpl + +public inline fun Chat.groupChatImplOrThrow(): GroupChatImpl = this as + dev.inmo.tgbotapi.types.chat.GroupChatImpl + +public inline fun Chat.ifGroupChatImpl(block: (GroupChatImpl) -> T): T? = groupChatImplOrNull() + ?.let(block) + +public inline fun Chat.privateChatImplOrNull(): PrivateChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.PrivateChatImpl + +public inline fun Chat.privateChatImplOrThrow(): PrivateChatImpl = this as + dev.inmo.tgbotapi.types.chat.PrivateChatImpl + +public inline fun Chat.ifPrivateChatImpl(block: (PrivateChatImpl) -> T): T? = + privateChatImplOrNull() ?.let(block) + +public inline fun Chat.supergroupChatImplOrNull(): SupergroupChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.SupergroupChatImpl + +public inline fun Chat.supergroupChatImplOrThrow(): SupergroupChatImpl = this as + dev.inmo.tgbotapi.types.chat.SupergroupChatImpl + +public inline fun Chat.ifSupergroupChatImpl(block: (SupergroupChatImpl) -> T): T? = + supergroupChatImplOrNull() ?.let(block) + +public inline fun Chat.channelChatImplOrNull(): ChannelChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.ChannelChatImpl + +public inline fun Chat.channelChatImplOrThrow(): ChannelChatImpl = this as + dev.inmo.tgbotapi.types.chat.ChannelChatImpl + +public inline fun Chat.ifChannelChatImpl(block: (ChannelChatImpl) -> T): T? = + channelChatImplOrNull() ?.let(block) + +public inline fun Chat.userOrNull(): User? = this as? dev.inmo.tgbotapi.types.chat.User + +public inline fun Chat.userOrThrow(): User = this as dev.inmo.tgbotapi.types.chat.User + +public inline fun Chat.ifUser(block: (User) -> T): T? = userOrNull() ?.let(block) + +public inline fun Chat.botOrNull(): Bot? = this as? dev.inmo.tgbotapi.types.chat.Bot + +public inline fun Chat.botOrThrow(): Bot = this as dev.inmo.tgbotapi.types.chat.Bot + +public inline fun Chat.ifBot(block: (Bot) -> T): T? = botOrNull() ?.let(block) + +public inline fun Chat.commonBotOrNull(): CommonBot? = this as? + dev.inmo.tgbotapi.types.chat.CommonBot + +public inline fun Chat.commonBotOrThrow(): CommonBot = this as + dev.inmo.tgbotapi.types.chat.CommonBot + +public inline fun Chat.ifCommonBot(block: (CommonBot) -> T): T? = commonBotOrNull() ?.let(block) + +public inline fun Chat.commonUserOrNull(): CommonUser? = this as? + dev.inmo.tgbotapi.types.chat.CommonUser + +public inline fun Chat.commonUserOrThrow(): CommonUser = this as + dev.inmo.tgbotapi.types.chat.CommonUser + +public inline fun Chat.ifCommonUser(block: (CommonUser) -> T): T? = commonUserOrNull() + ?.let(block) + +public inline fun Chat.unknownChatTypeOrNull(): UnknownChatType? = this as? + dev.inmo.tgbotapi.types.chat.UnknownChatType + +public inline fun Chat.unknownChatTypeOrThrow(): UnknownChatType = this as + dev.inmo.tgbotapi.types.chat.UnknownChatType + +public inline fun Chat.ifUnknownChatType(block: (UnknownChatType) -> T): T? = + unknownChatTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.cubeDiceAnimationTypeOrNull(): CubeDiceAnimationType? = this as? + dev.inmo.tgbotapi.types.dice.CubeDiceAnimationType + +public inline fun DiceAnimationType.cubeDiceAnimationTypeOrThrow(): CubeDiceAnimationType = this as + dev.inmo.tgbotapi.types.dice.CubeDiceAnimationType + +public inline fun + DiceAnimationType.ifCubeDiceAnimationType(block: (CubeDiceAnimationType) -> T): T? = + cubeDiceAnimationTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.dartsDiceAnimationTypeOrNull(): DartsDiceAnimationType? = this + as? dev.inmo.tgbotapi.types.dice.DartsDiceAnimationType + +public inline fun DiceAnimationType.dartsDiceAnimationTypeOrThrow(): DartsDiceAnimationType = this + as dev.inmo.tgbotapi.types.dice.DartsDiceAnimationType + +public inline fun + DiceAnimationType.ifDartsDiceAnimationType(block: (DartsDiceAnimationType) -> T): T? = + dartsDiceAnimationTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.basketballDiceAnimationTypeOrNull(): + BasketballDiceAnimationType? = this as? dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType + +public inline fun DiceAnimationType.basketballDiceAnimationTypeOrThrow(): + BasketballDiceAnimationType = this as dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType + +public inline fun + DiceAnimationType.ifBasketballDiceAnimationType(block: (BasketballDiceAnimationType) -> T): T? = + basketballDiceAnimationTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.footballDiceAnimationTypeOrNull(): FootballDiceAnimationType? = + this as? dev.inmo.tgbotapi.types.dice.FootballDiceAnimationType + +public inline fun DiceAnimationType.footballDiceAnimationTypeOrThrow(): FootballDiceAnimationType = + this as dev.inmo.tgbotapi.types.dice.FootballDiceAnimationType + +public inline fun + DiceAnimationType.ifFootballDiceAnimationType(block: (FootballDiceAnimationType) -> T): T? = + footballDiceAnimationTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.bowlingDiceAnimationTypeOrNull(): BowlingDiceAnimationType? = + this as? dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType + +public inline fun DiceAnimationType.bowlingDiceAnimationTypeOrThrow(): BowlingDiceAnimationType = + this as dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType + +public inline fun + DiceAnimationType.ifBowlingDiceAnimationType(block: (BowlingDiceAnimationType) -> T): T? = + bowlingDiceAnimationTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.slotMachineDiceAnimationTypeOrNull(): + SlotMachineDiceAnimationType? = this as? + dev.inmo.tgbotapi.types.dice.SlotMachineDiceAnimationType + +public inline fun DiceAnimationType.slotMachineDiceAnimationTypeOrThrow(): + SlotMachineDiceAnimationType = this as dev.inmo.tgbotapi.types.dice.SlotMachineDiceAnimationType + +public inline fun + DiceAnimationType.ifSlotMachineDiceAnimationType(block: (SlotMachineDiceAnimationType) -> T): T? + = slotMachineDiceAnimationTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.customDiceAnimationTypeOrNull(): CustomDiceAnimationType? = this + as? dev.inmo.tgbotapi.types.dice.CustomDiceAnimationType + +public inline fun DiceAnimationType.customDiceAnimationTypeOrThrow(): CustomDiceAnimationType = this + as dev.inmo.tgbotapi.types.dice.CustomDiceAnimationType + +public inline fun + DiceAnimationType.ifCustomDiceAnimationType(block: (CustomDiceAnimationType) -> T): T? = + customDiceAnimationTypeOrNull() ?.let(block) + +public inline fun TelegramMediaFile.animationFileOrNull(): AnimationFile? = this as? + dev.inmo.tgbotapi.types.files.AnimationFile + +public inline fun TelegramMediaFile.animationFileOrThrow(): AnimationFile = this as + dev.inmo.tgbotapi.types.files.AnimationFile + +public inline fun TelegramMediaFile.ifAnimationFile(block: (AnimationFile) -> T): T? = + animationFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.audioFileOrNull(): AudioFile? = this as? + dev.inmo.tgbotapi.types.files.AudioFile + +public inline fun TelegramMediaFile.audioFileOrThrow(): AudioFile = this as + dev.inmo.tgbotapi.types.files.AudioFile + +public inline fun TelegramMediaFile.ifAudioFile(block: (AudioFile) -> T): T? = audioFileOrNull() + ?.let(block) + +public inline fun TelegramMediaFile.documentFileOrNull(): DocumentFile? = this as? + dev.inmo.tgbotapi.types.files.DocumentFile + +public inline fun TelegramMediaFile.documentFileOrThrow(): DocumentFile = this as + dev.inmo.tgbotapi.types.files.DocumentFile + +public inline fun TelegramMediaFile.ifDocumentFile(block: (DocumentFile) -> T): T? = + documentFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.fileOrNull(): File? = this as? + dev.inmo.tgbotapi.types.files.File + +public inline fun TelegramMediaFile.fileOrThrow(): File = this as dev.inmo.tgbotapi.types.files.File + +public inline fun TelegramMediaFile.ifFile(block: (File) -> T): T? = fileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.mimedMediaFileOrNull(): MimedMediaFile? = this as? + dev.inmo.tgbotapi.types.files.MimedMediaFile + +public inline fun TelegramMediaFile.mimedMediaFileOrThrow(): MimedMediaFile = this as + dev.inmo.tgbotapi.types.files.MimedMediaFile + +public inline fun TelegramMediaFile.ifMimedMediaFile(block: (MimedMediaFile) -> T): T? = + mimedMediaFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.passportFileOrNull(): PassportFile? = this as? + dev.inmo.tgbotapi.types.files.PassportFile + +public inline fun TelegramMediaFile.passportFileOrThrow(): PassportFile = this as + dev.inmo.tgbotapi.types.files.PassportFile + +public inline fun TelegramMediaFile.ifPassportFile(block: (PassportFile) -> T): T? = + passportFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.pathedFileOrNull(): PathedFile? = this as? + dev.inmo.tgbotapi.types.files.PathedFile + +public inline fun TelegramMediaFile.pathedFileOrThrow(): PathedFile = this as + dev.inmo.tgbotapi.types.files.PathedFile + +public inline fun TelegramMediaFile.ifPathedFile(block: (PathedFile) -> T): T? = + pathedFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.photoSizeOrNull(): PhotoSize? = this as? + dev.inmo.tgbotapi.types.files.PhotoSize + +public inline fun TelegramMediaFile.photoSizeOrThrow(): PhotoSize = this as + dev.inmo.tgbotapi.types.files.PhotoSize + +public inline fun TelegramMediaFile.ifPhotoSize(block: (PhotoSize) -> T): T? = photoSizeOrNull() + ?.let(block) + +public inline fun TelegramMediaFile.playableMediaFileOrNull(): PlayableMediaFile? = this as? + dev.inmo.tgbotapi.types.files.PlayableMediaFile + +public inline fun TelegramMediaFile.playableMediaFileOrThrow(): PlayableMediaFile = this as + dev.inmo.tgbotapi.types.files.PlayableMediaFile + +public inline fun TelegramMediaFile.ifPlayableMediaFile(block: (PlayableMediaFile) -> T): T? = + playableMediaFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.sizedMediaFileOrNull(): SizedMediaFile? = this as? + dev.inmo.tgbotapi.types.files.SizedMediaFile + +public inline fun TelegramMediaFile.sizedMediaFileOrThrow(): SizedMediaFile = this as + dev.inmo.tgbotapi.types.files.SizedMediaFile + +public inline fun TelegramMediaFile.ifSizedMediaFile(block: (SizedMediaFile) -> T): T? = + sizedMediaFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.stickerOrNull(): Sticker? = this as? + dev.inmo.tgbotapi.types.files.Sticker + +public inline fun TelegramMediaFile.stickerOrThrow(): Sticker = this as + dev.inmo.tgbotapi.types.files.Sticker + +public inline fun TelegramMediaFile.ifSticker(block: (Sticker) -> T): T? = stickerOrNull() + ?.let(block) + +public inline fun TelegramMediaFile.simpleStickerOrNull(): SimpleSticker? = this as? + dev.inmo.tgbotapi.types.files.SimpleSticker + +public inline fun TelegramMediaFile.simpleStickerOrThrow(): SimpleSticker = this as + dev.inmo.tgbotapi.types.files.SimpleSticker + +public inline fun TelegramMediaFile.ifSimpleSticker(block: (SimpleSticker) -> T): T? = + simpleStickerOrNull() ?.let(block) + +public inline fun TelegramMediaFile.animatedStickerOrNull(): AnimatedSticker? = this as? + dev.inmo.tgbotapi.types.files.AnimatedSticker + +public inline fun TelegramMediaFile.animatedStickerOrThrow(): AnimatedSticker = this as + dev.inmo.tgbotapi.types.files.AnimatedSticker + +public inline fun TelegramMediaFile.ifAnimatedSticker(block: (AnimatedSticker) -> T): T? = + animatedStickerOrNull() ?.let(block) + +public inline fun TelegramMediaFile.videoStickerOrNull(): VideoSticker? = this as? + dev.inmo.tgbotapi.types.files.VideoSticker + +public inline fun TelegramMediaFile.videoStickerOrThrow(): VideoSticker = this as + dev.inmo.tgbotapi.types.files.VideoSticker + +public inline fun TelegramMediaFile.ifVideoSticker(block: (VideoSticker) -> T): T? = + videoStickerOrNull() ?.let(block) + +public inline fun TelegramMediaFile.thumbedMediaFileOrNull(): ThumbedMediaFile? = this as? + dev.inmo.tgbotapi.types.files.ThumbedMediaFile + +public inline fun TelegramMediaFile.thumbedMediaFileOrThrow(): ThumbedMediaFile = this as + dev.inmo.tgbotapi.types.files.ThumbedMediaFile + +public inline fun TelegramMediaFile.ifThumbedMediaFile(block: (ThumbedMediaFile) -> T): T? = + thumbedMediaFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.videoFileOrNull(): VideoFile? = this as? + dev.inmo.tgbotapi.types.files.VideoFile + +public inline fun TelegramMediaFile.videoFileOrThrow(): VideoFile = this as + dev.inmo.tgbotapi.types.files.VideoFile + +public inline fun TelegramMediaFile.ifVideoFile(block: (VideoFile) -> T): T? = videoFileOrNull() + ?.let(block) + +public inline fun TelegramMediaFile.videoNoteFileOrNull(): VideoNoteFile? = this as? + dev.inmo.tgbotapi.types.files.VideoNoteFile + +public inline fun TelegramMediaFile.videoNoteFileOrThrow(): VideoNoteFile = this as + dev.inmo.tgbotapi.types.files.VideoNoteFile + +public inline fun TelegramMediaFile.ifVideoNoteFile(block: (VideoNoteFile) -> T): T? = + videoNoteFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.voiceFileOrNull(): VoiceFile? = this as? + dev.inmo.tgbotapi.types.files.VoiceFile + +public inline fun TelegramMediaFile.voiceFileOrThrow(): VoiceFile = this as + dev.inmo.tgbotapi.types.files.VoiceFile + +public inline fun TelegramMediaFile.ifVoiceFile(block: (VoiceFile) -> T): T? = voiceFileOrNull() + ?.let(block) + +public inline fun Location.staticLocationOrNull(): StaticLocation? = this as? + dev.inmo.tgbotapi.types.location.StaticLocation + +public inline fun Location.staticLocationOrThrow(): StaticLocation = this as + dev.inmo.tgbotapi.types.location.StaticLocation + +public inline fun Location.ifStaticLocation(block: (StaticLocation) -> T): T? = + staticLocationOrNull() ?.let(block) + +public inline fun Location.liveLocationOrNull(): LiveLocation? = this as? + dev.inmo.tgbotapi.types.location.LiveLocation + +public inline fun Location.liveLocationOrThrow(): LiveLocation = this as + dev.inmo.tgbotapi.types.location.LiveLocation + +public inline fun Location.ifLiveLocation(block: (LiveLocation) -> T): T? = liveLocationOrNull() + ?.let(block) + +public inline fun TelegramMedia.duratedTelegramMediaOrNull(): DuratedTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.DuratedTelegramMedia + +public inline fun TelegramMedia.duratedTelegramMediaOrThrow(): DuratedTelegramMedia = this as + dev.inmo.tgbotapi.types.media.DuratedTelegramMedia + +public inline fun TelegramMedia.ifDuratedTelegramMedia(block: (DuratedTelegramMedia) -> T): T? = + duratedTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.mediaGroupMemberTelegramMediaOrNull(): + MediaGroupMemberTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.MediaGroupMemberTelegramMedia + +public inline fun TelegramMedia.mediaGroupMemberTelegramMediaOrThrow(): + MediaGroupMemberTelegramMedia = this as + dev.inmo.tgbotapi.types.media.MediaGroupMemberTelegramMedia + +public inline fun + TelegramMedia.ifMediaGroupMemberTelegramMedia(block: (MediaGroupMemberTelegramMedia) -> T): T? = + mediaGroupMemberTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.audioMediaGroupMemberTelegramMediaOrNull(): + AudioMediaGroupMemberTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.AudioMediaGroupMemberTelegramMedia + +public inline fun TelegramMedia.audioMediaGroupMemberTelegramMediaOrThrow(): + AudioMediaGroupMemberTelegramMedia = this as + dev.inmo.tgbotapi.types.media.AudioMediaGroupMemberTelegramMedia + +public inline fun + TelegramMedia.ifAudioMediaGroupMemberTelegramMedia(block: (AudioMediaGroupMemberTelegramMedia) -> T): + T? = audioMediaGroupMemberTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.documentMediaGroupMemberTelegramMediaOrNull(): + DocumentMediaGroupMemberTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.DocumentMediaGroupMemberTelegramMedia + +public inline fun TelegramMedia.documentMediaGroupMemberTelegramMediaOrThrow(): + DocumentMediaGroupMemberTelegramMedia = this as + dev.inmo.tgbotapi.types.media.DocumentMediaGroupMemberTelegramMedia + +public inline fun + TelegramMedia.ifDocumentMediaGroupMemberTelegramMedia(block: (DocumentMediaGroupMemberTelegramMedia) -> T): + T? = documentMediaGroupMemberTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.visualMediaGroupMemberTelegramMediaOrNull(): + VisualMediaGroupMemberTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.VisualMediaGroupMemberTelegramMedia + +public inline fun TelegramMedia.visualMediaGroupMemberTelegramMediaOrThrow(): + VisualMediaGroupMemberTelegramMedia = this as + dev.inmo.tgbotapi.types.media.VisualMediaGroupMemberTelegramMedia + +public inline fun + TelegramMedia.ifVisualMediaGroupMemberTelegramMedia(block: (VisualMediaGroupMemberTelegramMedia) -> T): + T? = visualMediaGroupMemberTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.sizedTelegramMediaOrNull(): SizedTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.SizedTelegramMedia + +public inline fun TelegramMedia.sizedTelegramMediaOrThrow(): SizedTelegramMedia = this as + dev.inmo.tgbotapi.types.media.SizedTelegramMedia + +public inline fun TelegramMedia.ifSizedTelegramMedia(block: (SizedTelegramMedia) -> T): T? = + sizedTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramMediaAnimationOrNull(): TelegramMediaAnimation? = this as? + dev.inmo.tgbotapi.types.media.TelegramMediaAnimation + +public inline fun TelegramMedia.telegramMediaAnimationOrThrow(): TelegramMediaAnimation = this as + dev.inmo.tgbotapi.types.media.TelegramMediaAnimation + +public inline fun TelegramMedia.ifTelegramMediaAnimation(block: (TelegramMediaAnimation) -> T): + T? = telegramMediaAnimationOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramMediaAudioOrNull(): TelegramMediaAudio? = this as? + dev.inmo.tgbotapi.types.media.TelegramMediaAudio + +public inline fun TelegramMedia.telegramMediaAudioOrThrow(): TelegramMediaAudio = this as + dev.inmo.tgbotapi.types.media.TelegramMediaAudio + +public inline fun TelegramMedia.ifTelegramMediaAudio(block: (TelegramMediaAudio) -> T): T? = + telegramMediaAudioOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramMediaDocumentOrNull(): TelegramMediaDocument? = this as? + dev.inmo.tgbotapi.types.media.TelegramMediaDocument + +public inline fun TelegramMedia.telegramMediaDocumentOrThrow(): TelegramMediaDocument = this as + dev.inmo.tgbotapi.types.media.TelegramMediaDocument + +public inline fun TelegramMedia.ifTelegramMediaDocument(block: (TelegramMediaDocument) -> T): T? + = telegramMediaDocumentOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramMediaPhotoOrNull(): TelegramMediaPhoto? = this as? + dev.inmo.tgbotapi.types.media.TelegramMediaPhoto + +public inline fun TelegramMedia.telegramMediaPhotoOrThrow(): TelegramMediaPhoto = this as + dev.inmo.tgbotapi.types.media.TelegramMediaPhoto + +public inline fun TelegramMedia.ifTelegramMediaPhoto(block: (TelegramMediaPhoto) -> T): T? = + telegramMediaPhotoOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramMediaVideoOrNull(): TelegramMediaVideo? = this as? + dev.inmo.tgbotapi.types.media.TelegramMediaVideo + +public inline fun TelegramMedia.telegramMediaVideoOrThrow(): TelegramMediaVideo = this as + dev.inmo.tgbotapi.types.media.TelegramMediaVideo + +public inline fun TelegramMedia.ifTelegramMediaVideo(block: (TelegramMediaVideo) -> T): T? = + telegramMediaVideoOrNull() ?.let(block) + +public inline fun TelegramMedia.thumbedTelegramMediaOrNull(): ThumbedTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.ThumbedTelegramMedia + +public inline fun TelegramMedia.thumbedTelegramMediaOrThrow(): ThumbedTelegramMedia = this as + dev.inmo.tgbotapi.types.media.ThumbedTelegramMedia + +public inline fun TelegramMedia.ifThumbedTelegramMedia(block: (ThumbedTelegramMedia) -> T): T? = + thumbedTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.titledTelegramMediaOrNull(): TitledTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.TitledTelegramMedia + +public inline fun TelegramMedia.titledTelegramMediaOrThrow(): TitledTelegramMedia = this as + dev.inmo.tgbotapi.types.media.TitledTelegramMedia + +public inline fun TelegramMedia.ifTitledTelegramMedia(block: (TitledTelegramMedia) -> T): T? = + titledTelegramMediaOrNull() ?.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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 ForwardInfo.byAnonymousOrNull(): ForwardInfo.ByAnonymous? = this as? + dev.inmo.tgbotapi.types.message.ForwardInfo.ByAnonymous + +public inline fun ForwardInfo.byAnonymousOrThrow(): ForwardInfo.ByAnonymous = this as + dev.inmo.tgbotapi.types.message.ForwardInfo.ByAnonymous + +public inline fun ForwardInfo.ifByAnonymous(block: (ForwardInfo.ByAnonymous) -> T): T? = + byAnonymousOrNull() ?.let(block) + +public inline fun ForwardInfo.byUserOrNull(): ForwardInfo.ByUser? = this as? + dev.inmo.tgbotapi.types.message.ForwardInfo.ByUser + +public inline fun ForwardInfo.byUserOrThrow(): ForwardInfo.ByUser = this as + dev.inmo.tgbotapi.types.message.ForwardInfo.ByUser + +public inline fun ForwardInfo.ifByUser(block: (ForwardInfo.ByUser) -> T): T? = byUserOrNull() + ?.let(block) + +public inline fun ForwardInfo.publicChatOrNull(): ForwardInfo.PublicChat? = this as? + dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat + +public inline fun ForwardInfo.publicChatOrThrow(): ForwardInfo.PublicChat = this as + dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat + +public inline fun ForwardInfo.ifPublicChat(block: (ForwardInfo.PublicChat) -> T): T? = + publicChatOrNull() ?.let(block) + +public inline fun ForwardInfo.fromChannelOrNull(): ForwardInfo.PublicChat.FromChannel? = this as? + dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.FromChannel + +public inline fun ForwardInfo.fromChannelOrThrow(): ForwardInfo.PublicChat.FromChannel = this as + dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.FromChannel + +public inline fun ForwardInfo.ifFromChannel(block: (ForwardInfo.PublicChat.FromChannel) -> T): + T? = fromChannelOrNull() ?.let(block) + +public inline fun ForwardInfo.fromSupergroupOrNull(): ForwardInfo.PublicChat.FromSupergroup? = this + as? dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.FromSupergroup + +public inline fun ForwardInfo.fromSupergroupOrThrow(): ForwardInfo.PublicChat.FromSupergroup = this + as dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.FromSupergroup + +public inline fun + ForwardInfo.ifFromSupergroup(block: (ForwardInfo.PublicChat.FromSupergroup) -> T): T? = + fromSupergroupOrNull() ?.let(block) + +public inline fun ForwardInfo.sentByChannelOrNull(): ForwardInfo.PublicChat.SentByChannel? = this + as? dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.SentByChannel + +public inline fun ForwardInfo.sentByChannelOrThrow(): ForwardInfo.PublicChat.SentByChannel = this as + dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.SentByChannel + +public inline fun + ForwardInfo.ifSentByChannel(block: (ForwardInfo.PublicChat.SentByChannel) -> T): T? = + sentByChannelOrNull() ?.let(block) + +public inline fun Message.channelContentMessageImplOrNull(): + ChannelContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.ChannelContentMessageImpl + +public inline fun Message.channelContentMessageImplOrThrow(): + ChannelContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.ChannelContentMessageImpl + +public inline fun + Message.ifChannelContentMessageImpl(block: (ChannelContentMessageImpl) -> T): T? + = channelContentMessageImplOrNull() ?.let(block) + +public inline fun Message.channelEventMessageOrNull(): ChannelEventMessage? = this as? + dev.inmo.tgbotapi.types.message.ChannelEventMessage + +public inline fun Message.channelEventMessageOrThrow(): ChannelEventMessage = this as + dev.inmo.tgbotapi.types.message.ChannelEventMessage + +public inline fun + Message.ifChannelEventMessage(block: (ChannelEventMessage) -> T): T? = + channelEventMessageOrNull() ?.let(block) + +public inline fun Message.channelMediaGroupMessageOrNull(): + ChannelMediaGroupMessage? = this as? + dev.inmo.tgbotapi.types.message.ChannelMediaGroupMessage + +public inline fun Message.channelMediaGroupMessageOrThrow(): + ChannelMediaGroupMessage = this as + dev.inmo.tgbotapi.types.message.ChannelMediaGroupMessage + +public inline fun + Message.ifChannelMediaGroupMessage(block: (ChannelMediaGroupMessage) -> T): + T? = channelMediaGroupMessageOrNull() ?.let(block) + +public inline fun Message.commonGroupEventMessageOrNull(): CommonGroupEventMessage? = + this as? + dev.inmo.tgbotapi.types.message.CommonGroupEventMessage + +public inline fun Message.commonGroupEventMessageOrThrow(): CommonGroupEventMessage = + this as + dev.inmo.tgbotapi.types.message.CommonGroupEventMessage + +public inline fun + Message.ifCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T): T? = + commonGroupEventMessageOrNull() ?.let(block) + +public inline fun Message.commonMediaGroupMessageOrNull(): + CommonMediaGroupMessage? = this as? + dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage + +public inline fun Message.commonMediaGroupMessageOrThrow(): + CommonMediaGroupMessage = this as + dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage + +public inline fun + Message.ifCommonMediaGroupMessage(block: (CommonMediaGroupMessage) -> T): T? + = commonMediaGroupMessageOrNull() ?.let(block) + +public inline fun Message.commonSupergroupEventMessageOrNull(): + CommonSupergroupEventMessage? = this as? + dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage + +public inline fun Message.commonSupergroupEventMessageOrThrow(): + CommonSupergroupEventMessage = this as + dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage + +public inline fun + Message.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T): + T? = commonSupergroupEventMessageOrNull() ?.let(block) + +public inline fun Message.connectedFromChannelGroupContentMessageImplOrNull(): + ConnectedFromChannelGroupContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.ConnectedFromChannelGroupContentMessageImpl + +public inline fun Message.connectedFromChannelGroupContentMessageImplOrThrow(): + ConnectedFromChannelGroupContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.ConnectedFromChannelGroupContentMessageImpl + +public inline fun + Message.ifConnectedFromChannelGroupContentMessageImpl(block: (ConnectedFromChannelGroupContentMessageImpl) -> T): + T? = connectedFromChannelGroupContentMessageImplOrNull() ?.let(block) + +public inline fun Message.unconnectedFromChannelGroupContentMessageImplOrNull(): + UnconnectedFromChannelGroupContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.UnconnectedFromChannelGroupContentMessageImpl + +public inline fun Message.unconnectedFromChannelGroupContentMessageImplOrThrow(): + UnconnectedFromChannelGroupContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.UnconnectedFromChannelGroupContentMessageImpl + +public inline fun + Message.ifUnconnectedFromChannelGroupContentMessageImpl(block: (UnconnectedFromChannelGroupContentMessageImpl) -> T): + T? = unconnectedFromChannelGroupContentMessageImplOrNull() ?.let(block) + +public inline fun Message.anonymousGroupContentMessageImplOrNull(): + AnonymousGroupContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.AnonymousGroupContentMessageImpl + +public inline fun Message.anonymousGroupContentMessageImplOrThrow(): + AnonymousGroupContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.AnonymousGroupContentMessageImpl + +public inline fun + Message.ifAnonymousGroupContentMessageImpl(block: (AnonymousGroupContentMessageImpl) -> T): + T? = anonymousGroupContentMessageImplOrNull() ?.let(block) + +public inline fun Message.commonGroupContentMessageImplOrNull(): + CommonGroupContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.CommonGroupContentMessageImpl + +public inline fun Message.commonGroupContentMessageImplOrThrow(): + CommonGroupContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.CommonGroupContentMessageImpl + +public inline fun + Message.ifCommonGroupContentMessageImpl(block: (CommonGroupContentMessageImpl) -> T): + T? = commonGroupContentMessageImplOrNull() ?.let(block) + +public inline fun Message.passportMessageOrNull(): PassportMessage? = this as? + dev.inmo.tgbotapi.types.message.PassportMessage + +public inline fun Message.passportMessageOrThrow(): PassportMessage = this as + dev.inmo.tgbotapi.types.message.PassportMessage + +public inline fun Message.ifPassportMessage(block: (PassportMessage) -> T): T? = + passportMessageOrNull() ?.let(block) + +public inline fun Message.privateContentMessageImplOrNull(): + PrivateContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl + +public inline fun Message.privateContentMessageImplOrThrow(): + PrivateContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl + +public inline fun + Message.ifPrivateContentMessageImpl(block: (PrivateContentMessageImpl) -> T): T? + = privateContentMessageImplOrNull() ?.let(block) + +public inline fun Message.privateEventMessageOrNull(): PrivateEventMessage? = this as? + dev.inmo.tgbotapi.types.message.PrivateEventMessage + +public inline fun Message.privateEventMessageOrThrow(): PrivateEventMessage = this as + dev.inmo.tgbotapi.types.message.PrivateEventMessage + +public inline fun + Message.ifPrivateEventMessage(block: (PrivateEventMessage) -> T): T? = + privateEventMessageOrNull() ?.let(block) + +public inline fun Message.channelContentMessageOrNull(): ChannelContentMessage? = + this as? + dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage + +public inline fun Message.channelContentMessageOrThrow(): ChannelContentMessage = + this as + dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage + +public inline fun + Message.ifChannelContentMessage(block: (ChannelContentMessage) -> T): T? = + channelContentMessageOrNull() ?.let(block) + +public inline fun Message.chatEventMessageOrNull(): ChatEventMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage + +public inline fun Message.chatEventMessageOrThrow(): ChatEventMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage + +public inline fun Message.ifChatEventMessage(block: (ChatEventMessage) -> T): T? = + chatEventMessageOrNull() ?.let(block) + +public inline fun Message.commonMessageOrNull(): CommonMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.CommonMessage + +public inline fun Message.commonMessageOrThrow(): CommonMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.CommonMessage + +public inline fun Message.ifCommonMessage(block: (CommonMessage) -> T): T? = + commonMessageOrNull() ?.let(block) + +public inline fun Message.contentMessageOrNull(): ContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.ContentMessage + +public inline fun Message.contentMessageOrThrow(): ContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.ContentMessage + +public inline fun Message.ifContentMessage(block: (ContentMessage) -> T): T? = + contentMessageOrNull() ?.let(block) + +public inline fun Message.fromUserMessageOrNull(): FromUserMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage + +public inline fun Message.fromUserMessageOrThrow(): FromUserMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage + +public inline fun Message.ifFromUserMessage(block: (FromUserMessage) -> T): T? = + fromUserMessageOrNull() ?.let(block) + +public inline fun Message.groupEventMessageOrNull(): GroupEventMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage + +public inline fun Message.groupEventMessageOrThrow(): GroupEventMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage + +public inline fun Message.ifGroupEventMessage(block: (GroupEventMessage) -> T): T? = + groupEventMessageOrNull() ?.let(block) + +public inline fun Message.groupContentMessageOrNull(): GroupContentMessage? = this + as? + dev.inmo.tgbotapi.types.message.abstracts.GroupContentMessage + +public inline fun Message.groupContentMessageOrThrow(): GroupContentMessage = this + as + dev.inmo.tgbotapi.types.message.abstracts.GroupContentMessage + +public inline fun + Message.ifGroupContentMessage(block: (GroupContentMessage) -> T): T? = + groupContentMessageOrNull() ?.let(block) + +public inline fun Message.fromChannelGroupContentMessageOrNull(): + FromChannelGroupContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.FromChannelGroupContentMessage + +public inline fun Message.fromChannelGroupContentMessageOrThrow(): + FromChannelGroupContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.FromChannelGroupContentMessage + +public inline fun + Message.ifFromChannelGroupContentMessage(block: (FromChannelGroupContentMessage) -> T): + T? = fromChannelGroupContentMessageOrNull() ?.let(block) + +public inline fun Message.connectedFromChannelGroupContentMessageOrNull(): + ConnectedFromChannelGroupContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.ConnectedFromChannelGroupContentMessage + +public inline fun Message.connectedFromChannelGroupContentMessageOrThrow(): + ConnectedFromChannelGroupContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.ConnectedFromChannelGroupContentMessage + +public inline fun + Message.ifConnectedFromChannelGroupContentMessage(block: (ConnectedFromChannelGroupContentMessage) -> T): + T? = connectedFromChannelGroupContentMessageOrNull() ?.let(block) + +public inline fun Message.unconnectedFromChannelGroupContentMessageOrNull(): + UnconnectedFromChannelGroupContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.UnconnectedFromChannelGroupContentMessage + +public inline fun Message.unconnectedFromChannelGroupContentMessageOrThrow(): + UnconnectedFromChannelGroupContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.UnconnectedFromChannelGroupContentMessage + +public inline fun + Message.ifUnconnectedFromChannelGroupContentMessage(block: (UnconnectedFromChannelGroupContentMessage) -> T): + T? = unconnectedFromChannelGroupContentMessageOrNull() ?.let(block) + +public inline fun Message.anonymousGroupContentMessageOrNull(): + AnonymousGroupContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.AnonymousGroupContentMessage + +public inline fun Message.anonymousGroupContentMessageOrThrow(): + AnonymousGroupContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.AnonymousGroupContentMessage + +public inline fun + Message.ifAnonymousGroupContentMessage(block: (AnonymousGroupContentMessage) -> T): + T? = anonymousGroupContentMessageOrNull() ?.let(block) + +public inline fun Message.commonGroupContentMessageOrNull(): + CommonGroupContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage + +public inline fun Message.commonGroupContentMessageOrThrow(): + CommonGroupContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage + +public inline fun + Message.ifCommonGroupContentMessage(block: (CommonGroupContentMessage) -> T): T? + = commonGroupContentMessageOrNull() ?.let(block) + +public inline fun Message.mediaGroupMessageOrNull(): MediaGroupMessage? = this + as? + dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage + +public inline fun Message.mediaGroupMessageOrThrow(): MediaGroupMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage + +public inline fun + Message.ifMediaGroupMessage(block: (MediaGroupMessage) -> T): T? = + mediaGroupMessageOrNull() ?.let(block) + +public inline fun Message.unknownMessageTypeOrNull(): UnknownMessageType? = this as? + dev.inmo.tgbotapi.types.message.abstracts.UnknownMessageType + +public inline fun Message.unknownMessageTypeOrThrow(): UnknownMessageType = this as + dev.inmo.tgbotapi.types.message.abstracts.UnknownMessageType + +public inline fun Message.ifUnknownMessageType(block: (UnknownMessageType) -> T): T? = + unknownMessageTypeOrNull() ?.let(block) + +public inline fun Message.possiblyEditedMessageOrNull(): PossiblyEditedMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.PossiblyEditedMessage + +public inline fun Message.possiblyEditedMessageOrThrow(): PossiblyEditedMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.PossiblyEditedMessage + +public inline fun Message.ifPossiblyEditedMessage(block: (PossiblyEditedMessage) -> T): T? = + possiblyEditedMessageOrNull() ?.let(block) + +public inline fun Message.possiblyForwardedMessageOrNull(): PossiblyForwardedMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage + +public inline fun Message.possiblyForwardedMessageOrThrow(): PossiblyForwardedMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage + +public inline fun Message.ifPossiblyForwardedMessage(block: (PossiblyForwardedMessage) -> T): T? + = possiblyForwardedMessageOrNull() ?.let(block) + +public inline fun Message.possiblyPaymentMessageOrNull(): PossiblyPaymentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage + +public inline fun Message.possiblyPaymentMessageOrThrow(): PossiblyPaymentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage + +public inline fun Message.ifPossiblyPaymentMessage(block: (PossiblyPaymentMessage) -> T): T? = + possiblyPaymentMessageOrNull() ?.let(block) + +public inline fun Message.possiblySentViaBotCommonMessageOrNull(): + PossiblySentViaBotCommonMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage + +public inline fun Message.possiblySentViaBotCommonMessageOrThrow(): + PossiblySentViaBotCommonMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage + +public inline fun + Message.ifPossiblySentViaBotCommonMessage(block: (PossiblySentViaBotCommonMessage) -> T): + T? = possiblySentViaBotCommonMessageOrNull() ?.let(block) + +public inline fun Message.privateContentMessageOrNull(): PrivateContentMessage? = + this as? + dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage + +public inline fun Message.privateContentMessageOrThrow(): PrivateContentMessage = + this as + dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage + +public inline fun + Message.ifPrivateContentMessage(block: (PrivateContentMessage) -> T): T? = + privateContentMessageOrNull() ?.let(block) + +public inline fun Message.publicContentMessageOrNull(): PublicContentMessage? = this + as? + dev.inmo.tgbotapi.types.message.abstracts.PublicContentMessage + +public inline fun Message.publicContentMessageOrThrow(): PublicContentMessage = this + as + dev.inmo.tgbotapi.types.message.abstracts.PublicContentMessage + +public inline fun + Message.ifPublicContentMessage(block: (PublicContentMessage) -> T): T? = + publicContentMessageOrNull() ?.let(block) + +public inline fun Message.signedMessageOrNull(): SignedMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.SignedMessage + +public inline fun Message.signedMessageOrThrow(): SignedMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.SignedMessage + +public inline fun Message.ifSignedMessage(block: (SignedMessage) -> T): T? = + signedMessageOrNull() ?.let(block) + +public inline fun Message.supergroupEventMessageOrNull(): SupergroupEventMessage? = + this as? + dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage + +public inline fun Message.supergroupEventMessageOrThrow(): SupergroupEventMessage = + this as + dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage + +public inline fun + Message.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T): T? = + supergroupEventMessageOrNull() ?.let(block) + +public inline fun ResendableContent.messageContentOrNull(): MessageContent? = this as? + dev.inmo.tgbotapi.types.message.content.MessageContent + +public inline fun ResendableContent.messageContentOrThrow(): MessageContent = this as + dev.inmo.tgbotapi.types.message.content.MessageContent + +public inline fun ResendableContent.ifMessageContent(block: (MessageContent) -> T): T? = + messageContentOrNull() ?.let(block) + +public inline fun ResendableContent.mediaCollectionContentOrNull(): + MediaCollectionContent? = this as? + dev.inmo.tgbotapi.types.message.content.MediaCollectionContent + +public inline fun ResendableContent.mediaCollectionContentOrThrow(): + MediaCollectionContent = this as + dev.inmo.tgbotapi.types.message.content.MediaCollectionContent + +public inline fun + ResendableContent.ifMediaCollectionContent(block: (MediaCollectionContent) -> T): + T? = mediaCollectionContentOrNull() ?.let(block) + +public inline fun ResendableContent.mediaContentOrNull(): MediaContent? = this as? + dev.inmo.tgbotapi.types.message.content.MediaContent + +public inline fun ResendableContent.mediaContentOrThrow(): MediaContent = this as + dev.inmo.tgbotapi.types.message.content.MediaContent + +public inline fun ResendableContent.ifMediaContent(block: (MediaContent) -> T): T? = + mediaContentOrNull() ?.let(block) + +public inline fun ResendableContent.audioMediaGroupContentOrNull(): AudioMediaGroupContent? = this + as? dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent + +public inline fun ResendableContent.audioMediaGroupContentOrThrow(): AudioMediaGroupContent = this + as dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent + +public inline fun + ResendableContent.ifAudioMediaGroupContent(block: (AudioMediaGroupContent) -> T): T? = + audioMediaGroupContentOrNull() ?.let(block) + +public inline fun ResendableContent.documentMediaGroupContentOrNull(): DocumentMediaGroupContent? = + this as? dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent + +public inline fun ResendableContent.documentMediaGroupContentOrThrow(): DocumentMediaGroupContent = + this as dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent + +public inline fun + ResendableContent.ifDocumentMediaGroupContent(block: (DocumentMediaGroupContent) -> T): T? = + documentMediaGroupContentOrNull() ?.let(block) + +public inline fun ResendableContent.mediaGroupContentOrNull(): MediaGroupContent? = this as? + dev.inmo.tgbotapi.types.message.content.MediaGroupContent + +public inline fun ResendableContent.mediaGroupContentOrThrow(): MediaGroupContent = this as + dev.inmo.tgbotapi.types.message.content.MediaGroupContent + +public inline fun ResendableContent.ifMediaGroupContent(block: (MediaGroupContent) -> T): T? = + mediaGroupContentOrNull() ?.let(block) + +public inline fun ResendableContent.textedMediaContentOrNull(): TextedMediaContent? = this as? + dev.inmo.tgbotapi.types.message.content.TextedMediaContent + +public inline fun ResendableContent.textedMediaContentOrThrow(): TextedMediaContent = this as + dev.inmo.tgbotapi.types.message.content.TextedMediaContent + +public inline fun ResendableContent.ifTextedMediaContent(block: (TextedMediaContent) -> T): T? = + textedMediaContentOrNull() ?.let(block) + +public inline fun ResendableContent.visualMediaGroupContentOrNull(): VisualMediaGroupContent? = this + as? dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent + +public inline fun ResendableContent.visualMediaGroupContentOrThrow(): VisualMediaGroupContent = this + as dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent + +public inline fun + ResendableContent.ifVisualMediaGroupContent(block: (VisualMediaGroupContent) -> T): T? = + visualMediaGroupContentOrNull() ?.let(block) + +public inline fun ResendableContent.animationContentOrNull(): AnimationContent? = this as? + dev.inmo.tgbotapi.types.message.content.AnimationContent + +public inline fun ResendableContent.animationContentOrThrow(): AnimationContent = this as + dev.inmo.tgbotapi.types.message.content.AnimationContent + +public inline fun ResendableContent.ifAnimationContent(block: (AnimationContent) -> T): T? = + animationContentOrNull() ?.let(block) + +public inline fun ResendableContent.audioContentOrNull(): AudioContent? = this as? + dev.inmo.tgbotapi.types.message.content.AudioContent + +public inline fun ResendableContent.audioContentOrThrow(): AudioContent = this as + dev.inmo.tgbotapi.types.message.content.AudioContent + +public inline fun ResendableContent.ifAudioContent(block: (AudioContent) -> T): T? = + audioContentOrNull() ?.let(block) + +public inline fun ResendableContent.contactContentOrNull(): ContactContent? = this as? + dev.inmo.tgbotapi.types.message.content.ContactContent + +public inline fun ResendableContent.contactContentOrThrow(): ContactContent = this as + dev.inmo.tgbotapi.types.message.content.ContactContent + +public inline fun ResendableContent.ifContactContent(block: (ContactContent) -> T): T? = + contactContentOrNull() ?.let(block) + +public inline fun ResendableContent.diceContentOrNull(): DiceContent? = this as? + dev.inmo.tgbotapi.types.message.content.DiceContent + +public inline fun ResendableContent.diceContentOrThrow(): DiceContent = this as + dev.inmo.tgbotapi.types.message.content.DiceContent + +public inline fun ResendableContent.ifDiceContent(block: (DiceContent) -> T): T? = + diceContentOrNull() ?.let(block) + +public inline fun ResendableContent.documentContentOrNull(): DocumentContent? = this as? + dev.inmo.tgbotapi.types.message.content.DocumentContent + +public inline fun ResendableContent.documentContentOrThrow(): DocumentContent = this as + dev.inmo.tgbotapi.types.message.content.DocumentContent + +public inline fun ResendableContent.ifDocumentContent(block: (DocumentContent) -> T): T? = + documentContentOrNull() ?.let(block) + +public inline fun ResendableContent.gameContentOrNull(): GameContent? = this as? + dev.inmo.tgbotapi.types.message.content.GameContent + +public inline fun ResendableContent.gameContentOrThrow(): GameContent = this as + dev.inmo.tgbotapi.types.message.content.GameContent + +public inline fun ResendableContent.ifGameContent(block: (GameContent) -> T): T? = + gameContentOrNull() ?.let(block) + +public inline fun ResendableContent.invoiceContentOrNull(): InvoiceContent? = this as? + dev.inmo.tgbotapi.types.message.content.InvoiceContent + +public inline fun ResendableContent.invoiceContentOrThrow(): InvoiceContent = this as + dev.inmo.tgbotapi.types.message.content.InvoiceContent + +public inline fun ResendableContent.ifInvoiceContent(block: (InvoiceContent) -> T): T? = + invoiceContentOrNull() ?.let(block) + +public inline fun ResendableContent.locationContentOrNull(): LocationContent? = this as? + dev.inmo.tgbotapi.types.message.content.LocationContent + +public inline fun ResendableContent.locationContentOrThrow(): LocationContent = this as + dev.inmo.tgbotapi.types.message.content.LocationContent + +public inline fun ResendableContent.ifLocationContent(block: (LocationContent) -> T): T? = + locationContentOrNull() ?.let(block) + +public inline fun ResendableContent.liveLocationContentOrNull(): LiveLocationContent? = this as? + dev.inmo.tgbotapi.types.message.content.LiveLocationContent + +public inline fun ResendableContent.liveLocationContentOrThrow(): LiveLocationContent = this as + dev.inmo.tgbotapi.types.message.content.LiveLocationContent + +public inline fun ResendableContent.ifLiveLocationContent(block: (LiveLocationContent) -> T): T? + = liveLocationContentOrNull() ?.let(block) + +public inline fun ResendableContent.staticLocationContentOrNull(): StaticLocationContent? = this as? + dev.inmo.tgbotapi.types.message.content.StaticLocationContent + +public inline fun ResendableContent.staticLocationContentOrThrow(): StaticLocationContent = this as + dev.inmo.tgbotapi.types.message.content.StaticLocationContent + +public inline fun + ResendableContent.ifStaticLocationContent(block: (StaticLocationContent) -> T): T? = + staticLocationContentOrNull() ?.let(block) + +public inline fun ResendableContent.photoContentOrNull(): PhotoContent? = this as? + dev.inmo.tgbotapi.types.message.content.PhotoContent + +public inline fun ResendableContent.photoContentOrThrow(): PhotoContent = this as + dev.inmo.tgbotapi.types.message.content.PhotoContent + +public inline fun ResendableContent.ifPhotoContent(block: (PhotoContent) -> T): T? = + photoContentOrNull() ?.let(block) + +public inline fun ResendableContent.pollContentOrNull(): PollContent? = this as? + dev.inmo.tgbotapi.types.message.content.PollContent + +public inline fun ResendableContent.pollContentOrThrow(): PollContent = this as + dev.inmo.tgbotapi.types.message.content.PollContent + +public inline fun ResendableContent.ifPollContent(block: (PollContent) -> T): T? = + pollContentOrNull() ?.let(block) + +public inline fun ResendableContent.stickerContentOrNull(): StickerContent? = this as? + dev.inmo.tgbotapi.types.message.content.StickerContent + +public inline fun ResendableContent.stickerContentOrThrow(): StickerContent = this as + dev.inmo.tgbotapi.types.message.content.StickerContent + +public inline fun ResendableContent.ifStickerContent(block: (StickerContent) -> T): T? = + stickerContentOrNull() ?.let(block) + +public inline fun ResendableContent.textContentOrNull(): TextContent? = this as? + dev.inmo.tgbotapi.types.message.content.TextContent + +public inline fun ResendableContent.textContentOrThrow(): TextContent = this as + dev.inmo.tgbotapi.types.message.content.TextContent + +public inline fun ResendableContent.ifTextContent(block: (TextContent) -> T): T? = + textContentOrNull() ?.let(block) + +public inline fun ResendableContent.venueContentOrNull(): VenueContent? = this as? + dev.inmo.tgbotapi.types.message.content.VenueContent + +public inline fun ResendableContent.venueContentOrThrow(): VenueContent = this as + dev.inmo.tgbotapi.types.message.content.VenueContent + +public inline fun ResendableContent.ifVenueContent(block: (VenueContent) -> T): T? = + venueContentOrNull() ?.let(block) + +public inline fun ResendableContent.videoContentOrNull(): VideoContent? = this as? + dev.inmo.tgbotapi.types.message.content.VideoContent + +public inline fun ResendableContent.videoContentOrThrow(): VideoContent = this as + dev.inmo.tgbotapi.types.message.content.VideoContent + +public inline fun ResendableContent.ifVideoContent(block: (VideoContent) -> T): T? = + videoContentOrNull() ?.let(block) + +public inline fun ResendableContent.videoNoteContentOrNull(): VideoNoteContent? = this as? + dev.inmo.tgbotapi.types.message.content.VideoNoteContent + +public inline fun ResendableContent.videoNoteContentOrThrow(): VideoNoteContent = this as + dev.inmo.tgbotapi.types.message.content.VideoNoteContent + +public inline fun ResendableContent.ifVideoNoteContent(block: (VideoNoteContent) -> T): T? = + videoNoteContentOrNull() ?.let(block) + +public inline fun ResendableContent.voiceContentOrNull(): VoiceContent? = this as? + dev.inmo.tgbotapi.types.message.content.VoiceContent + +public inline fun ResendableContent.voiceContentOrThrow(): VoiceContent = this as + dev.inmo.tgbotapi.types.message.content.VoiceContent + +public inline fun ResendableContent.ifVoiceContent(block: (VoiceContent) -> T): T? = + voiceContentOrNull() ?.let(block) + +public inline fun TextSource.boldTextSourceOrNull(): BoldTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.BoldTextSource + +public inline fun TextSource.boldTextSourceOrThrow(): BoldTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.BoldTextSource + +public inline fun TextSource.ifBoldTextSource(block: (BoldTextSource) -> T): T? = + boldTextSourceOrNull() ?.let(block) + +public inline fun TextSource.botCommandTextSourceOrNull(): BotCommandTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource + +public inline fun TextSource.botCommandTextSourceOrThrow(): BotCommandTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource + +public inline fun TextSource.ifBotCommandTextSource(block: (BotCommandTextSource) -> T): T? = + botCommandTextSourceOrNull() ?.let(block) + +public inline fun TextSource.cashTagTextSourceOrNull(): CashTagTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.CashTagTextSource + +public inline fun TextSource.cashTagTextSourceOrThrow(): CashTagTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.CashTagTextSource + +public inline fun TextSource.ifCashTagTextSource(block: (CashTagTextSource) -> T): T? = + cashTagTextSourceOrNull() ?.let(block) + +public inline fun TextSource.codeTextSourceOrNull(): CodeTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.CodeTextSource + +public inline fun TextSource.codeTextSourceOrThrow(): CodeTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.CodeTextSource + +public inline fun TextSource.ifCodeTextSource(block: (CodeTextSource) -> T): T? = + codeTextSourceOrNull() ?.let(block) + +public inline fun TextSource.eMailTextSourceOrNull(): EMailTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.EMailTextSource + +public inline fun TextSource.eMailTextSourceOrThrow(): EMailTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.EMailTextSource + +public inline fun TextSource.ifEMailTextSource(block: (EMailTextSource) -> T): T? = + eMailTextSourceOrNull() ?.let(block) + +public inline fun TextSource.hashTagTextSourceOrNull(): HashTagTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource + +public inline fun TextSource.hashTagTextSourceOrThrow(): HashTagTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource + +public inline fun TextSource.ifHashTagTextSource(block: (HashTagTextSource) -> T): T? = + hashTagTextSourceOrNull() ?.let(block) + +public inline fun TextSource.italicTextSourceOrNull(): ItalicTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.ItalicTextSource + +public inline fun TextSource.italicTextSourceOrThrow(): ItalicTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.ItalicTextSource + +public inline fun TextSource.ifItalicTextSource(block: (ItalicTextSource) -> T): T? = + italicTextSourceOrNull() ?.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 + +public inline fun TextSource.ifMentionTextSource(block: (MentionTextSource) -> T): T? = + mentionTextSourceOrNull() ?.let(block) + +public inline fun TextSource.phoneNumberTextSourceOrNull(): PhoneNumberTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.PhoneNumberTextSource + +public inline fun TextSource.phoneNumberTextSourceOrThrow(): PhoneNumberTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.PhoneNumberTextSource + +public inline fun TextSource.ifPhoneNumberTextSource(block: (PhoneNumberTextSource) -> T): T? = + phoneNumberTextSourceOrNull() ?.let(block) + +public inline fun TextSource.preTextSourceOrNull(): PreTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.PreTextSource + +public inline fun TextSource.preTextSourceOrThrow(): PreTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.PreTextSource + +public inline fun TextSource.ifPreTextSource(block: (PreTextSource) -> T): T? = + preTextSourceOrNull() ?.let(block) + +public inline fun TextSource.regularTextSourceOrNull(): RegularTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.RegularTextSource + +public inline fun TextSource.regularTextSourceOrThrow(): RegularTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.RegularTextSource + +public inline fun TextSource.ifRegularTextSource(block: (RegularTextSource) -> T): T? = + regularTextSourceOrNull() ?.let(block) + +public inline fun TextSource.spoilerTextSourceOrNull(): SpoilerTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.SpoilerTextSource + +public inline fun TextSource.spoilerTextSourceOrThrow(): SpoilerTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.SpoilerTextSource + +public inline fun TextSource.ifSpoilerTextSource(block: (SpoilerTextSource) -> T): T? = + spoilerTextSourceOrNull() ?.let(block) + +public inline fun TextSource.strikethroughTextSourceOrNull(): StrikethroughTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.StrikethroughTextSource + +public inline fun TextSource.strikethroughTextSourceOrThrow(): StrikethroughTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.StrikethroughTextSource + +public inline fun TextSource.ifStrikethroughTextSource(block: (StrikethroughTextSource) -> T): + T? = strikethroughTextSourceOrNull() ?.let(block) + +public inline fun TextSource.textLinkTextSourceOrNull(): TextLinkTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.TextLinkTextSource + +public inline fun TextSource.textLinkTextSourceOrThrow(): TextLinkTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.TextLinkTextSource + +public inline fun TextSource.ifTextLinkTextSource(block: (TextLinkTextSource) -> T): T? = + textLinkTextSourceOrNull() ?.let(block) + +public inline fun TextSource.textMentionTextSourceOrNull(): TextMentionTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.TextMentionTextSource + +public inline fun TextSource.textMentionTextSourceOrThrow(): TextMentionTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.TextMentionTextSource + +public inline fun TextSource.ifTextMentionTextSource(block: (TextMentionTextSource) -> T): T? = + textMentionTextSourceOrNull() ?.let(block) + +public inline fun TextSource.multilevelTextSourceOrNull(): MultilevelTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.MultilevelTextSource + +public inline fun TextSource.multilevelTextSourceOrThrow(): MultilevelTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.MultilevelTextSource + +public inline fun TextSource.ifMultilevelTextSource(block: (MultilevelTextSource) -> T): T? = + multilevelTextSourceOrNull() ?.let(block) + +public inline fun TextSource.uRLTextSourceOrNull(): URLTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.URLTextSource + +public inline fun TextSource.uRLTextSourceOrThrow(): URLTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.URLTextSource + +public inline fun TextSource.ifURLTextSource(block: (URLTextSource) -> T): T? = + uRLTextSourceOrNull() ?.let(block) + +public inline fun TextSource.underlineTextSourceOrNull(): UnderlineTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.UnderlineTextSource + +public inline fun TextSource.underlineTextSourceOrThrow(): UnderlineTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.UnderlineTextSource + +public inline fun TextSource.ifUnderlineTextSource(block: (UnderlineTextSource) -> T): T? = + underlineTextSourceOrNull() ?.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 + +public inline fun + PassportElementError.ifUnknownPassportElementError(block: (UnknownPassportElementError) -> T): + T? = unknownPassportElementErrorOrNull() ?.let(block) + +public inline fun PassportElementError.passportSingleElementErrorOrNull(): + PassportSingleElementError? = this as? + dev.inmo.tgbotapi.types.passport.PassportSingleElementError + +public inline fun PassportElementError.passportSingleElementErrorOrThrow(): + PassportSingleElementError = this as dev.inmo.tgbotapi.types.passport.PassportSingleElementError + +public inline fun + PassportElementError.ifPassportSingleElementError(block: (PassportSingleElementError) -> T): T? + = passportSingleElementErrorOrNull() ?.let(block) + +public inline fun PassportElementError.passportMultipleElementsErrorOrNull(): + PassportMultipleElementsError? = this as? + dev.inmo.tgbotapi.types.passport.PassportMultipleElementsError + +public inline fun PassportElementError.passportMultipleElementsErrorOrThrow(): + PassportMultipleElementsError = this as + dev.inmo.tgbotapi.types.passport.PassportMultipleElementsError + +public inline fun + PassportElementError.ifPassportMultipleElementsError(block: (PassportMultipleElementsError) -> T): + T? = passportMultipleElementsErrorOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementFileErrorOrNull(): PassportElementFileError? = + this as? dev.inmo.tgbotapi.types.passport.PassportElementFileError + +public inline fun PassportElementError.passportElementFileErrorOrThrow(): PassportElementFileError = + this as dev.inmo.tgbotapi.types.passport.PassportElementFileError + +public inline fun + PassportElementError.ifPassportElementFileError(block: (PassportElementFileError) -> T): T? = + passportElementFileErrorOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementFilesErrorOrNull(): PassportElementFilesError? + = this as? dev.inmo.tgbotapi.types.passport.PassportElementFilesError + +public inline fun PassportElementError.passportElementFilesErrorOrThrow(): PassportElementFilesError + = this as dev.inmo.tgbotapi.types.passport.PassportElementFilesError + +public inline fun + PassportElementError.ifPassportElementFilesError(block: (PassportElementFilesError) -> T): T? = + passportElementFilesErrorOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorDataFieldOrNull(): + PassportElementErrorDataField? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorDataField + +public inline fun PassportElementError.passportElementErrorDataFieldOrThrow(): + PassportElementErrorDataField = this as + dev.inmo.tgbotapi.types.passport.PassportElementErrorDataField + +public inline fun + PassportElementError.ifPassportElementErrorDataField(block: (PassportElementErrorDataField) -> T): + T? = passportElementErrorDataFieldOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorFrontSideOrNull(): + PassportElementErrorFrontSide? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorFrontSide + +public inline fun PassportElementError.passportElementErrorFrontSideOrThrow(): + PassportElementErrorFrontSide = this as + dev.inmo.tgbotapi.types.passport.PassportElementErrorFrontSide + +public inline fun + PassportElementError.ifPassportElementErrorFrontSide(block: (PassportElementErrorFrontSide) -> T): + T? = passportElementErrorFrontSideOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorReverseSideOrNull(): + PassportElementErrorReverseSide? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorReverseSide + +public inline fun PassportElementError.passportElementErrorReverseSideOrThrow(): + PassportElementErrorReverseSide = this as + dev.inmo.tgbotapi.types.passport.PassportElementErrorReverseSide + +public inline fun + PassportElementError.ifPassportElementErrorReverseSide(block: (PassportElementErrorReverseSide) -> T): + T? = passportElementErrorReverseSideOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorSelfieOrNull(): + PassportElementErrorSelfie? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorSelfie + +public inline fun PassportElementError.passportElementErrorSelfieOrThrow(): + PassportElementErrorSelfie = this as dev.inmo.tgbotapi.types.passport.PassportElementErrorSelfie + +public inline fun + PassportElementError.ifPassportElementErrorSelfie(block: (PassportElementErrorSelfie) -> T): T? + = passportElementErrorSelfieOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorFileOrNull(): PassportElementErrorFile? = + this as? dev.inmo.tgbotapi.types.passport.PassportElementErrorFile + +public inline fun PassportElementError.passportElementErrorFileOrThrow(): PassportElementErrorFile = + this as dev.inmo.tgbotapi.types.passport.PassportElementErrorFile + +public inline fun + PassportElementError.ifPassportElementErrorFile(block: (PassportElementErrorFile) -> T): T? = + passportElementErrorFileOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorFilesOrNull(): PassportElementErrorFiles? + = this as? dev.inmo.tgbotapi.types.passport.PassportElementErrorFiles + +public inline fun PassportElementError.passportElementErrorFilesOrThrow(): PassportElementErrorFiles + = this as dev.inmo.tgbotapi.types.passport.PassportElementErrorFiles + +public inline fun + PassportElementError.ifPassportElementErrorFiles(block: (PassportElementErrorFiles) -> T): T? = + passportElementErrorFilesOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorTranslationFileOrNull(): + PassportElementErrorTranslationFile? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFile + +public inline fun PassportElementError.passportElementErrorTranslationFileOrThrow(): + PassportElementErrorTranslationFile = this as + dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFile + +public inline fun + PassportElementError.ifPassportElementErrorTranslationFile(block: (PassportElementErrorTranslationFile) -> T): + T? = passportElementErrorTranslationFileOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorTranslationFilesOrNull(): + PassportElementErrorTranslationFiles? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFiles + +public inline fun PassportElementError.passportElementErrorTranslationFilesOrThrow(): + PassportElementErrorTranslationFiles = this as + dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFiles + +public inline fun + PassportElementError.ifPassportElementErrorTranslationFiles(block: (PassportElementErrorTranslationFiles) -> T): + T? = passportElementErrorTranslationFilesOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorUnspecifiedOrNull(): + PassportElementErrorUnspecified? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorUnspecified + +public inline fun PassportElementError.passportElementErrorUnspecifiedOrThrow(): + PassportElementErrorUnspecified = this as + dev.inmo.tgbotapi.types.passport.PassportElementErrorUnspecified + +public inline fun + PassportElementError.ifPassportElementErrorUnspecified(block: (PassportElementErrorUnspecified) -> T): + T? = passportElementErrorUnspecifiedOrNull() ?.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 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.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.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.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.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.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.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.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 EncryptedPassportElement.emailOrNull(): Email? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.Email + +public inline fun EncryptedPassportElement.emailOrThrow(): Email = this as + dev.inmo.tgbotapi.types.passport.encrypted.Email + +public inline fun EncryptedPassportElement.ifEmail(block: (Email) -> T): T? = emailOrNull() + ?.let(block) + +public inline fun EncryptedPassportElement.encryptedAddressOrNull(): EncryptedAddress? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedAddress + +public inline fun EncryptedPassportElement.encryptedAddressOrThrow(): EncryptedAddress = this as + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedAddress + +public inline fun EncryptedPassportElement.ifEncryptedAddress(block: (EncryptedAddress) -> T): + T? = encryptedAddressOrNull() ?.let(block) + +public inline + fun EncryptedPassportElement.encryptedPassportElementWithTranslatableFilesCollectionOrNull(): + EncryptedPassportElementWithTranslatableFilesCollection? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableFilesCollection + +public inline + fun EncryptedPassportElement.encryptedPassportElementWithTranslatableFilesCollectionOrThrow(): + EncryptedPassportElementWithTranslatableFilesCollection = this as + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableFilesCollection + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithTranslatableFilesCollection(block: (EncryptedPassportElementWithTranslatableFilesCollection) -> T): + T? = encryptedPassportElementWithTranslatableFilesCollectionOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.utilityBillOrNull(): UtilityBill? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.UtilityBill + +public inline fun EncryptedPassportElement.utilityBillOrThrow(): UtilityBill = this as + dev.inmo.tgbotapi.types.passport.encrypted.UtilityBill + +public inline fun EncryptedPassportElement.ifUtilityBill(block: (UtilityBill) -> T): T? = + utilityBillOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.bankStatementOrNull(): BankStatement? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.BankStatement + +public inline fun EncryptedPassportElement.bankStatementOrThrow(): BankStatement = this as + dev.inmo.tgbotapi.types.passport.encrypted.BankStatement + +public inline fun EncryptedPassportElement.ifBankStatement(block: (BankStatement) -> T): T? = + bankStatementOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.rentalAgreementOrNull(): RentalAgreement? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.RentalAgreement + +public inline fun EncryptedPassportElement.rentalAgreementOrThrow(): RentalAgreement = this as + dev.inmo.tgbotapi.types.passport.encrypted.RentalAgreement + +public inline fun EncryptedPassportElement.ifRentalAgreement(block: (RentalAgreement) -> T): T? + = rentalAgreementOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.passportRegistrationOrNull(): PassportRegistration? = + this as? dev.inmo.tgbotapi.types.passport.encrypted.PassportRegistration + +public inline fun EncryptedPassportElement.passportRegistrationOrThrow(): PassportRegistration = + this as dev.inmo.tgbotapi.types.passport.encrypted.PassportRegistration + +public inline fun + EncryptedPassportElement.ifPassportRegistration(block: (PassportRegistration) -> T): T? = + passportRegistrationOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.temporaryRegistrationOrNull(): TemporaryRegistration? = + this as? dev.inmo.tgbotapi.types.passport.encrypted.TemporaryRegistration + +public inline fun EncryptedPassportElement.temporaryRegistrationOrThrow(): TemporaryRegistration = + this as dev.inmo.tgbotapi.types.passport.encrypted.TemporaryRegistration + +public inline fun + EncryptedPassportElement.ifTemporaryRegistration(block: (TemporaryRegistration) -> T): T? = + temporaryRegistrationOrNull() ?.let(block) + +public inline + fun EncryptedPassportElement.encryptedPassportElementWithTranslatableIDDocumentOrNull(): + EncryptedPassportElementWithTranslatableIDDocument? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableIDDocument + +public inline + fun EncryptedPassportElement.encryptedPassportElementWithTranslatableIDDocumentOrThrow(): + EncryptedPassportElementWithTranslatableIDDocument = this as + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableIDDocument + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithTranslatableIDDocument(block: (EncryptedPassportElementWithTranslatableIDDocument) -> T): + T? = encryptedPassportElementWithTranslatableIDDocumentOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.driverLicenseOrNull(): DriverLicense? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.DriverLicense + +public inline fun EncryptedPassportElement.driverLicenseOrThrow(): DriverLicense = this as + dev.inmo.tgbotapi.types.passport.encrypted.DriverLicense + +public inline fun EncryptedPassportElement.ifDriverLicense(block: (DriverLicense) -> T): T? = + driverLicenseOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.identityCardOrNull(): IdentityCard? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.IdentityCard + +public inline fun EncryptedPassportElement.identityCardOrThrow(): IdentityCard = this as + dev.inmo.tgbotapi.types.passport.encrypted.IdentityCard + +public inline fun EncryptedPassportElement.ifIdentityCard(block: (IdentityCard) -> T): T? = + identityCardOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPersonalDetailsOrNull(): + EncryptedPersonalDetails? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPersonalDetails + +public inline fun EncryptedPassportElement.encryptedPersonalDetailsOrThrow(): + EncryptedPersonalDetails = this as + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPersonalDetails + +public inline fun + EncryptedPassportElement.ifEncryptedPersonalDetails(block: (EncryptedPersonalDetails) -> T): T? + = encryptedPersonalDetailsOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.passportOrNull(): Passport? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.Passport + +public inline fun EncryptedPassportElement.passportOrThrow(): Passport = this as + dev.inmo.tgbotapi.types.passport.encrypted.Passport + +public inline fun EncryptedPassportElement.ifPassport(block: (Passport) -> T): T? = + passportOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.commonPassportOrNull(): CommonPassport? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.CommonPassport + +public inline fun EncryptedPassportElement.commonPassportOrThrow(): CommonPassport = this as + dev.inmo.tgbotapi.types.passport.encrypted.CommonPassport + +public inline fun EncryptedPassportElement.ifCommonPassport(block: (CommonPassport) -> T): T? = + commonPassportOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.internalPassportOrNull(): InternalPassport? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.InternalPassport + +public inline fun EncryptedPassportElement.internalPassportOrThrow(): InternalPassport = this as + dev.inmo.tgbotapi.types.passport.encrypted.InternalPassport + +public inline fun EncryptedPassportElement.ifInternalPassport(block: (InternalPassport) -> T): + T? = internalPassportOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.phoneNumberOrNull(): PhoneNumber? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.PhoneNumber + +public inline fun EncryptedPassportElement.phoneNumberOrThrow(): PhoneNumber = this as + dev.inmo.tgbotapi.types.passport.encrypted.PhoneNumber + +public inline fun EncryptedPassportElement.ifPhoneNumber(block: (PhoneNumber) -> T): T? = + phoneNumberOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.unknownEncryptedPassportElementOrNull(): + UnknownEncryptedPassportElement? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.UnknownEncryptedPassportElement + +public inline fun EncryptedPassportElement.unknownEncryptedPassportElementOrThrow(): + UnknownEncryptedPassportElement = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.UnknownEncryptedPassportElement + +public inline fun + EncryptedPassportElement.ifUnknownEncryptedPassportElement(block: (UnknownEncryptedPassportElement) -> T): + T? = unknownEncryptedPassportElementOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementTranslatableOrNull(): + EncryptedPassportElementTranslatable? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementTranslatable + +public inline fun EncryptedPassportElement.encryptedPassportElementTranslatableOrThrow(): + EncryptedPassportElementTranslatable = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementTranslatable + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementTranslatable(block: (EncryptedPassportElementTranslatable) -> T): + T? = encryptedPassportElementTranslatableOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithDataOrNull(): + EncryptedPassportElementWithData? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithData + +public inline fun EncryptedPassportElement.encryptedPassportElementWithDataOrThrow(): + EncryptedPassportElementWithData = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithData + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithData(block: (EncryptedPassportElementWithData) -> T): + T? = encryptedPassportElementWithDataOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithEmailOrNull(): + EncryptedPassportElementWithEmail? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithEmail + +public inline fun EncryptedPassportElement.encryptedPassportElementWithEmailOrThrow(): + EncryptedPassportElementWithEmail = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithEmail + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithEmail(block: (EncryptedPassportElementWithEmail) -> T): + T? = encryptedPassportElementWithEmailOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithFilesCollectionOrNull(): + EncryptedPassportElementWithFilesCollection? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFilesCollection + +public inline fun EncryptedPassportElement.encryptedPassportElementWithFilesCollectionOrThrow(): + EncryptedPassportElementWithFilesCollection = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFilesCollection + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithFilesCollection(block: (EncryptedPassportElementWithFilesCollection) -> T): + T? = encryptedPassportElementWithFilesCollectionOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithFrontSideOrNull(): + EncryptedPassportElementWithFrontSide? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFrontSide + +public inline fun EncryptedPassportElement.encryptedPassportElementWithFrontSideOrThrow(): + EncryptedPassportElementWithFrontSide = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFrontSide + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithFrontSide(block: (EncryptedPassportElementWithFrontSide) -> T): + T? = encryptedPassportElementWithFrontSideOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithPhoneNumberOrNull(): + EncryptedPassportElementWithPhoneNumber? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithPhoneNumber + +public inline fun EncryptedPassportElement.encryptedPassportElementWithPhoneNumberOrThrow(): + EncryptedPassportElementWithPhoneNumber = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithPhoneNumber + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithPhoneNumber(block: (EncryptedPassportElementWithPhoneNumber) -> T): + T? = encryptedPassportElementWithPhoneNumberOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithReverseSideOrNull(): + EncryptedPassportElementWithReverseSide? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithReverseSide + +public inline fun EncryptedPassportElement.encryptedPassportElementWithReverseSideOrThrow(): + EncryptedPassportElementWithReverseSide = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithReverseSide + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithReverseSide(block: (EncryptedPassportElementWithReverseSide) -> T): + T? = encryptedPassportElementWithReverseSideOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithSelfieOrNull(): + EncryptedPassportElementWithSelfie? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithSelfie + +public inline fun EncryptedPassportElement.encryptedPassportElementWithSelfieOrThrow(): + EncryptedPassportElementWithSelfie = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithSelfie + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithSelfie(block: (EncryptedPassportElementWithSelfie) -> T): + T? = encryptedPassportElementWithSelfieOrNull() ?.let(block) + +public inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrNull(): ExactScheduledCloseInfo? = + this as? dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo + +public inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrThrow(): ExactScheduledCloseInfo = + this as dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo + +public inline fun + ScheduledCloseInfo.ifExactScheduledCloseInfo(block: (ExactScheduledCloseInfo) -> T): T? = + exactScheduledCloseInfoOrNull() ?.let(block) + +public inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrNull(): + ApproximateScheduledCloseInfo? = this as? + dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo + +public inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrThrow(): + ApproximateScheduledCloseInfo = this as + dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo + +public inline fun + ScheduledCloseInfo.ifApproximateScheduledCloseInfo(block: (ApproximateScheduledCloseInfo) -> T): + T? = approximateScheduledCloseInfoOrNull() ?.let(block) + +public inline fun Poll.multipleAnswersPollOrNull(): MultipleAnswersPoll? = this as? + dev.inmo.tgbotapi.types.polls.MultipleAnswersPoll + +public inline fun Poll.multipleAnswersPollOrThrow(): MultipleAnswersPoll = this as + dev.inmo.tgbotapi.types.polls.MultipleAnswersPoll + +public inline fun Poll.ifMultipleAnswersPoll(block: (MultipleAnswersPoll) -> T): T? = + multipleAnswersPollOrNull() ?.let(block) + +public inline fun Poll.unknownPollTypeOrNull(): UnknownPollType? = this as? + dev.inmo.tgbotapi.types.polls.UnknownPollType + +public inline fun Poll.unknownPollTypeOrThrow(): UnknownPollType = this as + dev.inmo.tgbotapi.types.polls.UnknownPollType + +public inline fun Poll.ifUnknownPollType(block: (UnknownPollType) -> T): T? = + unknownPollTypeOrNull() ?.let(block) + +public inline fun Poll.regularPollOrNull(): RegularPoll? = this as? + dev.inmo.tgbotapi.types.polls.RegularPoll + +public inline fun Poll.regularPollOrThrow(): RegularPoll = this as + dev.inmo.tgbotapi.types.polls.RegularPoll + +public inline fun Poll.ifRegularPoll(block: (RegularPoll) -> T): T? = regularPollOrNull() + ?.let(block) + +public inline fun Poll.quizPollOrNull(): QuizPoll? = this as? dev.inmo.tgbotapi.types.polls.QuizPoll + +public inline fun Poll.quizPollOrThrow(): QuizPoll = this as dev.inmo.tgbotapi.types.polls.QuizPoll + +public inline fun Poll.ifQuizPoll(block: (QuizPoll) -> T): T? = quizPollOrNull() ?.let(block) + +public inline fun Update.callbackQueryUpdateOrNull(): CallbackQueryUpdate? = this as? + dev.inmo.tgbotapi.types.update.CallbackQueryUpdate + +public inline fun Update.callbackQueryUpdateOrThrow(): CallbackQueryUpdate = this as + dev.inmo.tgbotapi.types.update.CallbackQueryUpdate + +public inline fun Update.ifCallbackQueryUpdate(block: (CallbackQueryUpdate) -> T): T? = + callbackQueryUpdateOrNull() ?.let(block) + +public inline fun Update.channelPostUpdateOrNull(): ChannelPostUpdate? = this as? + dev.inmo.tgbotapi.types.update.ChannelPostUpdate + +public inline fun Update.channelPostUpdateOrThrow(): ChannelPostUpdate = this as + dev.inmo.tgbotapi.types.update.ChannelPostUpdate + +public inline fun Update.ifChannelPostUpdate(block: (ChannelPostUpdate) -> T): T? = + channelPostUpdateOrNull() ?.let(block) + +public inline fun Update.chatJoinRequestUpdateOrNull(): ChatJoinRequestUpdate? = this as? + dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate + +public inline fun Update.chatJoinRequestUpdateOrThrow(): ChatJoinRequestUpdate = this as + dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate + +public inline fun Update.ifChatJoinRequestUpdate(block: (ChatJoinRequestUpdate) -> T): T? = + chatJoinRequestUpdateOrNull() ?.let(block) + +public inline fun Update.chosenInlineResultUpdateOrNull(): ChosenInlineResultUpdate? = this as? + dev.inmo.tgbotapi.types.update.ChosenInlineResultUpdate + +public inline fun Update.chosenInlineResultUpdateOrThrow(): ChosenInlineResultUpdate = this as + dev.inmo.tgbotapi.types.update.ChosenInlineResultUpdate + +public inline fun Update.ifChosenInlineResultUpdate(block: (ChosenInlineResultUpdate) -> T): T? + = chosenInlineResultUpdateOrNull() ?.let(block) + +public inline fun Update.commonChatMemberUpdatedUpdateOrNull(): CommonChatMemberUpdatedUpdate? = + this as? dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate + +public inline fun Update.commonChatMemberUpdatedUpdateOrThrow(): CommonChatMemberUpdatedUpdate = + this as dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate + +public inline fun + Update.ifCommonChatMemberUpdatedUpdate(block: (CommonChatMemberUpdatedUpdate) -> T): T? = + commonChatMemberUpdatedUpdateOrNull() ?.let(block) + +public inline fun Update.editChannelPostUpdateOrNull(): EditChannelPostUpdate? = this as? + dev.inmo.tgbotapi.types.update.EditChannelPostUpdate + +public inline fun Update.editChannelPostUpdateOrThrow(): EditChannelPostUpdate = this as + dev.inmo.tgbotapi.types.update.EditChannelPostUpdate + +public inline fun Update.ifEditChannelPostUpdate(block: (EditChannelPostUpdate) -> T): T? = + editChannelPostUpdateOrNull() ?.let(block) + +public inline fun Update.editMessageUpdateOrNull(): EditMessageUpdate? = this as? + dev.inmo.tgbotapi.types.update.EditMessageUpdate + +public inline fun Update.editMessageUpdateOrThrow(): EditMessageUpdate = this as + dev.inmo.tgbotapi.types.update.EditMessageUpdate + +public inline fun Update.ifEditMessageUpdate(block: (EditMessageUpdate) -> T): T? = + editMessageUpdateOrNull() ?.let(block) + +public inline fun Update.inlineQueryUpdateOrNull(): InlineQueryUpdate? = this as? + dev.inmo.tgbotapi.types.update.InlineQueryUpdate + +public inline fun Update.inlineQueryUpdateOrThrow(): InlineQueryUpdate = this as + dev.inmo.tgbotapi.types.update.InlineQueryUpdate + +public inline fun Update.ifInlineQueryUpdate(block: (InlineQueryUpdate) -> T): T? = + inlineQueryUpdateOrNull() ?.let(block) + +public inline fun Update.messageUpdateOrNull(): MessageUpdate? = this as? + dev.inmo.tgbotapi.types.update.MessageUpdate + +public inline fun Update.messageUpdateOrThrow(): MessageUpdate = this as + dev.inmo.tgbotapi.types.update.MessageUpdate + +public inline fun Update.ifMessageUpdate(block: (MessageUpdate) -> T): T? = + messageUpdateOrNull() ?.let(block) + +public inline fun Update.myChatMemberUpdatedUpdateOrNull(): MyChatMemberUpdatedUpdate? = this as? + dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate + +public inline fun Update.myChatMemberUpdatedUpdateOrThrow(): MyChatMemberUpdatedUpdate = this as + dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate + +public inline fun Update.ifMyChatMemberUpdatedUpdate(block: (MyChatMemberUpdatedUpdate) -> T): + T? = myChatMemberUpdatedUpdateOrNull() ?.let(block) + +public inline fun Update.pollAnswerUpdateOrNull(): PollAnswerUpdate? = this as? + dev.inmo.tgbotapi.types.update.PollAnswerUpdate + +public inline fun Update.pollAnswerUpdateOrThrow(): PollAnswerUpdate = this as + dev.inmo.tgbotapi.types.update.PollAnswerUpdate + +public inline fun Update.ifPollAnswerUpdate(block: (PollAnswerUpdate) -> T): T? = + pollAnswerUpdateOrNull() ?.let(block) + +public inline fun Update.pollUpdateOrNull(): PollUpdate? = this as? + dev.inmo.tgbotapi.types.update.PollUpdate + +public inline fun Update.pollUpdateOrThrow(): PollUpdate = this as + dev.inmo.tgbotapi.types.update.PollUpdate + +public inline fun Update.ifPollUpdate(block: (PollUpdate) -> T): T? = pollUpdateOrNull() + ?.let(block) + +public inline fun Update.preCheckoutQueryUpdateOrNull(): PreCheckoutQueryUpdate? = this as? + dev.inmo.tgbotapi.types.update.PreCheckoutQueryUpdate + +public inline fun Update.preCheckoutQueryUpdateOrThrow(): PreCheckoutQueryUpdate = this as + dev.inmo.tgbotapi.types.update.PreCheckoutQueryUpdate + +public inline fun Update.ifPreCheckoutQueryUpdate(block: (PreCheckoutQueryUpdate) -> T): T? = + preCheckoutQueryUpdateOrNull() ?.let(block) + +public inline fun Update.shippingQueryUpdateOrNull(): ShippingQueryUpdate? = this as? + dev.inmo.tgbotapi.types.update.ShippingQueryUpdate + +public inline fun Update.shippingQueryUpdateOrThrow(): ShippingQueryUpdate = this as + dev.inmo.tgbotapi.types.update.ShippingQueryUpdate + +public inline fun Update.ifShippingQueryUpdate(block: (ShippingQueryUpdate) -> T): T? = + shippingQueryUpdateOrNull() ?.let(block) + +public inline fun Update.baseEditMessageUpdateOrNull(): BaseEditMessageUpdate? = this as? + dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate + +public inline fun Update.baseEditMessageUpdateOrThrow(): BaseEditMessageUpdate = this as + dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate + +public inline fun Update.ifBaseEditMessageUpdate(block: (BaseEditMessageUpdate) -> T): T? = + baseEditMessageUpdateOrNull() ?.let(block) + +public inline fun Update.baseMessageUpdateOrNull(): BaseMessageUpdate? = this as? + dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate + +public inline fun Update.baseMessageUpdateOrThrow(): BaseMessageUpdate = this as + dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate + +public inline fun Update.ifBaseMessageUpdate(block: (BaseMessageUpdate) -> T): T? = + baseMessageUpdateOrNull() ?.let(block) + +public inline fun Update.baseSentMessageUpdateOrNull(): BaseSentMessageUpdate? = this as? + dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate + +public inline fun Update.baseSentMessageUpdateOrThrow(): BaseSentMessageUpdate = this as + dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate + +public inline fun Update.ifBaseSentMessageUpdate(block: (BaseSentMessageUpdate) -> T): T? = + baseSentMessageUpdateOrNull() ?.let(block) + +public inline fun Update.chatMemberUpdatedUpdateOrNull(): ChatMemberUpdatedUpdate? = this as? + dev.inmo.tgbotapi.types.update.abstracts.ChatMemberUpdatedUpdate + +public inline fun Update.chatMemberUpdatedUpdateOrThrow(): ChatMemberUpdatedUpdate = this as + dev.inmo.tgbotapi.types.update.abstracts.ChatMemberUpdatedUpdate + +public inline fun Update.ifChatMemberUpdatedUpdate(block: (ChatMemberUpdatedUpdate) -> T): T? = + chatMemberUpdatedUpdateOrNull() ?.let(block) + +public inline fun Update.unknownUpdateOrNull(): UnknownUpdate? = this as? + dev.inmo.tgbotapi.types.update.abstracts.UnknownUpdate + +public inline fun Update.unknownUpdateOrThrow(): UnknownUpdate = this as + dev.inmo.tgbotapi.types.update.abstracts.UnknownUpdate + +public inline fun Update.ifUnknownUpdate(block: (UnknownUpdate) -> T): T? = + unknownUpdateOrNull() ?.let(block) + +public inline fun Update.channelPostMediaGroupUpdateOrNull(): ChannelPostMediaGroupUpdate? = this + as? dev.inmo.tgbotapi.types.update.media_group.ChannelPostMediaGroupUpdate + +public inline fun Update.channelPostMediaGroupUpdateOrThrow(): ChannelPostMediaGroupUpdate = this as + dev.inmo.tgbotapi.types.update.media_group.ChannelPostMediaGroupUpdate + +public inline fun + Update.ifChannelPostMediaGroupUpdate(block: (ChannelPostMediaGroupUpdate) -> T): T? = + channelPostMediaGroupUpdateOrNull() ?.let(block) + +public inline fun Update.editChannelPostMediaGroupUpdateOrNull(): EditChannelPostMediaGroupUpdate? = + this as? dev.inmo.tgbotapi.types.update.media_group.EditChannelPostMediaGroupUpdate + +public inline fun Update.editChannelPostMediaGroupUpdateOrThrow(): EditChannelPostMediaGroupUpdate = + this as dev.inmo.tgbotapi.types.update.media_group.EditChannelPostMediaGroupUpdate + +public inline fun + Update.ifEditChannelPostMediaGroupUpdate(block: (EditChannelPostMediaGroupUpdate) -> T): T? = + editChannelPostMediaGroupUpdateOrNull() ?.let(block) + +public inline fun Update.editMessageMediaGroupUpdateOrNull(): EditMessageMediaGroupUpdate? = this + as? dev.inmo.tgbotapi.types.update.media_group.EditMessageMediaGroupUpdate + +public inline fun Update.editMessageMediaGroupUpdateOrThrow(): EditMessageMediaGroupUpdate = this as + dev.inmo.tgbotapi.types.update.media_group.EditMessageMediaGroupUpdate + +public inline fun + Update.ifEditMessageMediaGroupUpdate(block: (EditMessageMediaGroupUpdate) -> T): T? = + editMessageMediaGroupUpdateOrNull() ?.let(block) + +public inline fun Update.mediaGroupUpdateOrNull(): MediaGroupUpdate? = this as? + dev.inmo.tgbotapi.types.update.media_group.MediaGroupUpdate + +public inline fun Update.mediaGroupUpdateOrThrow(): MediaGroupUpdate = this as + dev.inmo.tgbotapi.types.update.media_group.MediaGroupUpdate + +public inline fun Update.ifMediaGroupUpdate(block: (MediaGroupUpdate) -> T): T? = + mediaGroupUpdateOrNull() ?.let(block) + +public inline fun Update.sentMediaGroupUpdateOrNull(): SentMediaGroupUpdate? = this as? + dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate + +public inline fun Update.sentMediaGroupUpdateOrThrow(): SentMediaGroupUpdate = this as + dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate + +public inline fun Update.ifSentMediaGroupUpdate(block: (SentMediaGroupUpdate) -> T): T? = + sentMediaGroupUpdateOrNull() ?.let(block) + +public inline fun Update.editMediaGroupUpdateOrNull(): EditMediaGroupUpdate? = this as? + dev.inmo.tgbotapi.types.update.media_group.EditMediaGroupUpdate + +public inline fun Update.editMediaGroupUpdateOrThrow(): EditMediaGroupUpdate = this as + dev.inmo.tgbotapi.types.update.media_group.EditMediaGroupUpdate + +public inline fun Update.ifEditMediaGroupUpdate(block: (EditMediaGroupUpdate) -> T): T? = + editMediaGroupUpdateOrNull() ?.let(block) + +public inline fun Update.messageMediaGroupUpdateOrNull(): MessageMediaGroupUpdate? = this as? + dev.inmo.tgbotapi.types.update.media_group.MessageMediaGroupUpdate + +public inline fun Update.messageMediaGroupUpdateOrThrow(): MessageMediaGroupUpdate = this as + dev.inmo.tgbotapi.types.update.media_group.MessageMediaGroupUpdate + +public inline fun Update.ifMessageMediaGroupUpdate(block: (MessageMediaGroupUpdate) -> T): T? = + messageMediaGroupUpdateOrNull() ?.let(block) From cb4880bd00559eca88cef09a93cd1bc8036ee2e9 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 5 Aug 2022 16:35:07 +0600 Subject: [PATCH 12/17] optimize imports in utils --- .../tgbotapi/extensions/utils/ClassCasts.kt | 22 +------ .../extensions/utils/ClassCastsNew.kt | 63 +------------------ .../utils/CommonMessageConversations.kt | 1 - .../extensions/utils/ContentCastsNew.kt | 3 +- .../utils/ContentMessageConversations.kt | 2 - .../tgbotapi/extensions/utils/WithContent.kt | 3 +- .../tgbotapi/extensions/utils/WithEvent.kt | 3 - .../TextCaptionBotCommandsParser.kt | 4 +- .../utils/extensions/UpdateChatRetriever.kt | 2 +- .../utils/extensions/raw/CallbackQuery.kt | 2 +- .../utils/extensions/raw/Message.kt | 5 +- .../utils/extensions/raw/Sticker.kt | 3 +- .../utils/formatting/EntitiesBuilder.kt | 2 +- .../utils/formatting/LinksFormatting.kt | 2 +- .../formatting/ResendingTextFormatting.kt | 2 +- .../utils/shortcuts/CommandsShortcuts.kt | 4 +- .../utils/shortcuts/FlowsUpdatesFilter.kt | 5 +- .../types/files/ContentAsMultipartFile.kt | 2 +- .../utils/updates/CommandsFilters.kt | 3 +- .../utils/updates/UpdatesChatFilters.kt | 2 +- 20 files changed, 23 insertions(+), 112 deletions(-) diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt index a5cf160d65..0a9cfa3e83 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt @@ -6,8 +6,6 @@ import dev.inmo.tgbotapi.abstracts.* import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink import dev.inmo.tgbotapi.requests.send.payments.SendInvoice import dev.inmo.tgbotapi.types.* -import dev.inmo.tgbotapi.types.queries.callback.* -import dev.inmo.tgbotapi.types.chat.member.* import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.* import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.* import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.* @@ -20,26 +18,16 @@ import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.* import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.* import dev.inmo.tgbotapi.types.InlineQueries.query.* -import dev.inmo.tgbotapi.types.media.* import dev.inmo.tgbotapi.types.abstracts.WithOptionalLanguageCode import dev.inmo.tgbotapi.types.actions.* import dev.inmo.tgbotapi.types.buttons.* import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.* import dev.inmo.tgbotapi.types.chat.* -import dev.inmo.tgbotapi.types.chat.Bot -import dev.inmo.tgbotapi.types.chat.CommonBot -import dev.inmo.tgbotapi.types.chat.CommonUser -import dev.inmo.tgbotapi.types.chat.ExtendedBot -import dev.inmo.tgbotapi.types.chat.User -import dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember -import dev.inmo.tgbotapi.types.chat.member.BannedChatMember -import dev.inmo.tgbotapi.types.chat.member.ChatMember -import dev.inmo.tgbotapi.types.chat.member.MemberChatMember -import dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember +import dev.inmo.tgbotapi.types.chat.member.* import dev.inmo.tgbotapi.types.dice.* import dev.inmo.tgbotapi.types.files.* -import dev.inmo.tgbotapi.types.files.Sticker import dev.inmo.tgbotapi.types.location.* +import dev.inmo.tgbotapi.types.media.* import dev.inmo.tgbotapi.types.message.* import dev.inmo.tgbotapi.types.message.ChatEvents.* import dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMember @@ -48,11 +36,6 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.voice.* import dev.inmo.tgbotapi.types.message.abstracts.* import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage import dev.inmo.tgbotapi.types.message.content.* -import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.MediaGroupContent -import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.InvoiceContent import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent import dev.inmo.tgbotapi.types.message.textsources.* import dev.inmo.tgbotapi.types.passport.* @@ -61,6 +44,7 @@ import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.* import dev.inmo.tgbotapi.types.passport.encrypted.* import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.* import dev.inmo.tgbotapi.types.polls.* +import dev.inmo.tgbotapi.types.queries.callback.* import dev.inmo.tgbotapi.types.update.* import dev.inmo.tgbotapi.types.update.abstracts.* import dev.inmo.tgbotapi.types.update.media_group.* 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 6227113172..c782f769ca 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 @@ -2,68 +2,9 @@ package dev.inmo.tgbotapi.extensions.utils -import dev.inmo.tgbotapi.abstracts.* -import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink -import dev.inmo.tgbotapi.requests.send.payments.SendInvoice -import dev.inmo.tgbotapi.types.* -import dev.inmo.tgbotapi.types.queries.callback.* -import dev.inmo.tgbotapi.types.chat.member.* -import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.* -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.* -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.* -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.* -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.* -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.* -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.* -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.* -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.* -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.* -import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.* -import dev.inmo.tgbotapi.types.InlineQueries.query.* -import dev.inmo.tgbotapi.types.media.* +import dev.inmo.tgbotapi.abstracts.FromUser +import dev.inmo.tgbotapi.abstracts.WithUser import dev.inmo.tgbotapi.types.abstracts.WithOptionalLanguageCode -import dev.inmo.tgbotapi.types.actions.* -import dev.inmo.tgbotapi.types.buttons.* -import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.* -import dev.inmo.tgbotapi.types.chat.* -import dev.inmo.tgbotapi.types.chat.Bot -import dev.inmo.tgbotapi.types.chat.CommonBot -import dev.inmo.tgbotapi.types.chat.CommonUser -import dev.inmo.tgbotapi.types.chat.ExtendedBot -import dev.inmo.tgbotapi.types.chat.User -import dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember -import dev.inmo.tgbotapi.types.chat.member.BannedChatMember -import dev.inmo.tgbotapi.types.chat.member.ChatMember -import dev.inmo.tgbotapi.types.chat.member.MemberChatMember -import dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember -import dev.inmo.tgbotapi.types.dice.* -import dev.inmo.tgbotapi.types.files.* -import dev.inmo.tgbotapi.types.files.Sticker -import dev.inmo.tgbotapi.types.location.* -import dev.inmo.tgbotapi.types.message.* -import dev.inmo.tgbotapi.types.message.ChatEvents.* -import dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMember -import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* -import dev.inmo.tgbotapi.types.message.ChatEvents.voice.* -import dev.inmo.tgbotapi.types.message.abstracts.* -import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage -import dev.inmo.tgbotapi.types.message.content.* -import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.MediaGroupContent -import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.InvoiceContent -import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent -import dev.inmo.tgbotapi.types.message.textsources.* -import dev.inmo.tgbotapi.types.passport.* -import dev.inmo.tgbotapi.types.passport.decrypted.* -import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.* -import dev.inmo.tgbotapi.types.passport.encrypted.* -import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.* -import dev.inmo.tgbotapi.types.polls.* -import dev.inmo.tgbotapi.types.update.* -import dev.inmo.tgbotapi.types.update.abstracts.* -import dev.inmo.tgbotapi.types.update.media_group.* import dev.inmo.tgbotapi.utils.PreviewFeature @PreviewFeature diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/CommonMessageConversations.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/CommonMessageConversations.kt index 5da1e67ef5..172dab74cc 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/CommonMessageConversations.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/CommonMessageConversations.kt @@ -2,7 +2,6 @@ package dev.inmo.tgbotapi.extensions.utils import dev.inmo.tgbotapi.types.message.abstracts.* import dev.inmo.tgbotapi.types.message.content.MessageContent -import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage import kotlinx.coroutines.flow.* /** diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ContentCastsNew.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ContentCastsNew.kt index 8a7be6c30c..05cd19bd49 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ContentCastsNew.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ContentCastsNew.kt @@ -3,9 +3,8 @@ package dev.inmo.tgbotapi.extensions.utils import dev.inmo.tgbotapi.types.message.abstracts.* -import dev.inmo.tgbotapi.types.message.content.MessageContent -import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage import dev.inmo.tgbotapi.types.message.content.MediaGroupContent +import dev.inmo.tgbotapi.types.message.content.MessageContent inline fun ContentMessage<*>.withContentOrNull() = if (content is T) { this as ContentMessage } else { null } inline fun ContentMessage<*>.withContentOrThrow() = withContentOrNull()!! diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ContentMessageConversations.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ContentMessageConversations.kt index d36c67f3d4..e9b370dc5a 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ContentMessageConversations.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ContentMessageConversations.kt @@ -2,8 +2,6 @@ package dev.inmo.tgbotapi.extensions.utils import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.* -import dev.inmo.tgbotapi.types.message.content.MessageContent -import dev.inmo.tgbotapi.types.message.content.InvoiceContent import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.mapNotNull diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/WithContent.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/WithContent.kt index c396516719..80dea0da67 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/WithContent.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/WithContent.kt @@ -3,9 +3,8 @@ package dev.inmo.tgbotapi.extensions.utils import dev.inmo.tgbotapi.types.message.abstracts.* -import dev.inmo.tgbotapi.types.message.content.MessageContent -import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage import dev.inmo.tgbotapi.types.message.content.MediaGroupContent +import dev.inmo.tgbotapi.types.message.content.MessageContent inline fun ContentMessage<*>.withContent() = if (content is T) { this as ContentMessage } else { null } inline fun ContentMessage<*>.requireWithContent() = withContent()!! diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/WithEvent.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/WithEvent.kt index d9221c82a4..b49f1e803b 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/WithEvent.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/WithEvent.kt @@ -5,9 +5,6 @@ package dev.inmo.tgbotapi.extensions.utils import dev.inmo.tgbotapi.types.message.* import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.abstracts.* -import dev.inmo.tgbotapi.types.message.content.MessageContent -import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage -import dev.inmo.tgbotapi.types.message.content.MediaGroupContent inline fun ChatEventMessage<*>.withEvent() = if (chatEvent is T) { this as ChatEventMessage } else { null } inline fun ChatEventMessage<*>.requireWithEvent() = withEvent()!! diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/TextCaptionBotCommandsParser.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/TextCaptionBotCommandsParser.kt index 09bd5a19fe..c591e5e97d 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/TextCaptionBotCommandsParser.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/TextCaptionBotCommandsParser.kt @@ -1,10 +1,10 @@ package dev.inmo.tgbotapi.extensions.utils.extensions import dev.inmo.tgbotapi.abstracts.TextedWithTextSources -import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource -import dev.inmo.tgbotapi.types.message.textsources.TextSource import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.TextContent +import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource +import dev.inmo.tgbotapi.types.message.textsources.TextSource val defaultArgsSeparator = Regex(" ") diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/UpdateChatRetriever.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/UpdateChatRetriever.kt index 426b6c8990..aaf91e4521 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/UpdateChatRetriever.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/UpdateChatRetriever.kt @@ -4,8 +4,8 @@ import dev.inmo.tgbotapi.abstracts.FromUser import dev.inmo.tgbotapi.abstracts.WithUser import dev.inmo.tgbotapi.extensions.utils.asUser import dev.inmo.tgbotapi.extensions.utils.shortcuts.chat -import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.chat.Chat +import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate import dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate import dev.inmo.tgbotapi.types.update.abstracts.Update diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/CallbackQuery.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/CallbackQuery.kt index 3b2376dd68..3e0d233ace 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/CallbackQuery.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/CallbackQuery.kt @@ -1,10 +1,10 @@ package dev.inmo.tgbotapi.extensions.utils.extensions.raw import dev.inmo.tgbotapi.extensions.utils.* -import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery import dev.inmo.tgbotapi.types.InlineMessageIdentifier import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.MessageContent +import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery import dev.inmo.tgbotapi.utils.RiskFeature @RiskFeature(RawFieldsUsageWarning) diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt index 40054eabf4..018eaca4dc 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt @@ -2,14 +2,10 @@ package dev.inmo.tgbotapi.extensions.utils.extensions.raw import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.types.* -import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.chat.* -import dev.inmo.tgbotapi.types.chat.CommonBot -import dev.inmo.tgbotapi.types.chat.User 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.Game import dev.inmo.tgbotapi.types.location.Location import dev.inmo.tgbotapi.types.message.ChatEvents.* @@ -17,6 +13,7 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.voice.* import dev.inmo.tgbotapi.types.message.abstracts.ConnectedFromChannelGroupContentMessage import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.message.content.TextContent +import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.passport.PassportData import dev.inmo.tgbotapi.types.payments.Invoice import dev.inmo.tgbotapi.types.payments.SuccessfulPayment diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Sticker.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Sticker.kt index fadb73ea4d..edf5d1a448 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Sticker.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Sticker.kt @@ -1,7 +1,8 @@ package dev.inmo.tgbotapi.extensions.utils.extensions.raw import dev.inmo.tgbotapi.requests.abstracts.FileId -import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.FileUniqueId +import dev.inmo.tgbotapi.types.StickerSetName import dev.inmo.tgbotapi.types.files.* import dev.inmo.tgbotapi.types.stickers.MaskPosition diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/EntitiesBuilder.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/EntitiesBuilder.kt index 9a4494c8c9..ddcfcc4bd2 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/EntitiesBuilder.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/EntitiesBuilder.kt @@ -3,8 +3,8 @@ package dev.inmo.tgbotapi.extensions.utils.formatting import dev.inmo.micro_utils.common.joinTo -import dev.inmo.tgbotapi.types.message.textsources.* import dev.inmo.tgbotapi.types.chat.User +import dev.inmo.tgbotapi.types.message.textsources.* import dev.inmo.tgbotapi.utils.RiskFeature typealias EntitiesBuilderBody = EntitiesBuilder.() -> Unit diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt index ad8969379a..1faac5ea31 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt @@ -1,9 +1,9 @@ package dev.inmo.tgbotapi.extensions.utils.formatting import dev.inmo.tgbotapi.types.* -import dev.inmo.tgbotapi.types.message.textsources.link import dev.inmo.tgbotapi.types.chat.* import dev.inmo.tgbotapi.types.message.abstracts.Message +import dev.inmo.tgbotapi.types.message.textsources.link fun makeUsernameLink(username: String) = "$internalLinkBeginning/$username" fun makeUsernameDeepLinkPrefix(username: String) = "${makeUsernameLink(username)}?start=" diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/ResendingTextFormatting.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/ResendingTextFormatting.kt index e7632a8c62..41e074a151 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/ResendingTextFormatting.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/ResendingTextFormatting.kt @@ -1,9 +1,9 @@ package dev.inmo.tgbotapi.extensions.utils.formatting import dev.inmo.tgbotapi.types.* -import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList import dev.inmo.tgbotapi.types.message.* import dev.inmo.tgbotapi.types.message.content.TextContent +import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList fun createFormattedText( entities: TextSourcesList, diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/CommandsShortcuts.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/CommandsShortcuts.kt index 74cdd015e2..7b49ea5a5e 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/CommandsShortcuts.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/CommandsShortcuts.kt @@ -2,10 +2,10 @@ package dev.inmo.tgbotapi.extensions.utils.shortcuts import dev.inmo.tgbotapi.extensions.utils.onlyTextContentMessages import dev.inmo.tgbotapi.extensions.utils.updates.asContentMessagesFlow -import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource -import dev.inmo.tgbotapi.types.message.textsources.RegularTextSource import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.TextContent +import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource +import dev.inmo.tgbotapi.types.message.textsources.RegularTextSource import kotlinx.coroutines.flow.* /** diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/FlowsUpdatesFilter.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/FlowsUpdatesFilter.kt index dff78316e4..4b3956f4ac 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/FlowsUpdatesFilter.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/FlowsUpdatesFilter.kt @@ -7,11 +7,8 @@ import dev.inmo.tgbotapi.extensions.utils.updates.asContentMessagesFlow import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.* -import dev.inmo.tgbotapi.types.message.content.MediaGroupContent -import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.InvoiceContent -import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate +import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/files/ContentAsMultipartFile.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/files/ContentAsMultipartFile.kt index d52d2a9c90..f50d969766 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/files/ContentAsMultipartFile.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/types/files/ContentAsMultipartFile.kt @@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.requests.get.GetFile import dev.inmo.tgbotapi.types.files.PathedFile import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.message.content.MediaContent -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.utils.ByteReadChannelAllocator suspend fun multipartFile( downloadStreamAllocator: ByteReadChannelAllocator, diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/CommandsFilters.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/CommandsFilters.kt index 246a1586ad..8cd8ce8dcd 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/CommandsFilters.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/CommandsFilters.kt @@ -2,10 +2,9 @@ package dev.inmo.tgbotapi.extensions.utils.updates import dev.inmo.tgbotapi.extensions.utils.onlyTextContentMessages import dev.inmo.tgbotapi.extensions.utils.shortcuts.* -import dev.inmo.tgbotapi.types.message.textsources.* import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.TextContent -import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList +import dev.inmo.tgbotapi.types.message.textsources.* import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate import kotlinx.coroutines.flow.Flow diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/UpdatesChatFilters.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/UpdatesChatFilters.kt index 8cd45e968e..70be37786a 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/UpdatesChatFilters.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/updates/UpdatesChatFilters.kt @@ -2,8 +2,8 @@ package dev.inmo.tgbotapi.extensions.utils.updates import dev.inmo.tgbotapi.types.ChatId import dev.inmo.tgbotapi.types.chat.Chat -import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate import dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate +import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.filter From bbdff0b31a80346ff7709f04d4e76e2e45ab26c8 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 5 Aug 2022 17:31:45 +0600 Subject: [PATCH 13/17] rename file with new classcasts --- tgbotapi.core/build.gradle | 2 +- .../extensions/utils/ClassCastsNew.kt | 4461 ++++++++++++++++- .../extensions/utils/ClassCastsNewAny.kt | 36 + .../extensions/utils/NewClassCasts.kt | 4451 ---------------- 4 files changed, 4475 insertions(+), 4475 deletions(-) create mode 100644 tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAny.kt delete mode 100644 tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/NewClassCasts.kt diff --git a/tgbotapi.core/build.gradle b/tgbotapi.core/build.gradle index 900d9789c7..41b0bd2c47 100644 --- a/tgbotapi.core/build.gradle +++ b/tgbotapi.core/build.gradle @@ -58,6 +58,6 @@ dependencies { ksp { arg("cctargetPackage", "dev.inmo.tgbotapi.extensions.utils") - arg("ccoutputFileName", "NewClassCasts") + arg("ccoutputFileName", "ClassCastsNew") arg("ccoutputFolder", project(":tgbotapi.utils").file("src/commonMain/kotlin").absolutePath) } 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 c782f769ca..9547763e56 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 @@ -1,36 +1,4451 @@ -@file:Suppress("NOTHING_TO_INLINE", "unused", "UNCHECKED_CAST") - package dev.inmo.tgbotapi.extensions.utils +import dev.inmo.tgbotapi.abstracts.CommonSendInvoiceData import dev.inmo.tgbotapi.abstracts.FromUser import dev.inmo.tgbotapi.abstracts.WithUser -import dev.inmo.tgbotapi.types.abstracts.WithOptionalLanguageCode -import dev.inmo.tgbotapi.utils.PreviewFeature +import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink +import dev.inmo.tgbotapi.requests.send.payments.SendInvoice +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.InlineQueries.ChosenInlineResult.BaseChosenInlineResult +import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult +import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultContact +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGame +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultLocation +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultStickerCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVenue +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceCachedImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceImpl +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.DescribedInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.FileInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.OptionallyTitledInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.SizedInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbSizedInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedWithMimeTypeInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.TitledInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.UrlInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCommon +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocument +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCommon +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCommon +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCommon +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhoto +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCommon +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCommon +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached +import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCommon +import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputContactMessageContent +import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent +import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputLocationMessageContent +import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputMessageContent +import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent +import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessageContent +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.PrimaryInviteLink +import dev.inmo.tgbotapi.types.SecondaryChatInviteLink +import dev.inmo.tgbotapi.types.actions.BotAction +import dev.inmo.tgbotapi.types.actions.ChooseStickerAction +import dev.inmo.tgbotapi.types.actions.CustomBotAction +import dev.inmo.tgbotapi.types.actions.FindLocationAction +import dev.inmo.tgbotapi.types.actions.RecordVideoAction +import dev.inmo.tgbotapi.types.actions.RecordVideoNoteAction +import dev.inmo.tgbotapi.types.actions.RecordVoiceAction +import dev.inmo.tgbotapi.types.actions.TypingAction +import dev.inmo.tgbotapi.types.actions.UploadDocumentAction +import dev.inmo.tgbotapi.types.actions.UploadPhotoAction +import dev.inmo.tgbotapi.types.actions.UploadVideoAction +import dev.inmo.tgbotapi.types.actions.UploadVideoNoteAction +import dev.inmo.tgbotapi.types.actions.UploadVoiceAction +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackDataInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackGameInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.InlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.LoginURLInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.PayInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryCurrentChatInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.URLInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.UnknownInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.WebAppInlineKeyboardButton +import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup +import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup +import dev.inmo.tgbotapi.types.buttons.ReplyForce +import dev.inmo.tgbotapi.types.buttons.ReplyKeyboardMarkup +import dev.inmo.tgbotapi.types.buttons.ReplyKeyboardRemove +import dev.inmo.tgbotapi.types.chat.AbleToAddInAttachmentMenuChat +import dev.inmo.tgbotapi.types.chat.Bot +import dev.inmo.tgbotapi.types.chat.ChannelChat +import dev.inmo.tgbotapi.types.chat.ChannelChatImpl +import dev.inmo.tgbotapi.types.chat.Chat +import dev.inmo.tgbotapi.types.chat.ChatJoinRequest +import dev.inmo.tgbotapi.types.chat.CommonBot +import dev.inmo.tgbotapi.types.chat.CommonUser +import dev.inmo.tgbotapi.types.chat.ExtendedBot +import dev.inmo.tgbotapi.types.chat.ExtendedChannelChat +import dev.inmo.tgbotapi.types.chat.ExtendedChannelChatImpl +import dev.inmo.tgbotapi.types.chat.ExtendedChat +import dev.inmo.tgbotapi.types.chat.ExtendedGroupChat +import dev.inmo.tgbotapi.types.chat.ExtendedGroupChatImpl +import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat +import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChatImpl +import dev.inmo.tgbotapi.types.chat.ExtendedPublicChat +import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat +import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChatImpl +import dev.inmo.tgbotapi.types.chat.GroupChat +import dev.inmo.tgbotapi.types.chat.GroupChatImpl +import dev.inmo.tgbotapi.types.chat.PossiblyPremiumChat +import dev.inmo.tgbotapi.types.chat.PrivateChat +import dev.inmo.tgbotapi.types.chat.PrivateChatImpl +import dev.inmo.tgbotapi.types.chat.PublicChat +import dev.inmo.tgbotapi.types.chat.SuperPublicChat +import dev.inmo.tgbotapi.types.chat.SupergroupChat +import dev.inmo.tgbotapi.types.chat.SupergroupChatImpl +import dev.inmo.tgbotapi.types.chat.UnknownChatType +import dev.inmo.tgbotapi.types.chat.UnknownExtendedChat +import dev.inmo.tgbotapi.types.chat.User +import dev.inmo.tgbotapi.types.chat.UsernameChat +import dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember +import dev.inmo.tgbotapi.types.chat.member.AdministratorChatMemberImpl +import dev.inmo.tgbotapi.types.chat.member.BannedChatMember +import dev.inmo.tgbotapi.types.chat.member.ChatMember +import dev.inmo.tgbotapi.types.chat.member.KickedChatMember +import dev.inmo.tgbotapi.types.chat.member.LeftChatMember +import dev.inmo.tgbotapi.types.chat.member.LeftChatMemberImpl +import dev.inmo.tgbotapi.types.chat.member.MemberChatMember +import dev.inmo.tgbotapi.types.chat.member.MemberChatMemberImpl +import dev.inmo.tgbotapi.types.chat.member.OwnerChatMember +import dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember +import dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember +import dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType +import dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType +import dev.inmo.tgbotapi.types.dice.CubeDiceAnimationType +import dev.inmo.tgbotapi.types.dice.CustomDiceAnimationType +import dev.inmo.tgbotapi.types.dice.DartsDiceAnimationType +import dev.inmo.tgbotapi.types.dice.DiceAnimationType +import dev.inmo.tgbotapi.types.dice.FootballDiceAnimationType +import dev.inmo.tgbotapi.types.dice.SlotMachineDiceAnimationType +import dev.inmo.tgbotapi.types.files.AnimatedSticker +import dev.inmo.tgbotapi.types.files.AnimationFile +import dev.inmo.tgbotapi.types.files.AudioFile +import dev.inmo.tgbotapi.types.files.DocumentFile +import dev.inmo.tgbotapi.types.files.File +import dev.inmo.tgbotapi.types.files.MimedMediaFile +import dev.inmo.tgbotapi.types.files.PassportFile +import dev.inmo.tgbotapi.types.files.PathedFile +import dev.inmo.tgbotapi.types.files.PhotoSize +import dev.inmo.tgbotapi.types.files.PlayableMediaFile +import dev.inmo.tgbotapi.types.files.SimpleSticker +import dev.inmo.tgbotapi.types.files.SizedMediaFile +import dev.inmo.tgbotapi.types.files.Sticker +import dev.inmo.tgbotapi.types.files.TelegramMediaFile +import dev.inmo.tgbotapi.types.files.ThumbedMediaFile +import dev.inmo.tgbotapi.types.files.VideoFile +import dev.inmo.tgbotapi.types.files.VideoNoteFile +import dev.inmo.tgbotapi.types.files.VideoSticker +import dev.inmo.tgbotapi.types.files.VoiceFile +import dev.inmo.tgbotapi.types.location.LiveLocation +import dev.inmo.tgbotapi.types.location.Location +import dev.inmo.tgbotapi.types.location.StaticLocation +import dev.inmo.tgbotapi.types.media.AudioMediaGroupMemberTelegramMedia +import dev.inmo.tgbotapi.types.media.DocumentMediaGroupMemberTelegramMedia +import dev.inmo.tgbotapi.types.media.DuratedTelegramMedia +import dev.inmo.tgbotapi.types.media.MediaGroupMemberTelegramMedia +import dev.inmo.tgbotapi.types.media.SizedTelegramMedia +import dev.inmo.tgbotapi.types.media.TelegramMedia +import dev.inmo.tgbotapi.types.media.TelegramMediaAnimation +import dev.inmo.tgbotapi.types.media.TelegramMediaAudio +import dev.inmo.tgbotapi.types.media.TelegramMediaDocument +import dev.inmo.tgbotapi.types.media.TelegramMediaPhoto +import dev.inmo.tgbotapi.types.media.TelegramMediaVideo +import dev.inmo.tgbotapi.types.media.ThumbedTelegramMedia +import dev.inmo.tgbotapi.types.media.TitledTelegramMedia +import dev.inmo.tgbotapi.types.media.VisualMediaGroupMemberTelegramMedia +import dev.inmo.tgbotapi.types.message.AnonymousGroupContentMessageImpl +import dev.inmo.tgbotapi.types.message.ChannelContentMessageImpl +import dev.inmo.tgbotapi.types.message.ChannelEventMessage +import dev.inmo.tgbotapi.types.message.ChannelMediaGroupMessage +import dev.inmo.tgbotapi.types.message.ChatEvents.ChannelChatCreated +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.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.GroupEvent +import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateEvent +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.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.CommonGroupContentMessageImpl +import dev.inmo.tgbotapi.types.message.CommonGroupEventMessage +import dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage +import dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage +import dev.inmo.tgbotapi.types.message.ConnectedFromChannelGroupContentMessageImpl +import dev.inmo.tgbotapi.types.message.ForwardInfo +import dev.inmo.tgbotapi.types.message.PassportMessage +import dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl +import dev.inmo.tgbotapi.types.message.PrivateEventMessage +import dev.inmo.tgbotapi.types.message.UnconnectedFromChannelGroupContentMessageImpl +import dev.inmo.tgbotapi.types.message.abstracts.AnonymousGroupContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage +import dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage +import dev.inmo.tgbotapi.types.message.abstracts.ConnectedFromChannelGroupContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.FromChannelGroupContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage +import dev.inmo.tgbotapi.types.message.abstracts.GroupContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage +import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage +import dev.inmo.tgbotapi.types.message.abstracts.Message +import dev.inmo.tgbotapi.types.message.abstracts.PossiblyEditedMessage +import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage +import dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage +import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage +import dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.PublicContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.SignedMessage +import dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage +import dev.inmo.tgbotapi.types.message.abstracts.UnconnectedFromChannelGroupContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.UnknownMessageType +import dev.inmo.tgbotapi.types.message.content.AnimationContent +import dev.inmo.tgbotapi.types.message.content.AudioContent +import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent +import dev.inmo.tgbotapi.types.message.content.ContactContent +import dev.inmo.tgbotapi.types.message.content.DiceContent +import dev.inmo.tgbotapi.types.message.content.DocumentContent +import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent +import dev.inmo.tgbotapi.types.message.content.GameContent +import dev.inmo.tgbotapi.types.message.content.InvoiceContent +import dev.inmo.tgbotapi.types.message.content.LiveLocationContent +import dev.inmo.tgbotapi.types.message.content.LocationContent +import dev.inmo.tgbotapi.types.message.content.MediaCollectionContent +import dev.inmo.tgbotapi.types.message.content.MediaContent +import dev.inmo.tgbotapi.types.message.content.MediaGroupContent +import dev.inmo.tgbotapi.types.message.content.MessageContent +import dev.inmo.tgbotapi.types.message.content.PhotoContent +import dev.inmo.tgbotapi.types.message.content.PollContent +import dev.inmo.tgbotapi.types.message.content.ResendableContent +import dev.inmo.tgbotapi.types.message.content.StaticLocationContent +import dev.inmo.tgbotapi.types.message.content.StickerContent +import dev.inmo.tgbotapi.types.message.content.TextContent +import dev.inmo.tgbotapi.types.message.content.TextedMediaContent +import dev.inmo.tgbotapi.types.message.content.VenueContent +import dev.inmo.tgbotapi.types.message.content.VideoContent +import dev.inmo.tgbotapi.types.message.content.VideoNoteContent +import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent +import dev.inmo.tgbotapi.types.message.content.VoiceContent +import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent +import dev.inmo.tgbotapi.types.message.textsources.BoldTextSource +import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource +import dev.inmo.tgbotapi.types.message.textsources.CashTagTextSource +import dev.inmo.tgbotapi.types.message.textsources.CodeTextSource +import dev.inmo.tgbotapi.types.message.textsources.EMailTextSource +import dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource +import dev.inmo.tgbotapi.types.message.textsources.ItalicTextSource +import dev.inmo.tgbotapi.types.message.textsources.MentionTextSource +import dev.inmo.tgbotapi.types.message.textsources.MultilevelTextSource +import dev.inmo.tgbotapi.types.message.textsources.PhoneNumberTextSource +import dev.inmo.tgbotapi.types.message.textsources.PreTextSource +import dev.inmo.tgbotapi.types.message.textsources.RegularTextSource +import dev.inmo.tgbotapi.types.message.textsources.SpoilerTextSource +import dev.inmo.tgbotapi.types.message.textsources.StrikethroughTextSource +import dev.inmo.tgbotapi.types.message.textsources.TextLinkTextSource +import dev.inmo.tgbotapi.types.message.textsources.TextMentionTextSource +import dev.inmo.tgbotapi.types.message.textsources.TextSource +import dev.inmo.tgbotapi.types.message.textsources.URLTextSource +import dev.inmo.tgbotapi.types.message.textsources.UnderlineTextSource +import dev.inmo.tgbotapi.types.passport.PassportElementError +import dev.inmo.tgbotapi.types.passport.PassportElementErrorDataField +import dev.inmo.tgbotapi.types.passport.PassportElementErrorFile +import dev.inmo.tgbotapi.types.passport.PassportElementErrorFiles +import dev.inmo.tgbotapi.types.passport.PassportElementErrorFrontSide +import dev.inmo.tgbotapi.types.passport.PassportElementErrorReverseSide +import dev.inmo.tgbotapi.types.passport.PassportElementErrorSelfie +import dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFile +import dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFiles +import dev.inmo.tgbotapi.types.passport.PassportElementErrorUnspecified +import dev.inmo.tgbotapi.types.passport.PassportElementFileError +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 +import dev.inmo.tgbotapi.types.passport.encrypted.Email +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedAddress +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableFilesCollection +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableIDDocument +import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPersonalDetails +import dev.inmo.tgbotapi.types.passport.encrypted.IdentityCard +import dev.inmo.tgbotapi.types.passport.encrypted.InternalPassport +import dev.inmo.tgbotapi.types.passport.encrypted.Passport +import dev.inmo.tgbotapi.types.passport.encrypted.PassportRegistration +import dev.inmo.tgbotapi.types.passport.encrypted.PhoneNumber +import dev.inmo.tgbotapi.types.passport.encrypted.RentalAgreement +import dev.inmo.tgbotapi.types.passport.encrypted.TemporaryRegistration +import dev.inmo.tgbotapi.types.passport.encrypted.UtilityBill +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementTranslatable +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithData +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithEmail +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFilesCollection +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFrontSide +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithPhoneNumber +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithReverseSide +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithSelfie +import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.UnknownEncryptedPassportElement +import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery +import dev.inmo.tgbotapi.types.payments.ShippingQuery +import dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo +import dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo +import dev.inmo.tgbotapi.types.polls.MultipleAnswersPoll +import dev.inmo.tgbotapi.types.polls.Poll +import dev.inmo.tgbotapi.types.polls.PollAnswer +import dev.inmo.tgbotapi.types.polls.QuizPoll +import dev.inmo.tgbotapi.types.polls.RegularPoll +import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo +import dev.inmo.tgbotapi.types.polls.UnknownPollType +import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery +import dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType +import dev.inmo.tgbotapi.types.update.CallbackQueryUpdate +import dev.inmo.tgbotapi.types.update.ChannelPostUpdate +import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate +import dev.inmo.tgbotapi.types.update.ChosenInlineResultUpdate +import dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate +import dev.inmo.tgbotapi.types.update.EditChannelPostUpdate +import dev.inmo.tgbotapi.types.update.EditMessageUpdate +import dev.inmo.tgbotapi.types.update.InlineQueryUpdate +import dev.inmo.tgbotapi.types.update.MessageUpdate +import dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate +import dev.inmo.tgbotapi.types.update.PollAnswerUpdate +import dev.inmo.tgbotapi.types.update.PollUpdate +import dev.inmo.tgbotapi.types.update.PreCheckoutQueryUpdate +import dev.inmo.tgbotapi.types.update.ShippingQueryUpdate +import dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate +import dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate +import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate +import dev.inmo.tgbotapi.types.update.abstracts.ChatMemberUpdatedUpdate +import dev.inmo.tgbotapi.types.update.abstracts.UnknownUpdate +import dev.inmo.tgbotapi.types.update.abstracts.Update +import dev.inmo.tgbotapi.types.update.media_group.ChannelPostMediaGroupUpdate +import dev.inmo.tgbotapi.types.update.media_group.EditChannelPostMediaGroupUpdate +import dev.inmo.tgbotapi.types.update.media_group.EditMediaGroupUpdate +import dev.inmo.tgbotapi.types.update.media_group.EditMessageMediaGroupUpdate +import dev.inmo.tgbotapi.types.update.media_group.MediaGroupUpdate +import dev.inmo.tgbotapi.types.update.media_group.MessageMediaGroupUpdate +import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate -@PreviewFeature -inline fun Any.ifFromUser(block: (FromUser) -> T) = fromUserOrNull()?.let(block) +public inline fun CommonSendInvoiceData.createInvoiceLinkOrNull(): CreateInvoiceLink? = this as? + dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink -@PreviewFeature -inline fun Any.fromUserOrNull(): FromUser? = this as? FromUser +public inline fun CommonSendInvoiceData.createInvoiceLinkOrThrow(): CreateInvoiceLink = this as + dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink -@PreviewFeature -inline fun Any.fromUserOrThrow(): FromUser = this as FromUser +public inline fun CommonSendInvoiceData.ifCreateInvoiceLink(block: (CreateInvoiceLink) -> T): T? + = createInvoiceLinkOrNull() ?.let(block) -@PreviewFeature -inline fun Any.ifWithUser(block: (WithUser) -> T) = withUserOrNull()?.let(block) +public inline fun CommonSendInvoiceData.sendInvoiceOrNull(): SendInvoice? = this as? + dev.inmo.tgbotapi.requests.send.payments.SendInvoice -@PreviewFeature -inline fun Any.withUserOrNull(): WithUser? = this as? WithUser +public inline fun CommonSendInvoiceData.sendInvoiceOrThrow(): SendInvoice = this as + dev.inmo.tgbotapi.requests.send.payments.SendInvoice -@PreviewFeature -inline fun Any.withUserOrThrow(): WithUser = this as WithUser +public inline fun CommonSendInvoiceData.ifSendInvoice(block: (SendInvoice) -> T): T? = + sendInvoiceOrNull() ?.let(block) -@PreviewFeature -inline fun Any.ifWithOptionalLanguageCode(block: (WithOptionalLanguageCode) -> T) = - withOptionalLanguageCodeOrNull()?.let(block) +public inline fun CommonSendInvoiceData.inputInvoiceMessageContentOrNull(): + InputInvoiceMessageContent? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent -@PreviewFeature -inline fun Any.withOptionalLanguageCodeOrNull(): WithOptionalLanguageCode? = this as? WithOptionalLanguageCode +public inline fun CommonSendInvoiceData.inputInvoiceMessageContentOrThrow(): + InputInvoiceMessageContent = this as + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent -@PreviewFeature -inline fun Any.withOptionalLanguageCodeOrThrow(): WithOptionalLanguageCode = this as WithOptionalLanguageCode +public inline fun + CommonSendInvoiceData.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T): T? + = inputInvoiceMessageContentOrNull() ?.let(block) + +public inline fun WithUser.fromUserOrNull(): FromUser? = this as? + dev.inmo.tgbotapi.abstracts.FromUser + +public inline fun WithUser.fromUserOrThrow(): FromUser = this as + dev.inmo.tgbotapi.abstracts.FromUser + +public inline fun WithUser.ifFromUser(block: (FromUser) -> T): T? = fromUserOrNull() + ?.let(block) + +public inline fun WithUser.chatInviteLinkOrNull(): ChatInviteLink? = this as? + dev.inmo.tgbotapi.types.ChatInviteLink + +public inline fun WithUser.chatInviteLinkOrThrow(): ChatInviteLink = this as + dev.inmo.tgbotapi.types.ChatInviteLink + +public inline fun WithUser.ifChatInviteLink(block: (ChatInviteLink) -> T): T? = + chatInviteLinkOrNull() ?.let(block) + +public inline fun WithUser.secondaryChatInviteLinkOrNull(): SecondaryChatInviteLink? = this as? + dev.inmo.tgbotapi.types.SecondaryChatInviteLink + +public inline fun WithUser.secondaryChatInviteLinkOrThrow(): SecondaryChatInviteLink = this as + dev.inmo.tgbotapi.types.SecondaryChatInviteLink + +public inline fun WithUser.ifSecondaryChatInviteLink(block: (SecondaryChatInviteLink) -> T): T? + = secondaryChatInviteLinkOrNull() ?.let(block) + +public inline fun WithUser.primaryInviteLinkOrNull(): PrimaryInviteLink? = this as? + dev.inmo.tgbotapi.types.PrimaryInviteLink + +public inline fun WithUser.primaryInviteLinkOrThrow(): PrimaryInviteLink = this as + dev.inmo.tgbotapi.types.PrimaryInviteLink + +public inline fun WithUser.ifPrimaryInviteLink(block: (PrimaryInviteLink) -> T): T? = + primaryInviteLinkOrNull() ?.let(block) + +public inline fun WithUser.chatInviteLinkWithJoinRequestOrNull(): ChatInviteLinkWithJoinRequest? = + this as? dev.inmo.tgbotapi.types.ChatInviteLinkWithJoinRequest + +public inline fun WithUser.chatInviteLinkWithJoinRequestOrThrow(): ChatInviteLinkWithJoinRequest = + this as dev.inmo.tgbotapi.types.ChatInviteLinkWithJoinRequest + +public inline fun + WithUser.ifChatInviteLinkWithJoinRequest(block: (ChatInviteLinkWithJoinRequest) -> T): T? = + chatInviteLinkWithJoinRequestOrNull() ?.let(block) + +public inline fun WithUser.chatInviteLinkWithLimitedMembersOrNull(): + ChatInviteLinkWithLimitedMembers? = this as? + dev.inmo.tgbotapi.types.ChatInviteLinkWithLimitedMembers + +public inline fun WithUser.chatInviteLinkWithLimitedMembersOrThrow(): + ChatInviteLinkWithLimitedMembers = this as + dev.inmo.tgbotapi.types.ChatInviteLinkWithLimitedMembers + +public inline fun + WithUser.ifChatInviteLinkWithLimitedMembers(block: (ChatInviteLinkWithLimitedMembers) -> T): T? + = chatInviteLinkWithLimitedMembersOrNull() ?.let(block) + +public inline fun WithUser.chatInviteLinkUnlimitedOrNull(): ChatInviteLinkUnlimited? = this as? + dev.inmo.tgbotapi.types.ChatInviteLinkUnlimited + +public inline fun WithUser.chatInviteLinkUnlimitedOrThrow(): ChatInviteLinkUnlimited = this as + dev.inmo.tgbotapi.types.ChatInviteLinkUnlimited + +public inline fun WithUser.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T): T? + = chatInviteLinkUnlimitedOrNull() ?.let(block) + +public inline fun WithUser.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult + +public inline fun WithUser.baseChosenInlineResultOrThrow(): BaseChosenInlineResult = this as + dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult + +public inline fun WithUser.ifBaseChosenInlineResult(block: (BaseChosenInlineResult) -> T): T? = + baseChosenInlineResultOrNull() ?.let(block) + +public inline fun WithUser.chosenInlineResultOrNull(): ChosenInlineResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult + +public inline fun WithUser.chosenInlineResultOrThrow(): ChosenInlineResult = this as + dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult + +public inline fun WithUser.ifChosenInlineResult(block: (ChosenInlineResult) -> T): T? = + chosenInlineResultOrNull() ?.let(block) + +public inline fun WithUser.locationChosenInlineResultOrNull(): LocationChosenInlineResult? = this + as? dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult + +public inline fun WithUser.locationChosenInlineResultOrThrow(): LocationChosenInlineResult = this as + dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult + +public inline fun + WithUser.ifLocationChosenInlineResult(block: (LocationChosenInlineResult) -> T): T? = + locationChosenInlineResultOrNull() ?.let(block) + +public inline fun WithUser.baseInlineQueryOrNull(): BaseInlineQuery? = this as? + dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery + +public inline fun WithUser.baseInlineQueryOrThrow(): BaseInlineQuery = this as + dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery + +public inline fun WithUser.ifBaseInlineQuery(block: (BaseInlineQuery) -> T): T? = + baseInlineQueryOrNull() ?.let(block) + +public inline fun WithUser.inlineQueryOrNull(): InlineQuery? = this as? + dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery + +public inline fun WithUser.inlineQueryOrThrow(): InlineQuery = this as + dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery + +public inline fun WithUser.ifInlineQuery(block: (InlineQuery) -> T): T? = inlineQueryOrNull() + ?.let(block) + +public inline fun WithUser.locationInlineQueryOrNull(): LocationInlineQuery? = this as? + dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery + +public inline fun WithUser.locationInlineQueryOrThrow(): LocationInlineQuery = this as + dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery + +public inline fun WithUser.ifLocationInlineQuery(block: (LocationInlineQuery) -> T): T? = + locationInlineQueryOrNull() ?.let(block) + +public inline fun WithUser.chatJoinRequestOrNull(): ChatJoinRequest? = this as? + dev.inmo.tgbotapi.types.chat.ChatJoinRequest + +public inline fun WithUser.chatJoinRequestOrThrow(): ChatJoinRequest = this as + dev.inmo.tgbotapi.types.chat.ChatJoinRequest + +public inline fun WithUser.ifChatJoinRequest(block: (ChatJoinRequest) -> T): T? = + chatJoinRequestOrNull() ?.let(block) + +public inline fun WithUser.administratorChatMemberOrNull(): AdministratorChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember + +public inline fun WithUser.administratorChatMemberOrThrow(): AdministratorChatMember = this as + dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember + +public inline fun WithUser.ifAdministratorChatMember(block: (AdministratorChatMember) -> T): T? + = administratorChatMemberOrNull() ?.let(block) + +public inline fun WithUser.administratorChatMemberImplOrNull(): AdministratorChatMemberImpl? = this + as? dev.inmo.tgbotapi.types.chat.member.AdministratorChatMemberImpl + +public inline fun WithUser.administratorChatMemberImplOrThrow(): AdministratorChatMemberImpl = this + as dev.inmo.tgbotapi.types.chat.member.AdministratorChatMemberImpl + +public inline fun + WithUser.ifAdministratorChatMemberImpl(block: (AdministratorChatMemberImpl) -> T): T? = + administratorChatMemberImplOrNull() ?.let(block) + +public inline fun WithUser.bannedChatMemberOrNull(): BannedChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.BannedChatMember + +public inline fun WithUser.bannedChatMemberOrThrow(): BannedChatMember = this as + dev.inmo.tgbotapi.types.chat.member.BannedChatMember + +public inline fun WithUser.ifBannedChatMember(block: (BannedChatMember) -> T): T? = + bannedChatMemberOrNull() ?.let(block) + +public inline fun WithUser.chatMemberOrNull(): ChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.ChatMember + +public inline fun WithUser.chatMemberOrThrow(): ChatMember = this as + dev.inmo.tgbotapi.types.chat.member.ChatMember + +public inline fun WithUser.ifChatMember(block: (ChatMember) -> T): T? = chatMemberOrNull() + ?.let(block) + +public inline fun WithUser.kickedChatMemberOrNull(): KickedChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.KickedChatMember + +public inline fun WithUser.kickedChatMemberOrThrow(): KickedChatMember = this as + dev.inmo.tgbotapi.types.chat.member.KickedChatMember + +public inline fun WithUser.ifKickedChatMember(block: (KickedChatMember) -> T): T? = + kickedChatMemberOrNull() ?.let(block) + +public inline fun WithUser.leftChatMemberOrNull(): LeftChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.LeftChatMember + +public inline fun WithUser.leftChatMemberOrThrow(): LeftChatMember = this as + dev.inmo.tgbotapi.types.chat.member.LeftChatMember + +public inline fun WithUser.ifLeftChatMember(block: (LeftChatMember) -> T): T? = + leftChatMemberOrNull() ?.let(block) + +public inline fun WithUser.leftChatMemberImplOrNull(): LeftChatMemberImpl? = this as? + dev.inmo.tgbotapi.types.chat.member.LeftChatMemberImpl + +public inline fun WithUser.leftChatMemberImplOrThrow(): LeftChatMemberImpl = this as + dev.inmo.tgbotapi.types.chat.member.LeftChatMemberImpl + +public inline fun WithUser.ifLeftChatMemberImpl(block: (LeftChatMemberImpl) -> T): T? = + leftChatMemberImplOrNull() ?.let(block) + +public inline fun WithUser.memberChatMemberOrNull(): MemberChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.MemberChatMember + +public inline fun WithUser.memberChatMemberOrThrow(): MemberChatMember = this as + dev.inmo.tgbotapi.types.chat.member.MemberChatMember + +public inline fun WithUser.ifMemberChatMember(block: (MemberChatMember) -> T): T? = + memberChatMemberOrNull() ?.let(block) + +public inline fun WithUser.memberChatMemberImplOrNull(): MemberChatMemberImpl? = this as? + dev.inmo.tgbotapi.types.chat.member.MemberChatMemberImpl + +public inline fun WithUser.memberChatMemberImplOrThrow(): MemberChatMemberImpl = this as + dev.inmo.tgbotapi.types.chat.member.MemberChatMemberImpl + +public inline fun WithUser.ifMemberChatMemberImpl(block: (MemberChatMemberImpl) -> T): T? = + memberChatMemberImplOrNull() ?.let(block) + +public inline fun WithUser.ownerChatMemberOrNull(): OwnerChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.OwnerChatMember + +public inline fun WithUser.ownerChatMemberOrThrow(): OwnerChatMember = this as + dev.inmo.tgbotapi.types.chat.member.OwnerChatMember + +public inline fun WithUser.ifOwnerChatMember(block: (OwnerChatMember) -> T): T? = + ownerChatMemberOrNull() ?.let(block) + +public inline fun WithUser.restrictedChatMemberOrNull(): RestrictedChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember + +public inline fun WithUser.restrictedChatMemberOrThrow(): RestrictedChatMember = this as + dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember + +public inline fun WithUser.ifRestrictedChatMember(block: (RestrictedChatMember) -> T): T? = + restrictedChatMemberOrNull() ?.let(block) + +public inline fun WithUser.specialRightsChatMemberOrNull(): SpecialRightsChatMember? = this as? + dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember + +public inline fun WithUser.specialRightsChatMemberOrThrow(): SpecialRightsChatMember = this as + dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember + +public inline fun WithUser.ifSpecialRightsChatMember(block: (SpecialRightsChatMember) -> T): T? + = specialRightsChatMemberOrNull() ?.let(block) + +public inline fun WithUser.leftChatMemberEventOrNull(): LeftChatMemberEvent? = this as? + dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent + +public inline fun WithUser.leftChatMemberEventOrThrow(): LeftChatMemberEvent = this as + dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent + +public inline fun WithUser.ifLeftChatMemberEvent(block: (LeftChatMemberEvent) -> T): T? = + leftChatMemberEventOrNull() ?.let(block) + +public inline fun WithUser.commonGroupEventMessageOrNull(): CommonGroupEventMessage? = + this as? + dev.inmo.tgbotapi.types.message.CommonGroupEventMessage + +public inline fun WithUser.commonGroupEventMessageOrThrow(): CommonGroupEventMessage = + this as + dev.inmo.tgbotapi.types.message.CommonGroupEventMessage + +public inline fun + WithUser.ifCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T): T? = + commonGroupEventMessageOrNull() ?.let(block) + +public inline fun WithUser.commonMediaGroupMessageOrNull(): + CommonMediaGroupMessage? = this as? + dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage + +public inline fun WithUser.commonMediaGroupMessageOrThrow(): + CommonMediaGroupMessage = this as + dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage + +public inline fun + WithUser.ifCommonMediaGroupMessage(block: (CommonMediaGroupMessage) -> T): T? + = commonMediaGroupMessageOrNull() ?.let(block) + +public inline fun WithUser.commonSupergroupEventMessageOrNull(): + CommonSupergroupEventMessage? = this as? + dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage + +public inline fun WithUser.commonSupergroupEventMessageOrThrow(): + CommonSupergroupEventMessage = this as + dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage + +public inline fun + WithUser.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T): + T? = commonSupergroupEventMessageOrNull() ?.let(block) + +public inline fun WithUser.commonGroupContentMessageImplOrNull(): + CommonGroupContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.CommonGroupContentMessageImpl + +public inline fun WithUser.commonGroupContentMessageImplOrThrow(): + CommonGroupContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.CommonGroupContentMessageImpl + +public inline fun + WithUser.ifCommonGroupContentMessageImpl(block: (CommonGroupContentMessageImpl) -> T): + T? = commonGroupContentMessageImplOrNull() ?.let(block) + +public inline fun WithUser.passportMessageOrNull(): PassportMessage? = this as? + dev.inmo.tgbotapi.types.message.PassportMessage + +public inline fun WithUser.passportMessageOrThrow(): PassportMessage = this as + dev.inmo.tgbotapi.types.message.PassportMessage + +public inline fun WithUser.ifPassportMessage(block: (PassportMessage) -> T): T? = + passportMessageOrNull() ?.let(block) + +public inline fun WithUser.privateContentMessageImplOrNull(): + PrivateContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl + +public inline fun WithUser.privateContentMessageImplOrThrow(): + PrivateContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl + +public inline fun + WithUser.ifPrivateContentMessageImpl(block: (PrivateContentMessageImpl) -> T): + T? = privateContentMessageImplOrNull() ?.let(block) + +public inline fun WithUser.fromUserMessageOrNull(): FromUserMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage + +public inline fun WithUser.fromUserMessageOrThrow(): FromUserMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage + +public inline fun WithUser.ifFromUserMessage(block: (FromUserMessage) -> T): T? = + fromUserMessageOrNull() ?.let(block) + +public inline fun WithUser.groupEventMessageOrNull(): GroupEventMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage + +public inline fun WithUser.groupEventMessageOrThrow(): GroupEventMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage + +public inline fun WithUser.ifGroupEventMessage(block: (GroupEventMessage) -> T): T? + = groupEventMessageOrNull() ?.let(block) + +public inline fun WithUser.commonGroupContentMessageOrNull(): + CommonGroupContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage + +public inline fun WithUser.commonGroupContentMessageOrThrow(): + CommonGroupContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage + +public inline fun + WithUser.ifCommonGroupContentMessage(block: (CommonGroupContentMessage) -> T): + T? = commonGroupContentMessageOrNull() ?.let(block) + +public inline fun WithUser.privateContentMessageOrNull(): PrivateContentMessage? = + this as? + dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage + +public inline fun WithUser.privateContentMessageOrThrow(): PrivateContentMessage = + this as + dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage + +public inline fun + WithUser.ifPrivateContentMessage(block: (PrivateContentMessage) -> T): T? = + privateContentMessageOrNull() ?.let(block) + +public inline fun WithUser.supergroupEventMessageOrNull(): SupergroupEventMessage? + = this as? + dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage + +public inline fun WithUser.supergroupEventMessageOrThrow(): SupergroupEventMessage + = this as + dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage + +public inline fun + WithUser.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T): T? = + supergroupEventMessageOrNull() ?.let(block) + +public inline fun WithUser.preCheckoutQueryOrNull(): PreCheckoutQuery? = this as? + dev.inmo.tgbotapi.types.payments.PreCheckoutQuery + +public inline fun WithUser.preCheckoutQueryOrThrow(): PreCheckoutQuery = this as + dev.inmo.tgbotapi.types.payments.PreCheckoutQuery + +public inline fun WithUser.ifPreCheckoutQuery(block: (PreCheckoutQuery) -> T): T? = + preCheckoutQueryOrNull() ?.let(block) + +public inline fun WithUser.shippingQueryOrNull(): ShippingQuery? = this as? + dev.inmo.tgbotapi.types.payments.ShippingQuery + +public inline fun WithUser.shippingQueryOrThrow(): ShippingQuery = this as + dev.inmo.tgbotapi.types.payments.ShippingQuery + +public inline fun WithUser.ifShippingQuery(block: (ShippingQuery) -> T): T? = + shippingQueryOrNull() ?.let(block) + +public inline fun WithUser.pollAnswerOrNull(): PollAnswer? = this as? + dev.inmo.tgbotapi.types.polls.PollAnswer + +public inline fun WithUser.pollAnswerOrThrow(): PollAnswer = this as + dev.inmo.tgbotapi.types.polls.PollAnswer + +public inline fun WithUser.ifPollAnswer(block: (PollAnswer) -> T): T? = pollAnswerOrNull() + ?.let(block) + +public inline fun WithUser.callbackQueryOrNull(): CallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.CallbackQuery + +public inline fun WithUser.callbackQueryOrThrow(): CallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.CallbackQuery + +public inline fun WithUser.ifCallbackQuery(block: (CallbackQuery) -> T): T? = + callbackQueryOrNull() ?.let(block) + +public inline fun WithUser.unknownCallbackQueryTypeOrNull(): UnknownCallbackQueryType? = this as? + dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType + +public inline fun WithUser.unknownCallbackQueryTypeOrThrow(): UnknownCallbackQueryType = this as + dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType + +public inline fun WithUser.ifUnknownCallbackQueryType(block: (UnknownCallbackQueryType) -> T): + T? = unknownCallbackQueryTypeOrNull() ?.let(block) + +public inline fun WithUser.dataCallbackQueryOrNull(): DataCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery + +public inline fun WithUser.dataCallbackQueryOrThrow(): DataCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery + +public inline fun WithUser.ifDataCallbackQuery(block: (DataCallbackQuery) -> T): T? = + dataCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.gameShortNameCallbackQueryOrNull(): GameShortNameCallbackQuery? = this + as? dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery + +public inline fun WithUser.gameShortNameCallbackQueryOrThrow(): GameShortNameCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery + +public inline fun + WithUser.ifGameShortNameCallbackQuery(block: (GameShortNameCallbackQuery) -> T): T? = + gameShortNameCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.inlineMessageIdCallbackQueryOrNull(): InlineMessageIdCallbackQuery? = + this as? dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery + +public inline fun WithUser.inlineMessageIdCallbackQueryOrThrow(): InlineMessageIdCallbackQuery = + this as dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery + +public inline fun + WithUser.ifInlineMessageIdCallbackQuery(block: (InlineMessageIdCallbackQuery) -> T): T? = + inlineMessageIdCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.inlineMessageIdDataCallbackQueryOrNull(): + InlineMessageIdDataCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery + +public inline fun WithUser.inlineMessageIdDataCallbackQueryOrThrow(): + InlineMessageIdDataCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery + +public inline fun + WithUser.ifInlineMessageIdDataCallbackQuery(block: (InlineMessageIdDataCallbackQuery) -> T): T? + = inlineMessageIdDataCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.inlineMessageIdGameShortNameCallbackQueryOrNull(): + InlineMessageIdGameShortNameCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery + +public inline fun WithUser.inlineMessageIdGameShortNameCallbackQueryOrThrow(): + InlineMessageIdGameShortNameCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery + +public inline fun + WithUser.ifInlineMessageIdGameShortNameCallbackQuery(block: (InlineMessageIdGameShortNameCallbackQuery) -> T): + T? = inlineMessageIdGameShortNameCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.messageCallbackQueryOrNull(): MessageCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery + +public inline fun WithUser.messageCallbackQueryOrThrow(): MessageCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery + +public inline fun WithUser.ifMessageCallbackQuery(block: (MessageCallbackQuery) -> T): T? = + messageCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.messageDataCallbackQueryOrNull(): MessageDataCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery + +public inline fun WithUser.messageDataCallbackQueryOrThrow(): MessageDataCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery + +public inline fun WithUser.ifMessageDataCallbackQuery(block: (MessageDataCallbackQuery) -> T): + T? = messageDataCallbackQueryOrNull() ?.let(block) + +public inline fun WithUser.messageGameShortNameCallbackQueryOrNull(): + MessageGameShortNameCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery + +public inline fun WithUser.messageGameShortNameCallbackQueryOrThrow(): + MessageGameShortNameCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery + +public inline fun + WithUser.ifMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T): + T? = messageGameShortNameCallbackQueryOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultArticleOrNull(): InlineQueryResultArticle? = + this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle + +public inline fun InlineQueryResult.inlineQueryResultArticleOrThrow(): InlineQueryResultArticle = + this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle + +public inline fun + InlineQueryResult.ifInlineQueryResultArticle(block: (InlineQueryResultArticle) -> T): T? = + inlineQueryResultArticleOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultAudioCachedImplOrNull(): + InlineQueryResultAudioCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultAudioCachedImplOrThrow(): + InlineQueryResultAudioCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultAudioCachedImpl(block: (InlineQueryResultAudioCachedImpl) -> T): + T? = inlineQueryResultAudioCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultAudioImplOrNull(): InlineQueryResultAudioImpl? + = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioImpl + +public inline fun InlineQueryResult.inlineQueryResultAudioImplOrThrow(): InlineQueryResultAudioImpl + = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultAudioImpl(block: (InlineQueryResultAudioImpl) -> T): T? = + inlineQueryResultAudioImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultContactOrNull(): InlineQueryResultContact? = + this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultContact + +public inline fun InlineQueryResult.inlineQueryResultContactOrThrow(): InlineQueryResultContact = + this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultContact + +public inline fun + InlineQueryResult.ifInlineQueryResultContact(block: (InlineQueryResultContact) -> T): T? = + inlineQueryResultContactOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultDocumentCachedImplOrNull(): + InlineQueryResultDocumentCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultDocumentCachedImplOrThrow(): + InlineQueryResultDocumentCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultDocumentCachedImpl(block: (InlineQueryResultDocumentCachedImpl) -> T): + T? = inlineQueryResultDocumentCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultDocumentImplOrNull(): + InlineQueryResultDocumentImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentImpl + +public inline fun InlineQueryResult.inlineQueryResultDocumentImplOrThrow(): + InlineQueryResultDocumentImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultDocumentImpl(block: (InlineQueryResultDocumentImpl) -> T): + T? = inlineQueryResultDocumentImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultGameOrNull(): InlineQueryResultGame? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGame + +public inline fun InlineQueryResult.inlineQueryResultGameOrThrow(): InlineQueryResultGame = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGame + +public inline fun + InlineQueryResult.ifInlineQueryResultGame(block: (InlineQueryResultGame) -> T): T? = + inlineQueryResultGameOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultGifCachedImplOrNull(): + InlineQueryResultGifCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultGifCachedImplOrThrow(): + InlineQueryResultGifCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultGifCachedImpl(block: (InlineQueryResultGifCachedImpl) -> T): + T? = inlineQueryResultGifCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultGifImplOrNull(): InlineQueryResultGifImpl? = + this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifImpl + +public inline fun InlineQueryResult.inlineQueryResultGifImplOrThrow(): InlineQueryResultGifImpl = + this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultGifImpl(block: (InlineQueryResultGifImpl) -> T): T? = + inlineQueryResultGifImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultLocationOrNull(): InlineQueryResultLocation? = + this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultLocation + +public inline fun InlineQueryResult.inlineQueryResultLocationOrThrow(): InlineQueryResultLocation = + this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultLocation + +public inline fun + InlineQueryResult.ifInlineQueryResultLocation(block: (InlineQueryResultLocation) -> T): T? = + inlineQueryResultLocationOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedImplOrNull(): + InlineQueryResultMpeg4GifCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedImplOrThrow(): + InlineQueryResultMpeg4GifCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultMpeg4GifCachedImpl(block: (InlineQueryResultMpeg4GifCachedImpl) -> T): + T? = inlineQueryResultMpeg4GifCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifImplOrNull(): + InlineQueryResultMpeg4GifImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifImpl + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifImplOrThrow(): + InlineQueryResultMpeg4GifImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultMpeg4GifImpl(block: (InlineQueryResultMpeg4GifImpl) -> T): + T? = inlineQueryResultMpeg4GifImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultPhotoCachedImplOrNull(): + InlineQueryResultPhotoCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultPhotoCachedImplOrThrow(): + InlineQueryResultPhotoCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultPhotoCachedImpl(block: (InlineQueryResultPhotoCachedImpl) -> T): + T? = inlineQueryResultPhotoCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultPhotoImplOrNull(): InlineQueryResultPhotoImpl? + = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoImpl + +public inline fun InlineQueryResult.inlineQueryResultPhotoImplOrThrow(): InlineQueryResultPhotoImpl + = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultPhotoImpl(block: (InlineQueryResultPhotoImpl) -> T): T? = + inlineQueryResultPhotoImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultStickerCachedOrNull(): + InlineQueryResultStickerCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultStickerCached + +public inline fun InlineQueryResult.inlineQueryResultStickerCachedOrThrow(): + InlineQueryResultStickerCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultStickerCached + +public inline fun + InlineQueryResult.ifInlineQueryResultStickerCached(block: (InlineQueryResultStickerCached) -> T): + T? = inlineQueryResultStickerCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVenueOrNull(): InlineQueryResultVenue? = this + as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVenue + +public inline fun InlineQueryResult.inlineQueryResultVenueOrThrow(): InlineQueryResultVenue = this + as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVenue + +public inline fun + InlineQueryResult.ifInlineQueryResultVenue(block: (InlineQueryResultVenue) -> T): T? = + inlineQueryResultVenueOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVideoCachedImplOrNull(): + InlineQueryResultVideoCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultVideoCachedImplOrThrow(): + InlineQueryResultVideoCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultVideoCachedImpl(block: (InlineQueryResultVideoCachedImpl) -> T): + T? = inlineQueryResultVideoCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVideoImplOrNull(): InlineQueryResultVideoImpl? + = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoImpl + +public inline fun InlineQueryResult.inlineQueryResultVideoImplOrThrow(): InlineQueryResultVideoImpl + = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultVideoImpl(block: (InlineQueryResultVideoImpl) -> T): T? = + inlineQueryResultVideoImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVoiceCachedImplOrNull(): + InlineQueryResultVoiceCachedImpl? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceCachedImpl + +public inline fun InlineQueryResult.inlineQueryResultVoiceCachedImplOrThrow(): + InlineQueryResultVoiceCachedImpl = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceCachedImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultVoiceCachedImpl(block: (InlineQueryResultVoiceCachedImpl) -> T): + T? = inlineQueryResultVoiceCachedImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVoiceImplOrNull(): InlineQueryResultVoiceImpl? + = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceImpl + +public inline fun InlineQueryResult.inlineQueryResultVoiceImplOrThrow(): InlineQueryResultVoiceImpl + = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceImpl + +public inline fun + InlineQueryResult.ifInlineQueryResultVoiceImpl(block: (InlineQueryResultVoiceImpl) -> T): T? = + inlineQueryResultVoiceImplOrNull() ?.let(block) + +public inline fun InlineQueryResult.describedInlineQueryResultOrNull(): DescribedInlineQueryResult? + = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.DescribedInlineQueryResult + +public inline fun InlineQueryResult.describedInlineQueryResultOrThrow(): DescribedInlineQueryResult + = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.DescribedInlineQueryResult + +public inline fun + InlineQueryResult.ifDescribedInlineQueryResult(block: (DescribedInlineQueryResult) -> T): T? = + describedInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.fileInlineQueryResultOrNull(): FileInlineQueryResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.FileInlineQueryResult + +public inline fun InlineQueryResult.fileInlineQueryResultOrThrow(): FileInlineQueryResult = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.FileInlineQueryResult + +public inline fun + InlineQueryResult.ifFileInlineQueryResult(block: (FileInlineQueryResult) -> T): T? = + fileInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.optionallyTitledInlineQueryResultOrNull(): + OptionallyTitledInlineQueryResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.OptionallyTitledInlineQueryResult + +public inline fun InlineQueryResult.optionallyTitledInlineQueryResultOrThrow(): + OptionallyTitledInlineQueryResult = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.OptionallyTitledInlineQueryResult + +public inline fun + InlineQueryResult.ifOptionallyTitledInlineQueryResult(block: (OptionallyTitledInlineQueryResult) -> T): + T? = optionallyTitledInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.sizedInlineQueryResultOrNull(): SizedInlineQueryResult? = this + as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.SizedInlineQueryResult + +public inline fun InlineQueryResult.sizedInlineQueryResultOrThrow(): SizedInlineQueryResult = this + as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.SizedInlineQueryResult + +public inline fun + InlineQueryResult.ifSizedInlineQueryResult(block: (SizedInlineQueryResult) -> T): T? = + sizedInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.thumbSizedInlineQueryResultOrNull(): + ThumbSizedInlineQueryResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbSizedInlineQueryResult + +public inline fun InlineQueryResult.thumbSizedInlineQueryResultOrThrow(): + ThumbSizedInlineQueryResult = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbSizedInlineQueryResult + +public inline fun + InlineQueryResult.ifThumbSizedInlineQueryResult(block: (ThumbSizedInlineQueryResult) -> T): T? = + thumbSizedInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.thumbedInlineQueryResultOrNull(): ThumbedInlineQueryResult? = + this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedInlineQueryResult + +public inline fun InlineQueryResult.thumbedInlineQueryResultOrThrow(): ThumbedInlineQueryResult = + this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedInlineQueryResult + +public inline fun + InlineQueryResult.ifThumbedInlineQueryResult(block: (ThumbedInlineQueryResult) -> T): T? = + thumbedInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.thumbedWithMimeTypeInlineQueryResultOrNull(): + ThumbedWithMimeTypeInlineQueryResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedWithMimeTypeInlineQueryResult + +public inline fun InlineQueryResult.thumbedWithMimeTypeInlineQueryResultOrThrow(): + ThumbedWithMimeTypeInlineQueryResult = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedWithMimeTypeInlineQueryResult + +public inline fun + InlineQueryResult.ifThumbedWithMimeTypeInlineQueryResult(block: (ThumbedWithMimeTypeInlineQueryResult) -> T): + T? = thumbedWithMimeTypeInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.titledInlineQueryResultOrNull(): TitledInlineQueryResult? = this + as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.TitledInlineQueryResult + +public inline fun InlineQueryResult.titledInlineQueryResultOrThrow(): TitledInlineQueryResult = this + as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.TitledInlineQueryResult + +public inline fun + InlineQueryResult.ifTitledInlineQueryResult(block: (TitledInlineQueryResult) -> T): T? = + titledInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.urlInlineQueryResultOrNull(): UrlInlineQueryResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.UrlInlineQueryResult + +public inline fun InlineQueryResult.urlInlineQueryResultOrThrow(): UrlInlineQueryResult = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.UrlInlineQueryResult + +public inline fun InlineQueryResult.ifUrlInlineQueryResult(block: (UrlInlineQueryResult) -> T): + T? = urlInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrNull(): + WithInputMessageContentInlineQueryResult? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult + +public inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrThrow(): + WithInputMessageContentInlineQueryResult = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult + +public inline fun + InlineQueryResult.ifWithInputMessageContentInlineQueryResult(block: (WithInputMessageContentInlineQueryResult) -> T): + T? = withInputMessageContentInlineQueryResultOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultAudioOrNull(): InlineQueryResultAudio? = this + as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio + +public inline fun InlineQueryResult.inlineQueryResultAudioOrThrow(): InlineQueryResultAudio = this + as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio + +public inline fun + InlineQueryResult.ifInlineQueryResultAudio(block: (InlineQueryResultAudio) -> T): T? = + inlineQueryResultAudioOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultAudioCachedOrNull(): + InlineQueryResultAudioCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached + +public inline fun InlineQueryResult.inlineQueryResultAudioCachedOrThrow(): + InlineQueryResultAudioCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached + +public inline fun + InlineQueryResult.ifInlineQueryResultAudioCached(block: (InlineQueryResultAudioCached) -> T): T? + = inlineQueryResultAudioCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultAudioCommonOrNull(): + InlineQueryResultAudioCommon? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCommon + +public inline fun InlineQueryResult.inlineQueryResultAudioCommonOrThrow(): + InlineQueryResultAudioCommon = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultAudioCommon(block: (InlineQueryResultAudioCommon) -> T): T? + = inlineQueryResultAudioCommonOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultDocumentOrNull(): InlineQueryResultDocument? = + this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocument + +public inline fun InlineQueryResult.inlineQueryResultDocumentOrThrow(): InlineQueryResultDocument = + this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocument + +public inline fun + InlineQueryResult.ifInlineQueryResultDocument(block: (InlineQueryResultDocument) -> T): T? = + inlineQueryResultDocumentOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultDocumentCachedOrNull(): + InlineQueryResultDocumentCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCached + +public inline fun InlineQueryResult.inlineQueryResultDocumentCachedOrThrow(): + InlineQueryResultDocumentCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCached + +public inline fun + InlineQueryResult.ifInlineQueryResultDocumentCached(block: (InlineQueryResultDocumentCached) -> T): + T? = inlineQueryResultDocumentCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultDocumentCommonOrNull(): + InlineQueryResultDocumentCommon? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCommon + +public inline fun InlineQueryResult.inlineQueryResultDocumentCommonOrThrow(): + InlineQueryResultDocumentCommon = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultDocumentCommon(block: (InlineQueryResultDocumentCommon) -> T): + T? = inlineQueryResultDocumentCommonOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultGifOrNull(): InlineQueryResultGif? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif + +public inline fun InlineQueryResult.inlineQueryResultGifOrThrow(): InlineQueryResultGif = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif + +public inline fun InlineQueryResult.ifInlineQueryResultGif(block: (InlineQueryResultGif) -> T): + T? = inlineQueryResultGifOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultGifCachedOrNull(): InlineQueryResultGifCached? + = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached + +public inline fun InlineQueryResult.inlineQueryResultGifCachedOrThrow(): InlineQueryResultGifCached + = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached + +public inline fun + InlineQueryResult.ifInlineQueryResultGifCached(block: (InlineQueryResultGifCached) -> T): T? = + inlineQueryResultGifCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultGifCommonOrNull(): InlineQueryResultGifCommon? + = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCommon + +public inline fun InlineQueryResult.inlineQueryResultGifCommonOrThrow(): InlineQueryResultGifCommon + = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultGifCommon(block: (InlineQueryResultGifCommon) -> T): T? = + inlineQueryResultGifCommonOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifOrNull(): InlineQueryResultMpeg4Gif? = + this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifOrThrow(): InlineQueryResultMpeg4Gif = + this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif + +public inline fun + InlineQueryResult.ifInlineQueryResultMpeg4Gif(block: (InlineQueryResultMpeg4Gif) -> T): T? = + inlineQueryResultMpeg4GifOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedOrNull(): + InlineQueryResultMpeg4GifCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCached + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedOrThrow(): + InlineQueryResultMpeg4GifCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCached + +public inline fun + InlineQueryResult.ifInlineQueryResultMpeg4GifCached(block: (InlineQueryResultMpeg4GifCached) -> T): + T? = inlineQueryResultMpeg4GifCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCommonOrNull(): + InlineQueryResultMpeg4GifCommon? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCommon + +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCommonOrThrow(): + InlineQueryResultMpeg4GifCommon = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultMpeg4GifCommon(block: (InlineQueryResultMpeg4GifCommon) -> T): + T? = inlineQueryResultMpeg4GifCommonOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultPhotoOrNull(): InlineQueryResultPhoto? = this + as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhoto + +public inline fun InlineQueryResult.inlineQueryResultPhotoOrThrow(): InlineQueryResultPhoto = this + as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhoto + +public inline fun + InlineQueryResult.ifInlineQueryResultPhoto(block: (InlineQueryResultPhoto) -> T): T? = + inlineQueryResultPhotoOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultPhotoCachedOrNull(): + InlineQueryResultPhotoCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCached + +public inline fun InlineQueryResult.inlineQueryResultPhotoCachedOrThrow(): + InlineQueryResultPhotoCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCached + +public inline fun + InlineQueryResult.ifInlineQueryResultPhotoCached(block: (InlineQueryResultPhotoCached) -> T): T? + = inlineQueryResultPhotoCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultPhotoCommonOrNull(): + InlineQueryResultPhotoCommon? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCommon + +public inline fun InlineQueryResult.inlineQueryResultPhotoCommonOrThrow(): + InlineQueryResultPhotoCommon = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultPhotoCommon(block: (InlineQueryResultPhotoCommon) -> T): T? + = inlineQueryResultPhotoCommonOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVideoOrNull(): InlineQueryResultVideo? = this + as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo + +public inline fun InlineQueryResult.inlineQueryResultVideoOrThrow(): InlineQueryResultVideo = this + as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo + +public inline fun + InlineQueryResult.ifInlineQueryResultVideo(block: (InlineQueryResultVideo) -> T): T? = + inlineQueryResultVideoOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVideoCachedOrNull(): + InlineQueryResultVideoCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCached + +public inline fun InlineQueryResult.inlineQueryResultVideoCachedOrThrow(): + InlineQueryResultVideoCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCached + +public inline fun + InlineQueryResult.ifInlineQueryResultVideoCached(block: (InlineQueryResultVideoCached) -> T): T? + = inlineQueryResultVideoCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVideoCommonOrNull(): + InlineQueryResultVideoCommon? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCommon + +public inline fun InlineQueryResult.inlineQueryResultVideoCommonOrThrow(): + InlineQueryResultVideoCommon = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultVideoCommon(block: (InlineQueryResultVideoCommon) -> T): T? + = inlineQueryResultVideoCommonOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVoiceOrNull(): InlineQueryResultVoice? = this + as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice + +public inline fun InlineQueryResult.inlineQueryResultVoiceOrThrow(): InlineQueryResultVoice = this + as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice + +public inline fun + InlineQueryResult.ifInlineQueryResultVoice(block: (InlineQueryResultVoice) -> T): T? = + inlineQueryResultVoiceOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVoiceCachedOrNull(): + InlineQueryResultVoiceCached? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached + +public inline fun InlineQueryResult.inlineQueryResultVoiceCachedOrThrow(): + InlineQueryResultVoiceCached = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached + +public inline fun + InlineQueryResult.ifInlineQueryResultVoiceCached(block: (InlineQueryResultVoiceCached) -> T): T? + = inlineQueryResultVoiceCachedOrNull() ?.let(block) + +public inline fun InlineQueryResult.inlineQueryResultVoiceCommonOrNull(): + InlineQueryResultVoiceCommon? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCommon + +public inline fun InlineQueryResult.inlineQueryResultVoiceCommonOrThrow(): + InlineQueryResultVoiceCommon = this as + dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCommon + +public inline fun + InlineQueryResult.ifInlineQueryResultVoiceCommon(block: (InlineQueryResultVoiceCommon) -> T): T? + = inlineQueryResultVoiceCommonOrNull() ?.let(block) + +public inline fun InputMessageContent.inputContactMessageContentOrNull(): + InputContactMessageContent? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputContactMessageContent + +public inline fun InputMessageContent.inputContactMessageContentOrThrow(): + InputContactMessageContent = this as + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputContactMessageContent + +public inline fun + InputMessageContent.ifInputContactMessageContent(block: (InputContactMessageContent) -> T): T? = + inputContactMessageContentOrNull() ?.let(block) + +public inline fun InputMessageContent.inputInvoiceMessageContentOrNull(): + InputInvoiceMessageContent? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent + +public inline fun InputMessageContent.inputInvoiceMessageContentOrThrow(): + InputInvoiceMessageContent = this as + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent + +public inline fun + InputMessageContent.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T): T? = + inputInvoiceMessageContentOrNull() ?.let(block) + +public inline fun InputMessageContent.inputLocationMessageContentOrNull(): + InputLocationMessageContent? = this as? + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputLocationMessageContent + +public inline fun InputMessageContent.inputLocationMessageContentOrThrow(): + InputLocationMessageContent = this as + dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputLocationMessageContent + +public inline fun + InputMessageContent.ifInputLocationMessageContent(block: (InputLocationMessageContent) -> T): T? + = inputLocationMessageContentOrNull() ?.let(block) + +public inline fun InputMessageContent.inputTextMessageContentOrNull(): InputTextMessageContent? = + this as? dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent + +public inline fun InputMessageContent.inputTextMessageContentOrThrow(): InputTextMessageContent = + this as dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent + +public inline fun + InputMessageContent.ifInputTextMessageContent(block: (InputTextMessageContent) -> T): T? = + inputTextMessageContentOrNull() ?.let(block) + +public inline fun InputMessageContent.inputVenueMessageContentOrNull(): InputVenueMessageContent? = + this as? dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessageContent + +public inline fun InputMessageContent.inputVenueMessageContentOrThrow(): InputVenueMessageContent = + this as dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessageContent + +public inline fun + InputMessageContent.ifInputVenueMessageContent(block: (InputVenueMessageContent) -> T): T? = + inputVenueMessageContentOrNull() ?.let(block) + +public inline fun BotAction.typingActionOrNull(): TypingAction? = this as? + dev.inmo.tgbotapi.types.actions.TypingAction + +public inline fun BotAction.typingActionOrThrow(): TypingAction = this as + dev.inmo.tgbotapi.types.actions.TypingAction + +public inline fun BotAction.ifTypingAction(block: (TypingAction) -> T): T? = + typingActionOrNull() ?.let(block) + +public inline fun BotAction.uploadPhotoActionOrNull(): UploadPhotoAction? = this as? + dev.inmo.tgbotapi.types.actions.UploadPhotoAction + +public inline fun BotAction.uploadPhotoActionOrThrow(): UploadPhotoAction = this as + dev.inmo.tgbotapi.types.actions.UploadPhotoAction + +public inline fun BotAction.ifUploadPhotoAction(block: (UploadPhotoAction) -> T): T? = + uploadPhotoActionOrNull() ?.let(block) + +public inline fun BotAction.recordVideoActionOrNull(): RecordVideoAction? = this as? + dev.inmo.tgbotapi.types.actions.RecordVideoAction + +public inline fun BotAction.recordVideoActionOrThrow(): RecordVideoAction = this as + dev.inmo.tgbotapi.types.actions.RecordVideoAction + +public inline fun BotAction.ifRecordVideoAction(block: (RecordVideoAction) -> T): T? = + recordVideoActionOrNull() ?.let(block) + +public inline fun BotAction.uploadVideoActionOrNull(): UploadVideoAction? = this as? + dev.inmo.tgbotapi.types.actions.UploadVideoAction + +public inline fun BotAction.uploadVideoActionOrThrow(): UploadVideoAction = this as + dev.inmo.tgbotapi.types.actions.UploadVideoAction + +public inline fun BotAction.ifUploadVideoAction(block: (UploadVideoAction) -> T): T? = + uploadVideoActionOrNull() ?.let(block) + +public inline fun BotAction.recordVoiceActionOrNull(): RecordVoiceAction? = this as? + dev.inmo.tgbotapi.types.actions.RecordVoiceAction + +public inline fun BotAction.recordVoiceActionOrThrow(): RecordVoiceAction = this as + dev.inmo.tgbotapi.types.actions.RecordVoiceAction + +public inline fun BotAction.ifRecordVoiceAction(block: (RecordVoiceAction) -> T): T? = + recordVoiceActionOrNull() ?.let(block) + +public inline fun BotAction.uploadVoiceActionOrNull(): UploadVoiceAction? = this as? + dev.inmo.tgbotapi.types.actions.UploadVoiceAction + +public inline fun BotAction.uploadVoiceActionOrThrow(): UploadVoiceAction = this as + dev.inmo.tgbotapi.types.actions.UploadVoiceAction + +public inline fun BotAction.ifUploadVoiceAction(block: (UploadVoiceAction) -> T): T? = + uploadVoiceActionOrNull() ?.let(block) + +public inline fun BotAction.uploadDocumentActionOrNull(): UploadDocumentAction? = this as? + dev.inmo.tgbotapi.types.actions.UploadDocumentAction + +public inline fun BotAction.uploadDocumentActionOrThrow(): UploadDocumentAction = this as + dev.inmo.tgbotapi.types.actions.UploadDocumentAction + +public inline fun BotAction.ifUploadDocumentAction(block: (UploadDocumentAction) -> T): T? = + uploadDocumentActionOrNull() ?.let(block) + +public inline fun BotAction.findLocationActionOrNull(): FindLocationAction? = this as? + dev.inmo.tgbotapi.types.actions.FindLocationAction + +public inline fun BotAction.findLocationActionOrThrow(): FindLocationAction = this as + dev.inmo.tgbotapi.types.actions.FindLocationAction + +public inline fun BotAction.ifFindLocationAction(block: (FindLocationAction) -> T): T? = + findLocationActionOrNull() ?.let(block) + +public inline fun BotAction.recordVideoNoteActionOrNull(): RecordVideoNoteAction? = this as? + dev.inmo.tgbotapi.types.actions.RecordVideoNoteAction + +public inline fun BotAction.recordVideoNoteActionOrThrow(): RecordVideoNoteAction = this as + dev.inmo.tgbotapi.types.actions.RecordVideoNoteAction + +public inline fun BotAction.ifRecordVideoNoteAction(block: (RecordVideoNoteAction) -> T): T? = + recordVideoNoteActionOrNull() ?.let(block) + +public inline fun BotAction.uploadVideoNoteActionOrNull(): UploadVideoNoteAction? = this as? + dev.inmo.tgbotapi.types.actions.UploadVideoNoteAction + +public inline fun BotAction.uploadVideoNoteActionOrThrow(): UploadVideoNoteAction = this as + dev.inmo.tgbotapi.types.actions.UploadVideoNoteAction + +public inline fun BotAction.ifUploadVideoNoteAction(block: (UploadVideoNoteAction) -> T): T? = + uploadVideoNoteActionOrNull() ?.let(block) + +public inline fun BotAction.chooseStickerActionOrNull(): ChooseStickerAction? = this as? + dev.inmo.tgbotapi.types.actions.ChooseStickerAction + +public inline fun BotAction.chooseStickerActionOrThrow(): ChooseStickerAction = this as + dev.inmo.tgbotapi.types.actions.ChooseStickerAction + +public inline fun BotAction.ifChooseStickerAction(block: (ChooseStickerAction) -> T): T? = + chooseStickerActionOrNull() ?.let(block) + +public inline fun BotAction.customBotActionOrNull(): CustomBotAction? = this as? + dev.inmo.tgbotapi.types.actions.CustomBotAction + +public inline fun BotAction.customBotActionOrThrow(): CustomBotAction = this as + dev.inmo.tgbotapi.types.actions.CustomBotAction + +public inline fun BotAction.ifCustomBotAction(block: (CustomBotAction) -> T): T? = + customBotActionOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.unknownInlineKeyboardButtonOrNull(): + UnknownInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.UnknownInlineKeyboardButton + +public inline fun InlineKeyboardButton.unknownInlineKeyboardButtonOrThrow(): + UnknownInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.UnknownInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifUnknownInlineKeyboardButton(block: (UnknownInlineKeyboardButton) -> T): + T? = unknownInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.payInlineKeyboardButtonOrNull(): PayInlineKeyboardButton? = + this as? dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.PayInlineKeyboardButton + +public inline fun InlineKeyboardButton.payInlineKeyboardButtonOrThrow(): PayInlineKeyboardButton = + this as dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.PayInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifPayInlineKeyboardButton(block: (PayInlineKeyboardButton) -> T): T? = + payInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.callbackDataInlineKeyboardButtonOrNull(): + CallbackDataInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackDataInlineKeyboardButton + +public inline fun InlineKeyboardButton.callbackDataInlineKeyboardButtonOrThrow(): + CallbackDataInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackDataInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifCallbackDataInlineKeyboardButton(block: (CallbackDataInlineKeyboardButton) -> T): + T? = callbackDataInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.callbackGameInlineKeyboardButtonOrNull(): + CallbackGameInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackGameInlineKeyboardButton + +public inline fun InlineKeyboardButton.callbackGameInlineKeyboardButtonOrThrow(): + CallbackGameInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackGameInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifCallbackGameInlineKeyboardButton(block: (CallbackGameInlineKeyboardButton) -> T): + T? = callbackGameInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.loginURLInlineKeyboardButtonOrNull(): + LoginURLInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.LoginURLInlineKeyboardButton + +public inline fun InlineKeyboardButton.loginURLInlineKeyboardButtonOrThrow(): + LoginURLInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.LoginURLInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifLoginURLInlineKeyboardButton(block: (LoginURLInlineKeyboardButton) -> T): + T? = loginURLInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.switchInlineQueryCurrentChatInlineKeyboardButtonOrNull(): + SwitchInlineQueryCurrentChatInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryCurrentChatInlineKeyboardButton + +public inline fun InlineKeyboardButton.switchInlineQueryCurrentChatInlineKeyboardButtonOrThrow(): + SwitchInlineQueryCurrentChatInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryCurrentChatInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifSwitchInlineQueryCurrentChatInlineKeyboardButton(block: (SwitchInlineQueryCurrentChatInlineKeyboardButton) -> T): + T? = switchInlineQueryCurrentChatInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.switchInlineQueryInlineKeyboardButtonOrNull(): + SwitchInlineQueryInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryInlineKeyboardButton + +public inline fun InlineKeyboardButton.switchInlineQueryInlineKeyboardButtonOrThrow(): + SwitchInlineQueryInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifSwitchInlineQueryInlineKeyboardButton(block: (SwitchInlineQueryInlineKeyboardButton) -> T): + T? = switchInlineQueryInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.uRLInlineKeyboardButtonOrNull(): URLInlineKeyboardButton? = + this as? dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.URLInlineKeyboardButton + +public inline fun InlineKeyboardButton.uRLInlineKeyboardButtonOrThrow(): URLInlineKeyboardButton = + this as dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.URLInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifURLInlineKeyboardButton(block: (URLInlineKeyboardButton) -> T): T? = + uRLInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun InlineKeyboardButton.webAppInlineKeyboardButtonOrNull(): + WebAppInlineKeyboardButton? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.WebAppInlineKeyboardButton + +public inline fun InlineKeyboardButton.webAppInlineKeyboardButtonOrThrow(): + WebAppInlineKeyboardButton = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.WebAppInlineKeyboardButton + +public inline fun + InlineKeyboardButton.ifWebAppInlineKeyboardButton(block: (WebAppInlineKeyboardButton) -> T): T? + = webAppInlineKeyboardButtonOrNull() ?.let(block) + +public inline fun KeyboardMarkup.inlineKeyboardMarkupOrNull(): InlineKeyboardMarkup? = this as? + dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup + +public inline fun KeyboardMarkup.inlineKeyboardMarkupOrThrow(): InlineKeyboardMarkup = this as + dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup + +public inline fun KeyboardMarkup.ifInlineKeyboardMarkup(block: (InlineKeyboardMarkup) -> T): T? + = inlineKeyboardMarkupOrNull() ?.let(block) + +public inline fun KeyboardMarkup.replyForceOrNull(): ReplyForce? = this as? + dev.inmo.tgbotapi.types.buttons.ReplyForce + +public inline fun KeyboardMarkup.replyForceOrThrow(): ReplyForce = this as + dev.inmo.tgbotapi.types.buttons.ReplyForce + +public inline fun KeyboardMarkup.ifReplyForce(block: (ReplyForce) -> T): T? = replyForceOrNull() + ?.let(block) + +public inline fun KeyboardMarkup.replyKeyboardMarkupOrNull(): ReplyKeyboardMarkup? = this as? + dev.inmo.tgbotapi.types.buttons.ReplyKeyboardMarkup + +public inline fun KeyboardMarkup.replyKeyboardMarkupOrThrow(): ReplyKeyboardMarkup = this as + dev.inmo.tgbotapi.types.buttons.ReplyKeyboardMarkup + +public inline fun KeyboardMarkup.ifReplyKeyboardMarkup(block: (ReplyKeyboardMarkup) -> T): T? = + replyKeyboardMarkupOrNull() ?.let(block) + +public inline fun KeyboardMarkup.replyKeyboardRemoveOrNull(): ReplyKeyboardRemove? = this as? + dev.inmo.tgbotapi.types.buttons.ReplyKeyboardRemove + +public inline fun KeyboardMarkup.replyKeyboardRemoveOrThrow(): ReplyKeyboardRemove = this as + dev.inmo.tgbotapi.types.buttons.ReplyKeyboardRemove + +public inline fun KeyboardMarkup.ifReplyKeyboardRemove(block: (ReplyKeyboardRemove) -> T): T? = + replyKeyboardRemoveOrNull() ?.let(block) + +public inline fun Chat.channelChatOrNull(): ChannelChat? = this as? + dev.inmo.tgbotapi.types.chat.ChannelChat + +public inline fun Chat.channelChatOrThrow(): ChannelChat = this as + dev.inmo.tgbotapi.types.chat.ChannelChat + +public inline fun Chat.ifChannelChat(block: (ChannelChat) -> T): T? = channelChatOrNull() + ?.let(block) + +public inline fun Chat.groupChatOrNull(): GroupChat? = this as? + dev.inmo.tgbotapi.types.chat.GroupChat + +public inline fun Chat.groupChatOrThrow(): GroupChat = this as + dev.inmo.tgbotapi.types.chat.GroupChat + +public inline fun Chat.ifGroupChat(block: (GroupChat) -> T): T? = groupChatOrNull() ?.let(block) + +public inline fun Chat.privateChatOrNull(): PrivateChat? = this as? + dev.inmo.tgbotapi.types.chat.PrivateChat + +public inline fun Chat.privateChatOrThrow(): PrivateChat = this as + dev.inmo.tgbotapi.types.chat.PrivateChat + +public inline fun Chat.ifPrivateChat(block: (PrivateChat) -> T): T? = privateChatOrNull() + ?.let(block) + +public inline fun Chat.publicChatOrNull(): PublicChat? = this as? + dev.inmo.tgbotapi.types.chat.PublicChat + +public inline fun Chat.publicChatOrThrow(): PublicChat = this as + dev.inmo.tgbotapi.types.chat.PublicChat + +public inline fun Chat.ifPublicChat(block: (PublicChat) -> T): T? = publicChatOrNull() + ?.let(block) + +public inline fun Chat.supergroupChatOrNull(): SupergroupChat? = this as? + dev.inmo.tgbotapi.types.chat.SupergroupChat + +public inline fun Chat.supergroupChatOrThrow(): SupergroupChat = this as + dev.inmo.tgbotapi.types.chat.SupergroupChat + +public inline fun Chat.ifSupergroupChat(block: (SupergroupChat) -> T): T? = + supergroupChatOrNull() ?.let(block) + +public inline fun Chat.superPublicChatOrNull(): SuperPublicChat? = this as? + dev.inmo.tgbotapi.types.chat.SuperPublicChat + +public inline fun Chat.superPublicChatOrThrow(): SuperPublicChat = this as + dev.inmo.tgbotapi.types.chat.SuperPublicChat + +public inline fun Chat.ifSuperPublicChat(block: (SuperPublicChat) -> T): T? = + superPublicChatOrNull() ?.let(block) + +public inline fun Chat.usernameChatOrNull(): UsernameChat? = this as? + dev.inmo.tgbotapi.types.chat.UsernameChat + +public inline fun Chat.usernameChatOrThrow(): UsernameChat = this as + dev.inmo.tgbotapi.types.chat.UsernameChat + +public inline fun Chat.ifUsernameChat(block: (UsernameChat) -> T): T? = usernameChatOrNull() + ?.let(block) + +public inline fun Chat.possiblyPremiumChatOrNull(): PossiblyPremiumChat? = this as? + dev.inmo.tgbotapi.types.chat.PossiblyPremiumChat + +public inline fun Chat.possiblyPremiumChatOrThrow(): PossiblyPremiumChat = this as + dev.inmo.tgbotapi.types.chat.PossiblyPremiumChat + +public inline fun Chat.ifPossiblyPremiumChat(block: (PossiblyPremiumChat) -> T): T? = + possiblyPremiumChatOrNull() ?.let(block) + +public inline fun Chat.ableToAddInAttachmentMenuChatOrNull(): AbleToAddInAttachmentMenuChat? = this + as? dev.inmo.tgbotapi.types.chat.AbleToAddInAttachmentMenuChat + +public inline fun Chat.ableToAddInAttachmentMenuChatOrThrow(): AbleToAddInAttachmentMenuChat = this + as dev.inmo.tgbotapi.types.chat.AbleToAddInAttachmentMenuChat + +public inline fun + Chat.ifAbleToAddInAttachmentMenuChat(block: (AbleToAddInAttachmentMenuChat) -> T): T? = + ableToAddInAttachmentMenuChatOrNull() ?.let(block) + +public inline fun Chat.extendedChannelChatImplOrNull(): ExtendedChannelChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedChannelChatImpl + +public inline fun Chat.extendedChannelChatImplOrThrow(): ExtendedChannelChatImpl = this as + dev.inmo.tgbotapi.types.chat.ExtendedChannelChatImpl + +public inline fun Chat.ifExtendedChannelChatImpl(block: (ExtendedChannelChatImpl) -> T): T? = + extendedChannelChatImplOrNull() ?.let(block) + +public inline fun Chat.extendedGroupChatImplOrNull(): ExtendedGroupChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedGroupChatImpl + +public inline fun Chat.extendedGroupChatImplOrThrow(): ExtendedGroupChatImpl = this as + dev.inmo.tgbotapi.types.chat.ExtendedGroupChatImpl + +public inline fun Chat.ifExtendedGroupChatImpl(block: (ExtendedGroupChatImpl) -> T): T? = + extendedGroupChatImplOrNull() ?.let(block) + +public inline fun Chat.extendedPrivateChatImplOrNull(): ExtendedPrivateChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedPrivateChatImpl + +public inline fun Chat.extendedPrivateChatImplOrThrow(): ExtendedPrivateChatImpl = this as + dev.inmo.tgbotapi.types.chat.ExtendedPrivateChatImpl + +public inline fun Chat.ifExtendedPrivateChatImpl(block: (ExtendedPrivateChatImpl) -> T): T? = + extendedPrivateChatImplOrNull() ?.let(block) + +public inline fun Chat.extendedSupergroupChatImplOrNull(): ExtendedSupergroupChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChatImpl + +public inline fun Chat.extendedSupergroupChatImplOrThrow(): ExtendedSupergroupChatImpl = this as + dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChatImpl + +public inline fun Chat.ifExtendedSupergroupChatImpl(block: (ExtendedSupergroupChatImpl) -> T): + T? = extendedSupergroupChatImplOrNull() ?.let(block) + +public inline fun Chat.extendedBotOrNull(): ExtendedBot? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedBot + +public inline fun Chat.extendedBotOrThrow(): ExtendedBot = this as + dev.inmo.tgbotapi.types.chat.ExtendedBot + +public inline fun Chat.ifExtendedBot(block: (ExtendedBot) -> T): T? = extendedBotOrNull() + ?.let(block) + +public inline fun Chat.unknownExtendedChatOrNull(): UnknownExtendedChat? = this as? + dev.inmo.tgbotapi.types.chat.UnknownExtendedChat + +public inline fun Chat.unknownExtendedChatOrThrow(): UnknownExtendedChat = this as + dev.inmo.tgbotapi.types.chat.UnknownExtendedChat + +public inline fun Chat.ifUnknownExtendedChat(block: (UnknownExtendedChat) -> T): T? = + unknownExtendedChatOrNull() ?.let(block) + +public inline fun Chat.extendedChannelChatOrNull(): ExtendedChannelChat? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedChannelChat + +public inline fun Chat.extendedChannelChatOrThrow(): ExtendedChannelChat = this as + dev.inmo.tgbotapi.types.chat.ExtendedChannelChat + +public inline fun Chat.ifExtendedChannelChat(block: (ExtendedChannelChat) -> T): T? = + extendedChannelChatOrNull() ?.let(block) + +public inline fun Chat.extendedGroupChatOrNull(): ExtendedGroupChat? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedGroupChat + +public inline fun Chat.extendedGroupChatOrThrow(): ExtendedGroupChat = this as + dev.inmo.tgbotapi.types.chat.ExtendedGroupChat + +public inline fun Chat.ifExtendedGroupChat(block: (ExtendedGroupChat) -> T): T? = + extendedGroupChatOrNull() ?.let(block) + +public inline fun Chat.extendedPrivateChatOrNull(): ExtendedPrivateChat? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat + +public inline fun Chat.extendedPrivateChatOrThrow(): ExtendedPrivateChat = this as + dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat + +public inline fun Chat.ifExtendedPrivateChat(block: (ExtendedPrivateChat) -> T): T? = + extendedPrivateChatOrNull() ?.let(block) + +public inline fun Chat.extendedPublicChatOrNull(): ExtendedPublicChat? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedPublicChat + +public inline fun Chat.extendedPublicChatOrThrow(): ExtendedPublicChat = this as + dev.inmo.tgbotapi.types.chat.ExtendedPublicChat + +public inline fun Chat.ifExtendedPublicChat(block: (ExtendedPublicChat) -> T): T? = + extendedPublicChatOrNull() ?.let(block) + +public inline fun Chat.extendedSupergroupChatOrNull(): ExtendedSupergroupChat? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat + +public inline fun Chat.extendedSupergroupChatOrThrow(): ExtendedSupergroupChat = this as + dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat + +public inline fun Chat.ifExtendedSupergroupChat(block: (ExtendedSupergroupChat) -> T): T? = + extendedSupergroupChatOrNull() ?.let(block) + +public inline fun Chat.extendedChatOrNull(): ExtendedChat? = this as? + dev.inmo.tgbotapi.types.chat.ExtendedChat + +public inline fun Chat.extendedChatOrThrow(): ExtendedChat = this as + dev.inmo.tgbotapi.types.chat.ExtendedChat + +public inline fun Chat.ifExtendedChat(block: (ExtendedChat) -> T): T? = extendedChatOrNull() + ?.let(block) + +public inline fun Chat.groupChatImplOrNull(): GroupChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.GroupChatImpl + +public inline fun Chat.groupChatImplOrThrow(): GroupChatImpl = this as + dev.inmo.tgbotapi.types.chat.GroupChatImpl + +public inline fun Chat.ifGroupChatImpl(block: (GroupChatImpl) -> T): T? = groupChatImplOrNull() + ?.let(block) + +public inline fun Chat.privateChatImplOrNull(): PrivateChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.PrivateChatImpl + +public inline fun Chat.privateChatImplOrThrow(): PrivateChatImpl = this as + dev.inmo.tgbotapi.types.chat.PrivateChatImpl + +public inline fun Chat.ifPrivateChatImpl(block: (PrivateChatImpl) -> T): T? = + privateChatImplOrNull() ?.let(block) + +public inline fun Chat.supergroupChatImplOrNull(): SupergroupChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.SupergroupChatImpl + +public inline fun Chat.supergroupChatImplOrThrow(): SupergroupChatImpl = this as + dev.inmo.tgbotapi.types.chat.SupergroupChatImpl + +public inline fun Chat.ifSupergroupChatImpl(block: (SupergroupChatImpl) -> T): T? = + supergroupChatImplOrNull() ?.let(block) + +public inline fun Chat.channelChatImplOrNull(): ChannelChatImpl? = this as? + dev.inmo.tgbotapi.types.chat.ChannelChatImpl + +public inline fun Chat.channelChatImplOrThrow(): ChannelChatImpl = this as + dev.inmo.tgbotapi.types.chat.ChannelChatImpl + +public inline fun Chat.ifChannelChatImpl(block: (ChannelChatImpl) -> T): T? = + channelChatImplOrNull() ?.let(block) + +public inline fun Chat.userOrNull(): User? = this as? dev.inmo.tgbotapi.types.chat.User + +public inline fun Chat.userOrThrow(): User = this as dev.inmo.tgbotapi.types.chat.User + +public inline fun Chat.ifUser(block: (User) -> T): T? = userOrNull() ?.let(block) + +public inline fun Chat.botOrNull(): Bot? = this as? dev.inmo.tgbotapi.types.chat.Bot + +public inline fun Chat.botOrThrow(): Bot = this as dev.inmo.tgbotapi.types.chat.Bot + +public inline fun Chat.ifBot(block: (Bot) -> T): T? = botOrNull() ?.let(block) + +public inline fun Chat.commonBotOrNull(): CommonBot? = this as? + dev.inmo.tgbotapi.types.chat.CommonBot + +public inline fun Chat.commonBotOrThrow(): CommonBot = this as + dev.inmo.tgbotapi.types.chat.CommonBot + +public inline fun Chat.ifCommonBot(block: (CommonBot) -> T): T? = commonBotOrNull() ?.let(block) + +public inline fun Chat.commonUserOrNull(): CommonUser? = this as? + dev.inmo.tgbotapi.types.chat.CommonUser + +public inline fun Chat.commonUserOrThrow(): CommonUser = this as + dev.inmo.tgbotapi.types.chat.CommonUser + +public inline fun Chat.ifCommonUser(block: (CommonUser) -> T): T? = commonUserOrNull() + ?.let(block) + +public inline fun Chat.unknownChatTypeOrNull(): UnknownChatType? = this as? + dev.inmo.tgbotapi.types.chat.UnknownChatType + +public inline fun Chat.unknownChatTypeOrThrow(): UnknownChatType = this as + dev.inmo.tgbotapi.types.chat.UnknownChatType + +public inline fun Chat.ifUnknownChatType(block: (UnknownChatType) -> T): T? = + unknownChatTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.cubeDiceAnimationTypeOrNull(): CubeDiceAnimationType? = this as? + dev.inmo.tgbotapi.types.dice.CubeDiceAnimationType + +public inline fun DiceAnimationType.cubeDiceAnimationTypeOrThrow(): CubeDiceAnimationType = this as + dev.inmo.tgbotapi.types.dice.CubeDiceAnimationType + +public inline fun + DiceAnimationType.ifCubeDiceAnimationType(block: (CubeDiceAnimationType) -> T): T? = + cubeDiceAnimationTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.dartsDiceAnimationTypeOrNull(): DartsDiceAnimationType? = this + as? dev.inmo.tgbotapi.types.dice.DartsDiceAnimationType + +public inline fun DiceAnimationType.dartsDiceAnimationTypeOrThrow(): DartsDiceAnimationType = this + as dev.inmo.tgbotapi.types.dice.DartsDiceAnimationType + +public inline fun + DiceAnimationType.ifDartsDiceAnimationType(block: (DartsDiceAnimationType) -> T): T? = + dartsDiceAnimationTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.basketballDiceAnimationTypeOrNull(): + BasketballDiceAnimationType? = this as? dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType + +public inline fun DiceAnimationType.basketballDiceAnimationTypeOrThrow(): + BasketballDiceAnimationType = this as dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType + +public inline fun + DiceAnimationType.ifBasketballDiceAnimationType(block: (BasketballDiceAnimationType) -> T): T? = + basketballDiceAnimationTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.footballDiceAnimationTypeOrNull(): FootballDiceAnimationType? = + this as? dev.inmo.tgbotapi.types.dice.FootballDiceAnimationType + +public inline fun DiceAnimationType.footballDiceAnimationTypeOrThrow(): FootballDiceAnimationType = + this as dev.inmo.tgbotapi.types.dice.FootballDiceAnimationType + +public inline fun + DiceAnimationType.ifFootballDiceAnimationType(block: (FootballDiceAnimationType) -> T): T? = + footballDiceAnimationTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.bowlingDiceAnimationTypeOrNull(): BowlingDiceAnimationType? = + this as? dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType + +public inline fun DiceAnimationType.bowlingDiceAnimationTypeOrThrow(): BowlingDiceAnimationType = + this as dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType + +public inline fun + DiceAnimationType.ifBowlingDiceAnimationType(block: (BowlingDiceAnimationType) -> T): T? = + bowlingDiceAnimationTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.slotMachineDiceAnimationTypeOrNull(): + SlotMachineDiceAnimationType? = this as? + dev.inmo.tgbotapi.types.dice.SlotMachineDiceAnimationType + +public inline fun DiceAnimationType.slotMachineDiceAnimationTypeOrThrow(): + SlotMachineDiceAnimationType = this as dev.inmo.tgbotapi.types.dice.SlotMachineDiceAnimationType + +public inline fun + DiceAnimationType.ifSlotMachineDiceAnimationType(block: (SlotMachineDiceAnimationType) -> T): T? + = slotMachineDiceAnimationTypeOrNull() ?.let(block) + +public inline fun DiceAnimationType.customDiceAnimationTypeOrNull(): CustomDiceAnimationType? = this + as? dev.inmo.tgbotapi.types.dice.CustomDiceAnimationType + +public inline fun DiceAnimationType.customDiceAnimationTypeOrThrow(): CustomDiceAnimationType = this + as dev.inmo.tgbotapi.types.dice.CustomDiceAnimationType + +public inline fun + DiceAnimationType.ifCustomDiceAnimationType(block: (CustomDiceAnimationType) -> T): T? = + customDiceAnimationTypeOrNull() ?.let(block) + +public inline fun TelegramMediaFile.animationFileOrNull(): AnimationFile? = this as? + dev.inmo.tgbotapi.types.files.AnimationFile + +public inline fun TelegramMediaFile.animationFileOrThrow(): AnimationFile = this as + dev.inmo.tgbotapi.types.files.AnimationFile + +public inline fun TelegramMediaFile.ifAnimationFile(block: (AnimationFile) -> T): T? = + animationFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.audioFileOrNull(): AudioFile? = this as? + dev.inmo.tgbotapi.types.files.AudioFile + +public inline fun TelegramMediaFile.audioFileOrThrow(): AudioFile = this as + dev.inmo.tgbotapi.types.files.AudioFile + +public inline fun TelegramMediaFile.ifAudioFile(block: (AudioFile) -> T): T? = audioFileOrNull() + ?.let(block) + +public inline fun TelegramMediaFile.documentFileOrNull(): DocumentFile? = this as? + dev.inmo.tgbotapi.types.files.DocumentFile + +public inline fun TelegramMediaFile.documentFileOrThrow(): DocumentFile = this as + dev.inmo.tgbotapi.types.files.DocumentFile + +public inline fun TelegramMediaFile.ifDocumentFile(block: (DocumentFile) -> T): T? = + documentFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.fileOrNull(): File? = this as? + dev.inmo.tgbotapi.types.files.File + +public inline fun TelegramMediaFile.fileOrThrow(): File = this as dev.inmo.tgbotapi.types.files.File + +public inline fun TelegramMediaFile.ifFile(block: (File) -> T): T? = fileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.mimedMediaFileOrNull(): MimedMediaFile? = this as? + dev.inmo.tgbotapi.types.files.MimedMediaFile + +public inline fun TelegramMediaFile.mimedMediaFileOrThrow(): MimedMediaFile = this as + dev.inmo.tgbotapi.types.files.MimedMediaFile + +public inline fun TelegramMediaFile.ifMimedMediaFile(block: (MimedMediaFile) -> T): T? = + mimedMediaFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.passportFileOrNull(): PassportFile? = this as? + dev.inmo.tgbotapi.types.files.PassportFile + +public inline fun TelegramMediaFile.passportFileOrThrow(): PassportFile = this as + dev.inmo.tgbotapi.types.files.PassportFile + +public inline fun TelegramMediaFile.ifPassportFile(block: (PassportFile) -> T): T? = + passportFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.pathedFileOrNull(): PathedFile? = this as? + dev.inmo.tgbotapi.types.files.PathedFile + +public inline fun TelegramMediaFile.pathedFileOrThrow(): PathedFile = this as + dev.inmo.tgbotapi.types.files.PathedFile + +public inline fun TelegramMediaFile.ifPathedFile(block: (PathedFile) -> T): T? = + pathedFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.photoSizeOrNull(): PhotoSize? = this as? + dev.inmo.tgbotapi.types.files.PhotoSize + +public inline fun TelegramMediaFile.photoSizeOrThrow(): PhotoSize = this as + dev.inmo.tgbotapi.types.files.PhotoSize + +public inline fun TelegramMediaFile.ifPhotoSize(block: (PhotoSize) -> T): T? = photoSizeOrNull() + ?.let(block) + +public inline fun TelegramMediaFile.playableMediaFileOrNull(): PlayableMediaFile? = this as? + dev.inmo.tgbotapi.types.files.PlayableMediaFile + +public inline fun TelegramMediaFile.playableMediaFileOrThrow(): PlayableMediaFile = this as + dev.inmo.tgbotapi.types.files.PlayableMediaFile + +public inline fun TelegramMediaFile.ifPlayableMediaFile(block: (PlayableMediaFile) -> T): T? = + playableMediaFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.sizedMediaFileOrNull(): SizedMediaFile? = this as? + dev.inmo.tgbotapi.types.files.SizedMediaFile + +public inline fun TelegramMediaFile.sizedMediaFileOrThrow(): SizedMediaFile = this as + dev.inmo.tgbotapi.types.files.SizedMediaFile + +public inline fun TelegramMediaFile.ifSizedMediaFile(block: (SizedMediaFile) -> T): T? = + sizedMediaFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.stickerOrNull(): Sticker? = this as? + dev.inmo.tgbotapi.types.files.Sticker + +public inline fun TelegramMediaFile.stickerOrThrow(): Sticker = this as + dev.inmo.tgbotapi.types.files.Sticker + +public inline fun TelegramMediaFile.ifSticker(block: (Sticker) -> T): T? = stickerOrNull() + ?.let(block) + +public inline fun TelegramMediaFile.simpleStickerOrNull(): SimpleSticker? = this as? + dev.inmo.tgbotapi.types.files.SimpleSticker + +public inline fun TelegramMediaFile.simpleStickerOrThrow(): SimpleSticker = this as + dev.inmo.tgbotapi.types.files.SimpleSticker + +public inline fun TelegramMediaFile.ifSimpleSticker(block: (SimpleSticker) -> T): T? = + simpleStickerOrNull() ?.let(block) + +public inline fun TelegramMediaFile.animatedStickerOrNull(): AnimatedSticker? = this as? + dev.inmo.tgbotapi.types.files.AnimatedSticker + +public inline fun TelegramMediaFile.animatedStickerOrThrow(): AnimatedSticker = this as + dev.inmo.tgbotapi.types.files.AnimatedSticker + +public inline fun TelegramMediaFile.ifAnimatedSticker(block: (AnimatedSticker) -> T): T? = + animatedStickerOrNull() ?.let(block) + +public inline fun TelegramMediaFile.videoStickerOrNull(): VideoSticker? = this as? + dev.inmo.tgbotapi.types.files.VideoSticker + +public inline fun TelegramMediaFile.videoStickerOrThrow(): VideoSticker = this as + dev.inmo.tgbotapi.types.files.VideoSticker + +public inline fun TelegramMediaFile.ifVideoSticker(block: (VideoSticker) -> T): T? = + videoStickerOrNull() ?.let(block) + +public inline fun TelegramMediaFile.thumbedMediaFileOrNull(): ThumbedMediaFile? = this as? + dev.inmo.tgbotapi.types.files.ThumbedMediaFile + +public inline fun TelegramMediaFile.thumbedMediaFileOrThrow(): ThumbedMediaFile = this as + dev.inmo.tgbotapi.types.files.ThumbedMediaFile + +public inline fun TelegramMediaFile.ifThumbedMediaFile(block: (ThumbedMediaFile) -> T): T? = + thumbedMediaFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.videoFileOrNull(): VideoFile? = this as? + dev.inmo.tgbotapi.types.files.VideoFile + +public inline fun TelegramMediaFile.videoFileOrThrow(): VideoFile = this as + dev.inmo.tgbotapi.types.files.VideoFile + +public inline fun TelegramMediaFile.ifVideoFile(block: (VideoFile) -> T): T? = videoFileOrNull() + ?.let(block) + +public inline fun TelegramMediaFile.videoNoteFileOrNull(): VideoNoteFile? = this as? + dev.inmo.tgbotapi.types.files.VideoNoteFile + +public inline fun TelegramMediaFile.videoNoteFileOrThrow(): VideoNoteFile = this as + dev.inmo.tgbotapi.types.files.VideoNoteFile + +public inline fun TelegramMediaFile.ifVideoNoteFile(block: (VideoNoteFile) -> T): T? = + videoNoteFileOrNull() ?.let(block) + +public inline fun TelegramMediaFile.voiceFileOrNull(): VoiceFile? = this as? + dev.inmo.tgbotapi.types.files.VoiceFile + +public inline fun TelegramMediaFile.voiceFileOrThrow(): VoiceFile = this as + dev.inmo.tgbotapi.types.files.VoiceFile + +public inline fun TelegramMediaFile.ifVoiceFile(block: (VoiceFile) -> T): T? = voiceFileOrNull() + ?.let(block) + +public inline fun Location.staticLocationOrNull(): StaticLocation? = this as? + dev.inmo.tgbotapi.types.location.StaticLocation + +public inline fun Location.staticLocationOrThrow(): StaticLocation = this as + dev.inmo.tgbotapi.types.location.StaticLocation + +public inline fun Location.ifStaticLocation(block: (StaticLocation) -> T): T? = + staticLocationOrNull() ?.let(block) + +public inline fun Location.liveLocationOrNull(): LiveLocation? = this as? + dev.inmo.tgbotapi.types.location.LiveLocation + +public inline fun Location.liveLocationOrThrow(): LiveLocation = this as + dev.inmo.tgbotapi.types.location.LiveLocation + +public inline fun Location.ifLiveLocation(block: (LiveLocation) -> T): T? = liveLocationOrNull() + ?.let(block) + +public inline fun TelegramMedia.duratedTelegramMediaOrNull(): DuratedTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.DuratedTelegramMedia + +public inline fun TelegramMedia.duratedTelegramMediaOrThrow(): DuratedTelegramMedia = this as + dev.inmo.tgbotapi.types.media.DuratedTelegramMedia + +public inline fun TelegramMedia.ifDuratedTelegramMedia(block: (DuratedTelegramMedia) -> T): T? = + duratedTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.mediaGroupMemberTelegramMediaOrNull(): + MediaGroupMemberTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.MediaGroupMemberTelegramMedia + +public inline fun TelegramMedia.mediaGroupMemberTelegramMediaOrThrow(): + MediaGroupMemberTelegramMedia = this as + dev.inmo.tgbotapi.types.media.MediaGroupMemberTelegramMedia + +public inline fun + TelegramMedia.ifMediaGroupMemberTelegramMedia(block: (MediaGroupMemberTelegramMedia) -> T): T? = + mediaGroupMemberTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.audioMediaGroupMemberTelegramMediaOrNull(): + AudioMediaGroupMemberTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.AudioMediaGroupMemberTelegramMedia + +public inline fun TelegramMedia.audioMediaGroupMemberTelegramMediaOrThrow(): + AudioMediaGroupMemberTelegramMedia = this as + dev.inmo.tgbotapi.types.media.AudioMediaGroupMemberTelegramMedia + +public inline fun + TelegramMedia.ifAudioMediaGroupMemberTelegramMedia(block: (AudioMediaGroupMemberTelegramMedia) -> T): + T? = audioMediaGroupMemberTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.documentMediaGroupMemberTelegramMediaOrNull(): + DocumentMediaGroupMemberTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.DocumentMediaGroupMemberTelegramMedia + +public inline fun TelegramMedia.documentMediaGroupMemberTelegramMediaOrThrow(): + DocumentMediaGroupMemberTelegramMedia = this as + dev.inmo.tgbotapi.types.media.DocumentMediaGroupMemberTelegramMedia + +public inline fun + TelegramMedia.ifDocumentMediaGroupMemberTelegramMedia(block: (DocumentMediaGroupMemberTelegramMedia) -> T): + T? = documentMediaGroupMemberTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.visualMediaGroupMemberTelegramMediaOrNull(): + VisualMediaGroupMemberTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.VisualMediaGroupMemberTelegramMedia + +public inline fun TelegramMedia.visualMediaGroupMemberTelegramMediaOrThrow(): + VisualMediaGroupMemberTelegramMedia = this as + dev.inmo.tgbotapi.types.media.VisualMediaGroupMemberTelegramMedia + +public inline fun + TelegramMedia.ifVisualMediaGroupMemberTelegramMedia(block: (VisualMediaGroupMemberTelegramMedia) -> T): + T? = visualMediaGroupMemberTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.sizedTelegramMediaOrNull(): SizedTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.SizedTelegramMedia + +public inline fun TelegramMedia.sizedTelegramMediaOrThrow(): SizedTelegramMedia = this as + dev.inmo.tgbotapi.types.media.SizedTelegramMedia + +public inline fun TelegramMedia.ifSizedTelegramMedia(block: (SizedTelegramMedia) -> T): T? = + sizedTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramMediaAnimationOrNull(): TelegramMediaAnimation? = this as? + dev.inmo.tgbotapi.types.media.TelegramMediaAnimation + +public inline fun TelegramMedia.telegramMediaAnimationOrThrow(): TelegramMediaAnimation = this as + dev.inmo.tgbotapi.types.media.TelegramMediaAnimation + +public inline fun TelegramMedia.ifTelegramMediaAnimation(block: (TelegramMediaAnimation) -> T): + T? = telegramMediaAnimationOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramMediaAudioOrNull(): TelegramMediaAudio? = this as? + dev.inmo.tgbotapi.types.media.TelegramMediaAudio + +public inline fun TelegramMedia.telegramMediaAudioOrThrow(): TelegramMediaAudio = this as + dev.inmo.tgbotapi.types.media.TelegramMediaAudio + +public inline fun TelegramMedia.ifTelegramMediaAudio(block: (TelegramMediaAudio) -> T): T? = + telegramMediaAudioOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramMediaDocumentOrNull(): TelegramMediaDocument? = this as? + dev.inmo.tgbotapi.types.media.TelegramMediaDocument + +public inline fun TelegramMedia.telegramMediaDocumentOrThrow(): TelegramMediaDocument = this as + dev.inmo.tgbotapi.types.media.TelegramMediaDocument + +public inline fun TelegramMedia.ifTelegramMediaDocument(block: (TelegramMediaDocument) -> T): T? + = telegramMediaDocumentOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramMediaPhotoOrNull(): TelegramMediaPhoto? = this as? + dev.inmo.tgbotapi.types.media.TelegramMediaPhoto + +public inline fun TelegramMedia.telegramMediaPhotoOrThrow(): TelegramMediaPhoto = this as + dev.inmo.tgbotapi.types.media.TelegramMediaPhoto + +public inline fun TelegramMedia.ifTelegramMediaPhoto(block: (TelegramMediaPhoto) -> T): T? = + telegramMediaPhotoOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramMediaVideoOrNull(): TelegramMediaVideo? = this as? + dev.inmo.tgbotapi.types.media.TelegramMediaVideo + +public inline fun TelegramMedia.telegramMediaVideoOrThrow(): TelegramMediaVideo = this as + dev.inmo.tgbotapi.types.media.TelegramMediaVideo + +public inline fun TelegramMedia.ifTelegramMediaVideo(block: (TelegramMediaVideo) -> T): T? = + telegramMediaVideoOrNull() ?.let(block) + +public inline fun TelegramMedia.thumbedTelegramMediaOrNull(): ThumbedTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.ThumbedTelegramMedia + +public inline fun TelegramMedia.thumbedTelegramMediaOrThrow(): ThumbedTelegramMedia = this as + dev.inmo.tgbotapi.types.media.ThumbedTelegramMedia + +public inline fun TelegramMedia.ifThumbedTelegramMedia(block: (ThumbedTelegramMedia) -> T): T? = + thumbedTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.titledTelegramMediaOrNull(): TitledTelegramMedia? = this as? + dev.inmo.tgbotapi.types.media.TitledTelegramMedia + +public inline fun TelegramMedia.titledTelegramMediaOrThrow(): TitledTelegramMedia = this as + dev.inmo.tgbotapi.types.media.TitledTelegramMedia + +public inline fun TelegramMedia.ifTitledTelegramMedia(block: (TitledTelegramMedia) -> T): T? = + titledTelegramMediaOrNull() ?.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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 ForwardInfo.byAnonymousOrNull(): ForwardInfo.ByAnonymous? = this as? + dev.inmo.tgbotapi.types.message.ForwardInfo.ByAnonymous + +public inline fun ForwardInfo.byAnonymousOrThrow(): ForwardInfo.ByAnonymous = this as + dev.inmo.tgbotapi.types.message.ForwardInfo.ByAnonymous + +public inline fun ForwardInfo.ifByAnonymous(block: (ForwardInfo.ByAnonymous) -> T): T? = + byAnonymousOrNull() ?.let(block) + +public inline fun ForwardInfo.byUserOrNull(): ForwardInfo.ByUser? = this as? + dev.inmo.tgbotapi.types.message.ForwardInfo.ByUser + +public inline fun ForwardInfo.byUserOrThrow(): ForwardInfo.ByUser = this as + dev.inmo.tgbotapi.types.message.ForwardInfo.ByUser + +public inline fun ForwardInfo.ifByUser(block: (ForwardInfo.ByUser) -> T): T? = byUserOrNull() + ?.let(block) + +public inline fun ForwardInfo.publicChatOrNull(): ForwardInfo.PublicChat? = this as? + dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat + +public inline fun ForwardInfo.publicChatOrThrow(): ForwardInfo.PublicChat = this as + dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat + +public inline fun ForwardInfo.ifPublicChat(block: (ForwardInfo.PublicChat) -> T): T? = + publicChatOrNull() ?.let(block) + +public inline fun ForwardInfo.fromChannelOrNull(): ForwardInfo.PublicChat.FromChannel? = this as? + dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.FromChannel + +public inline fun ForwardInfo.fromChannelOrThrow(): ForwardInfo.PublicChat.FromChannel = this as + dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.FromChannel + +public inline fun ForwardInfo.ifFromChannel(block: (ForwardInfo.PublicChat.FromChannel) -> T): + T? = fromChannelOrNull() ?.let(block) + +public inline fun ForwardInfo.fromSupergroupOrNull(): ForwardInfo.PublicChat.FromSupergroup? = this + as? dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.FromSupergroup + +public inline fun ForwardInfo.fromSupergroupOrThrow(): ForwardInfo.PublicChat.FromSupergroup = this + as dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.FromSupergroup + +public inline fun + ForwardInfo.ifFromSupergroup(block: (ForwardInfo.PublicChat.FromSupergroup) -> T): T? = + fromSupergroupOrNull() ?.let(block) + +public inline fun ForwardInfo.sentByChannelOrNull(): ForwardInfo.PublicChat.SentByChannel? = this + as? dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.SentByChannel + +public inline fun ForwardInfo.sentByChannelOrThrow(): ForwardInfo.PublicChat.SentByChannel = this as + dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.SentByChannel + +public inline fun + ForwardInfo.ifSentByChannel(block: (ForwardInfo.PublicChat.SentByChannel) -> T): T? = + sentByChannelOrNull() ?.let(block) + +public inline fun Message.channelContentMessageImplOrNull(): + ChannelContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.ChannelContentMessageImpl + +public inline fun Message.channelContentMessageImplOrThrow(): + ChannelContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.ChannelContentMessageImpl + +public inline fun + Message.ifChannelContentMessageImpl(block: (ChannelContentMessageImpl) -> T): T? + = channelContentMessageImplOrNull() ?.let(block) + +public inline fun Message.channelEventMessageOrNull(): ChannelEventMessage? = this as? + dev.inmo.tgbotapi.types.message.ChannelEventMessage + +public inline fun Message.channelEventMessageOrThrow(): ChannelEventMessage = this as + dev.inmo.tgbotapi.types.message.ChannelEventMessage + +public inline fun + Message.ifChannelEventMessage(block: (ChannelEventMessage) -> T): T? = + channelEventMessageOrNull() ?.let(block) + +public inline fun Message.channelMediaGroupMessageOrNull(): + ChannelMediaGroupMessage? = this as? + dev.inmo.tgbotapi.types.message.ChannelMediaGroupMessage + +public inline fun Message.channelMediaGroupMessageOrThrow(): + ChannelMediaGroupMessage = this as + dev.inmo.tgbotapi.types.message.ChannelMediaGroupMessage + +public inline fun + Message.ifChannelMediaGroupMessage(block: (ChannelMediaGroupMessage) -> T): + T? = channelMediaGroupMessageOrNull() ?.let(block) + +public inline fun Message.commonGroupEventMessageOrNull(): CommonGroupEventMessage? = + this as? + dev.inmo.tgbotapi.types.message.CommonGroupEventMessage + +public inline fun Message.commonGroupEventMessageOrThrow(): CommonGroupEventMessage = + this as + dev.inmo.tgbotapi.types.message.CommonGroupEventMessage + +public inline fun + Message.ifCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T): T? = + commonGroupEventMessageOrNull() ?.let(block) + +public inline fun Message.commonMediaGroupMessageOrNull(): + CommonMediaGroupMessage? = this as? + dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage + +public inline fun Message.commonMediaGroupMessageOrThrow(): + CommonMediaGroupMessage = this as + dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage + +public inline fun + Message.ifCommonMediaGroupMessage(block: (CommonMediaGroupMessage) -> T): T? + = commonMediaGroupMessageOrNull() ?.let(block) + +public inline fun Message.commonSupergroupEventMessageOrNull(): + CommonSupergroupEventMessage? = this as? + dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage + +public inline fun Message.commonSupergroupEventMessageOrThrow(): + CommonSupergroupEventMessage = this as + dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage + +public inline fun + Message.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T): + T? = commonSupergroupEventMessageOrNull() ?.let(block) + +public inline fun Message.connectedFromChannelGroupContentMessageImplOrNull(): + ConnectedFromChannelGroupContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.ConnectedFromChannelGroupContentMessageImpl + +public inline fun Message.connectedFromChannelGroupContentMessageImplOrThrow(): + ConnectedFromChannelGroupContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.ConnectedFromChannelGroupContentMessageImpl + +public inline fun + Message.ifConnectedFromChannelGroupContentMessageImpl(block: (ConnectedFromChannelGroupContentMessageImpl) -> T): + T? = connectedFromChannelGroupContentMessageImplOrNull() ?.let(block) + +public inline fun Message.unconnectedFromChannelGroupContentMessageImplOrNull(): + UnconnectedFromChannelGroupContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.UnconnectedFromChannelGroupContentMessageImpl + +public inline fun Message.unconnectedFromChannelGroupContentMessageImplOrThrow(): + UnconnectedFromChannelGroupContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.UnconnectedFromChannelGroupContentMessageImpl + +public inline fun + Message.ifUnconnectedFromChannelGroupContentMessageImpl(block: (UnconnectedFromChannelGroupContentMessageImpl) -> T): + T? = unconnectedFromChannelGroupContentMessageImplOrNull() ?.let(block) + +public inline fun Message.anonymousGroupContentMessageImplOrNull(): + AnonymousGroupContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.AnonymousGroupContentMessageImpl + +public inline fun Message.anonymousGroupContentMessageImplOrThrow(): + AnonymousGroupContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.AnonymousGroupContentMessageImpl + +public inline fun + Message.ifAnonymousGroupContentMessageImpl(block: (AnonymousGroupContentMessageImpl) -> T): + T? = anonymousGroupContentMessageImplOrNull() ?.let(block) + +public inline fun Message.commonGroupContentMessageImplOrNull(): + CommonGroupContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.CommonGroupContentMessageImpl + +public inline fun Message.commonGroupContentMessageImplOrThrow(): + CommonGroupContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.CommonGroupContentMessageImpl + +public inline fun + Message.ifCommonGroupContentMessageImpl(block: (CommonGroupContentMessageImpl) -> T): + T? = commonGroupContentMessageImplOrNull() ?.let(block) + +public inline fun Message.passportMessageOrNull(): PassportMessage? = this as? + dev.inmo.tgbotapi.types.message.PassportMessage + +public inline fun Message.passportMessageOrThrow(): PassportMessage = this as + dev.inmo.tgbotapi.types.message.PassportMessage + +public inline fun Message.ifPassportMessage(block: (PassportMessage) -> T): T? = + passportMessageOrNull() ?.let(block) + +public inline fun Message.privateContentMessageImplOrNull(): + PrivateContentMessageImpl? = this as? + dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl + +public inline fun Message.privateContentMessageImplOrThrow(): + PrivateContentMessageImpl = this as + dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl + +public inline fun + Message.ifPrivateContentMessageImpl(block: (PrivateContentMessageImpl) -> T): T? + = privateContentMessageImplOrNull() ?.let(block) + +public inline fun Message.privateEventMessageOrNull(): PrivateEventMessage? = this as? + dev.inmo.tgbotapi.types.message.PrivateEventMessage + +public inline fun Message.privateEventMessageOrThrow(): PrivateEventMessage = this as + dev.inmo.tgbotapi.types.message.PrivateEventMessage + +public inline fun + Message.ifPrivateEventMessage(block: (PrivateEventMessage) -> T): T? = + privateEventMessageOrNull() ?.let(block) + +public inline fun Message.channelContentMessageOrNull(): ChannelContentMessage? = + this as? + dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage + +public inline fun Message.channelContentMessageOrThrow(): ChannelContentMessage = + this as + dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage + +public inline fun + Message.ifChannelContentMessage(block: (ChannelContentMessage) -> T): T? = + channelContentMessageOrNull() ?.let(block) + +public inline fun Message.chatEventMessageOrNull(): ChatEventMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage + +public inline fun Message.chatEventMessageOrThrow(): ChatEventMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage + +public inline fun Message.ifChatEventMessage(block: (ChatEventMessage) -> T): T? = + chatEventMessageOrNull() ?.let(block) + +public inline fun Message.commonMessageOrNull(): CommonMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.CommonMessage + +public inline fun Message.commonMessageOrThrow(): CommonMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.CommonMessage + +public inline fun Message.ifCommonMessage(block: (CommonMessage) -> T): T? = + commonMessageOrNull() ?.let(block) + +public inline fun Message.contentMessageOrNull(): ContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.ContentMessage + +public inline fun Message.contentMessageOrThrow(): ContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.ContentMessage + +public inline fun Message.ifContentMessage(block: (ContentMessage) -> T): T? = + contentMessageOrNull() ?.let(block) + +public inline fun Message.fromUserMessageOrNull(): FromUserMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage + +public inline fun Message.fromUserMessageOrThrow(): FromUserMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage + +public inline fun Message.ifFromUserMessage(block: (FromUserMessage) -> T): T? = + fromUserMessageOrNull() ?.let(block) + +public inline fun Message.groupEventMessageOrNull(): GroupEventMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage + +public inline fun Message.groupEventMessageOrThrow(): GroupEventMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage + +public inline fun Message.ifGroupEventMessage(block: (GroupEventMessage) -> T): T? = + groupEventMessageOrNull() ?.let(block) + +public inline fun Message.groupContentMessageOrNull(): GroupContentMessage? = this + as? + dev.inmo.tgbotapi.types.message.abstracts.GroupContentMessage + +public inline fun Message.groupContentMessageOrThrow(): GroupContentMessage = this + as + dev.inmo.tgbotapi.types.message.abstracts.GroupContentMessage + +public inline fun + Message.ifGroupContentMessage(block: (GroupContentMessage) -> T): T? = + groupContentMessageOrNull() ?.let(block) + +public inline fun Message.fromChannelGroupContentMessageOrNull(): + FromChannelGroupContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.FromChannelGroupContentMessage + +public inline fun Message.fromChannelGroupContentMessageOrThrow(): + FromChannelGroupContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.FromChannelGroupContentMessage + +public inline fun + Message.ifFromChannelGroupContentMessage(block: (FromChannelGroupContentMessage) -> T): + T? = fromChannelGroupContentMessageOrNull() ?.let(block) + +public inline fun Message.connectedFromChannelGroupContentMessageOrNull(): + ConnectedFromChannelGroupContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.ConnectedFromChannelGroupContentMessage + +public inline fun Message.connectedFromChannelGroupContentMessageOrThrow(): + ConnectedFromChannelGroupContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.ConnectedFromChannelGroupContentMessage + +public inline fun + Message.ifConnectedFromChannelGroupContentMessage(block: (ConnectedFromChannelGroupContentMessage) -> T): + T? = connectedFromChannelGroupContentMessageOrNull() ?.let(block) + +public inline fun Message.unconnectedFromChannelGroupContentMessageOrNull(): + UnconnectedFromChannelGroupContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.UnconnectedFromChannelGroupContentMessage + +public inline fun Message.unconnectedFromChannelGroupContentMessageOrThrow(): + UnconnectedFromChannelGroupContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.UnconnectedFromChannelGroupContentMessage + +public inline fun + Message.ifUnconnectedFromChannelGroupContentMessage(block: (UnconnectedFromChannelGroupContentMessage) -> T): + T? = unconnectedFromChannelGroupContentMessageOrNull() ?.let(block) + +public inline fun Message.anonymousGroupContentMessageOrNull(): + AnonymousGroupContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.AnonymousGroupContentMessage + +public inline fun Message.anonymousGroupContentMessageOrThrow(): + AnonymousGroupContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.AnonymousGroupContentMessage + +public inline fun + Message.ifAnonymousGroupContentMessage(block: (AnonymousGroupContentMessage) -> T): + T? = anonymousGroupContentMessageOrNull() ?.let(block) + +public inline fun Message.commonGroupContentMessageOrNull(): + CommonGroupContentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage + +public inline fun Message.commonGroupContentMessageOrThrow(): + CommonGroupContentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage + +public inline fun + Message.ifCommonGroupContentMessage(block: (CommonGroupContentMessage) -> T): T? + = commonGroupContentMessageOrNull() ?.let(block) + +public inline fun Message.mediaGroupMessageOrNull(): MediaGroupMessage? = this + as? + dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage + +public inline fun Message.mediaGroupMessageOrThrow(): MediaGroupMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage + +public inline fun + Message.ifMediaGroupMessage(block: (MediaGroupMessage) -> T): T? = + mediaGroupMessageOrNull() ?.let(block) + +public inline fun Message.unknownMessageTypeOrNull(): UnknownMessageType? = this as? + dev.inmo.tgbotapi.types.message.abstracts.UnknownMessageType + +public inline fun Message.unknownMessageTypeOrThrow(): UnknownMessageType = this as + dev.inmo.tgbotapi.types.message.abstracts.UnknownMessageType + +public inline fun Message.ifUnknownMessageType(block: (UnknownMessageType) -> T): T? = + unknownMessageTypeOrNull() ?.let(block) + +public inline fun Message.possiblyEditedMessageOrNull(): PossiblyEditedMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.PossiblyEditedMessage + +public inline fun Message.possiblyEditedMessageOrThrow(): PossiblyEditedMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.PossiblyEditedMessage + +public inline fun Message.ifPossiblyEditedMessage(block: (PossiblyEditedMessage) -> T): T? = + possiblyEditedMessageOrNull() ?.let(block) + +public inline fun Message.possiblyForwardedMessageOrNull(): PossiblyForwardedMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage + +public inline fun Message.possiblyForwardedMessageOrThrow(): PossiblyForwardedMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage + +public inline fun Message.ifPossiblyForwardedMessage(block: (PossiblyForwardedMessage) -> T): T? + = possiblyForwardedMessageOrNull() ?.let(block) + +public inline fun Message.possiblyPaymentMessageOrNull(): PossiblyPaymentMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage + +public inline fun Message.possiblyPaymentMessageOrThrow(): PossiblyPaymentMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage + +public inline fun Message.ifPossiblyPaymentMessage(block: (PossiblyPaymentMessage) -> T): T? = + possiblyPaymentMessageOrNull() ?.let(block) + +public inline fun Message.possiblySentViaBotCommonMessageOrNull(): + PossiblySentViaBotCommonMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage + +public inline fun Message.possiblySentViaBotCommonMessageOrThrow(): + PossiblySentViaBotCommonMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage + +public inline fun + Message.ifPossiblySentViaBotCommonMessage(block: (PossiblySentViaBotCommonMessage) -> T): + T? = possiblySentViaBotCommonMessageOrNull() ?.let(block) + +public inline fun Message.privateContentMessageOrNull(): PrivateContentMessage? = + this as? + dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage + +public inline fun Message.privateContentMessageOrThrow(): PrivateContentMessage = + this as + dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage + +public inline fun + Message.ifPrivateContentMessage(block: (PrivateContentMessage) -> T): T? = + privateContentMessageOrNull() ?.let(block) + +public inline fun Message.publicContentMessageOrNull(): PublicContentMessage? = this + as? + dev.inmo.tgbotapi.types.message.abstracts.PublicContentMessage + +public inline fun Message.publicContentMessageOrThrow(): PublicContentMessage = this + as + dev.inmo.tgbotapi.types.message.abstracts.PublicContentMessage + +public inline fun + Message.ifPublicContentMessage(block: (PublicContentMessage) -> T): T? = + publicContentMessageOrNull() ?.let(block) + +public inline fun Message.signedMessageOrNull(): SignedMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.SignedMessage + +public inline fun Message.signedMessageOrThrow(): SignedMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.SignedMessage + +public inline fun Message.ifSignedMessage(block: (SignedMessage) -> T): T? = + signedMessageOrNull() ?.let(block) + +public inline fun Message.supergroupEventMessageOrNull(): SupergroupEventMessage? = + this as? + dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage + +public inline fun Message.supergroupEventMessageOrThrow(): SupergroupEventMessage = + this as + dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage + +public inline fun + Message.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T): T? = + supergroupEventMessageOrNull() ?.let(block) + +public inline fun ResendableContent.messageContentOrNull(): MessageContent? = this as? + dev.inmo.tgbotapi.types.message.content.MessageContent + +public inline fun ResendableContent.messageContentOrThrow(): MessageContent = this as + dev.inmo.tgbotapi.types.message.content.MessageContent + +public inline fun ResendableContent.ifMessageContent(block: (MessageContent) -> T): T? = + messageContentOrNull() ?.let(block) + +public inline fun ResendableContent.mediaCollectionContentOrNull(): + MediaCollectionContent? = this as? + dev.inmo.tgbotapi.types.message.content.MediaCollectionContent + +public inline fun ResendableContent.mediaCollectionContentOrThrow(): + MediaCollectionContent = this as + dev.inmo.tgbotapi.types.message.content.MediaCollectionContent + +public inline fun + ResendableContent.ifMediaCollectionContent(block: (MediaCollectionContent) -> T): + T? = mediaCollectionContentOrNull() ?.let(block) + +public inline fun ResendableContent.mediaContentOrNull(): MediaContent? = this as? + dev.inmo.tgbotapi.types.message.content.MediaContent + +public inline fun ResendableContent.mediaContentOrThrow(): MediaContent = this as + dev.inmo.tgbotapi.types.message.content.MediaContent + +public inline fun ResendableContent.ifMediaContent(block: (MediaContent) -> T): T? = + mediaContentOrNull() ?.let(block) + +public inline fun ResendableContent.audioMediaGroupContentOrNull(): AudioMediaGroupContent? = this + as? dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent + +public inline fun ResendableContent.audioMediaGroupContentOrThrow(): AudioMediaGroupContent = this + as dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent + +public inline fun + ResendableContent.ifAudioMediaGroupContent(block: (AudioMediaGroupContent) -> T): T? = + audioMediaGroupContentOrNull() ?.let(block) + +public inline fun ResendableContent.documentMediaGroupContentOrNull(): DocumentMediaGroupContent? = + this as? dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent + +public inline fun ResendableContent.documentMediaGroupContentOrThrow(): DocumentMediaGroupContent = + this as dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent + +public inline fun + ResendableContent.ifDocumentMediaGroupContent(block: (DocumentMediaGroupContent) -> T): T? = + documentMediaGroupContentOrNull() ?.let(block) + +public inline fun ResendableContent.mediaGroupContentOrNull(): MediaGroupContent? = this as? + dev.inmo.tgbotapi.types.message.content.MediaGroupContent + +public inline fun ResendableContent.mediaGroupContentOrThrow(): MediaGroupContent = this as + dev.inmo.tgbotapi.types.message.content.MediaGroupContent + +public inline fun ResendableContent.ifMediaGroupContent(block: (MediaGroupContent) -> T): T? = + mediaGroupContentOrNull() ?.let(block) + +public inline fun ResendableContent.textedMediaContentOrNull(): TextedMediaContent? = this as? + dev.inmo.tgbotapi.types.message.content.TextedMediaContent + +public inline fun ResendableContent.textedMediaContentOrThrow(): TextedMediaContent = this as + dev.inmo.tgbotapi.types.message.content.TextedMediaContent + +public inline fun ResendableContent.ifTextedMediaContent(block: (TextedMediaContent) -> T): T? = + textedMediaContentOrNull() ?.let(block) + +public inline fun ResendableContent.visualMediaGroupContentOrNull(): VisualMediaGroupContent? = this + as? dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent + +public inline fun ResendableContent.visualMediaGroupContentOrThrow(): VisualMediaGroupContent = this + as dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent + +public inline fun + ResendableContent.ifVisualMediaGroupContent(block: (VisualMediaGroupContent) -> T): T? = + visualMediaGroupContentOrNull() ?.let(block) + +public inline fun ResendableContent.animationContentOrNull(): AnimationContent? = this as? + dev.inmo.tgbotapi.types.message.content.AnimationContent + +public inline fun ResendableContent.animationContentOrThrow(): AnimationContent = this as + dev.inmo.tgbotapi.types.message.content.AnimationContent + +public inline fun ResendableContent.ifAnimationContent(block: (AnimationContent) -> T): T? = + animationContentOrNull() ?.let(block) + +public inline fun ResendableContent.audioContentOrNull(): AudioContent? = this as? + dev.inmo.tgbotapi.types.message.content.AudioContent + +public inline fun ResendableContent.audioContentOrThrow(): AudioContent = this as + dev.inmo.tgbotapi.types.message.content.AudioContent + +public inline fun ResendableContent.ifAudioContent(block: (AudioContent) -> T): T? = + audioContentOrNull() ?.let(block) + +public inline fun ResendableContent.contactContentOrNull(): ContactContent? = this as? + dev.inmo.tgbotapi.types.message.content.ContactContent + +public inline fun ResendableContent.contactContentOrThrow(): ContactContent = this as + dev.inmo.tgbotapi.types.message.content.ContactContent + +public inline fun ResendableContent.ifContactContent(block: (ContactContent) -> T): T? = + contactContentOrNull() ?.let(block) + +public inline fun ResendableContent.diceContentOrNull(): DiceContent? = this as? + dev.inmo.tgbotapi.types.message.content.DiceContent + +public inline fun ResendableContent.diceContentOrThrow(): DiceContent = this as + dev.inmo.tgbotapi.types.message.content.DiceContent + +public inline fun ResendableContent.ifDiceContent(block: (DiceContent) -> T): T? = + diceContentOrNull() ?.let(block) + +public inline fun ResendableContent.documentContentOrNull(): DocumentContent? = this as? + dev.inmo.tgbotapi.types.message.content.DocumentContent + +public inline fun ResendableContent.documentContentOrThrow(): DocumentContent = this as + dev.inmo.tgbotapi.types.message.content.DocumentContent + +public inline fun ResendableContent.ifDocumentContent(block: (DocumentContent) -> T): T? = + documentContentOrNull() ?.let(block) + +public inline fun ResendableContent.gameContentOrNull(): GameContent? = this as? + dev.inmo.tgbotapi.types.message.content.GameContent + +public inline fun ResendableContent.gameContentOrThrow(): GameContent = this as + dev.inmo.tgbotapi.types.message.content.GameContent + +public inline fun ResendableContent.ifGameContent(block: (GameContent) -> T): T? = + gameContentOrNull() ?.let(block) + +public inline fun ResendableContent.invoiceContentOrNull(): InvoiceContent? = this as? + dev.inmo.tgbotapi.types.message.content.InvoiceContent + +public inline fun ResendableContent.invoiceContentOrThrow(): InvoiceContent = this as + dev.inmo.tgbotapi.types.message.content.InvoiceContent + +public inline fun ResendableContent.ifInvoiceContent(block: (InvoiceContent) -> T): T? = + invoiceContentOrNull() ?.let(block) + +public inline fun ResendableContent.locationContentOrNull(): LocationContent? = this as? + dev.inmo.tgbotapi.types.message.content.LocationContent + +public inline fun ResendableContent.locationContentOrThrow(): LocationContent = this as + dev.inmo.tgbotapi.types.message.content.LocationContent + +public inline fun ResendableContent.ifLocationContent(block: (LocationContent) -> T): T? = + locationContentOrNull() ?.let(block) + +public inline fun ResendableContent.liveLocationContentOrNull(): LiveLocationContent? = this as? + dev.inmo.tgbotapi.types.message.content.LiveLocationContent + +public inline fun ResendableContent.liveLocationContentOrThrow(): LiveLocationContent = this as + dev.inmo.tgbotapi.types.message.content.LiveLocationContent + +public inline fun ResendableContent.ifLiveLocationContent(block: (LiveLocationContent) -> T): T? + = liveLocationContentOrNull() ?.let(block) + +public inline fun ResendableContent.staticLocationContentOrNull(): StaticLocationContent? = this as? + dev.inmo.tgbotapi.types.message.content.StaticLocationContent + +public inline fun ResendableContent.staticLocationContentOrThrow(): StaticLocationContent = this as + dev.inmo.tgbotapi.types.message.content.StaticLocationContent + +public inline fun + ResendableContent.ifStaticLocationContent(block: (StaticLocationContent) -> T): T? = + staticLocationContentOrNull() ?.let(block) + +public inline fun ResendableContent.photoContentOrNull(): PhotoContent? = this as? + dev.inmo.tgbotapi.types.message.content.PhotoContent + +public inline fun ResendableContent.photoContentOrThrow(): PhotoContent = this as + dev.inmo.tgbotapi.types.message.content.PhotoContent + +public inline fun ResendableContent.ifPhotoContent(block: (PhotoContent) -> T): T? = + photoContentOrNull() ?.let(block) + +public inline fun ResendableContent.pollContentOrNull(): PollContent? = this as? + dev.inmo.tgbotapi.types.message.content.PollContent + +public inline fun ResendableContent.pollContentOrThrow(): PollContent = this as + dev.inmo.tgbotapi.types.message.content.PollContent + +public inline fun ResendableContent.ifPollContent(block: (PollContent) -> T): T? = + pollContentOrNull() ?.let(block) + +public inline fun ResendableContent.stickerContentOrNull(): StickerContent? = this as? + dev.inmo.tgbotapi.types.message.content.StickerContent + +public inline fun ResendableContent.stickerContentOrThrow(): StickerContent = this as + dev.inmo.tgbotapi.types.message.content.StickerContent + +public inline fun ResendableContent.ifStickerContent(block: (StickerContent) -> T): T? = + stickerContentOrNull() ?.let(block) + +public inline fun ResendableContent.textContentOrNull(): TextContent? = this as? + dev.inmo.tgbotapi.types.message.content.TextContent + +public inline fun ResendableContent.textContentOrThrow(): TextContent = this as + dev.inmo.tgbotapi.types.message.content.TextContent + +public inline fun ResendableContent.ifTextContent(block: (TextContent) -> T): T? = + textContentOrNull() ?.let(block) + +public inline fun ResendableContent.venueContentOrNull(): VenueContent? = this as? + dev.inmo.tgbotapi.types.message.content.VenueContent + +public inline fun ResendableContent.venueContentOrThrow(): VenueContent = this as + dev.inmo.tgbotapi.types.message.content.VenueContent + +public inline fun ResendableContent.ifVenueContent(block: (VenueContent) -> T): T? = + venueContentOrNull() ?.let(block) + +public inline fun ResendableContent.videoContentOrNull(): VideoContent? = this as? + dev.inmo.tgbotapi.types.message.content.VideoContent + +public inline fun ResendableContent.videoContentOrThrow(): VideoContent = this as + dev.inmo.tgbotapi.types.message.content.VideoContent + +public inline fun ResendableContent.ifVideoContent(block: (VideoContent) -> T): T? = + videoContentOrNull() ?.let(block) + +public inline fun ResendableContent.videoNoteContentOrNull(): VideoNoteContent? = this as? + dev.inmo.tgbotapi.types.message.content.VideoNoteContent + +public inline fun ResendableContent.videoNoteContentOrThrow(): VideoNoteContent = this as + dev.inmo.tgbotapi.types.message.content.VideoNoteContent + +public inline fun ResendableContent.ifVideoNoteContent(block: (VideoNoteContent) -> T): T? = + videoNoteContentOrNull() ?.let(block) + +public inline fun ResendableContent.voiceContentOrNull(): VoiceContent? = this as? + dev.inmo.tgbotapi.types.message.content.VoiceContent + +public inline fun ResendableContent.voiceContentOrThrow(): VoiceContent = this as + dev.inmo.tgbotapi.types.message.content.VoiceContent + +public inline fun ResendableContent.ifVoiceContent(block: (VoiceContent) -> T): T? = + voiceContentOrNull() ?.let(block) + +public inline fun TextSource.boldTextSourceOrNull(): BoldTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.BoldTextSource + +public inline fun TextSource.boldTextSourceOrThrow(): BoldTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.BoldTextSource + +public inline fun TextSource.ifBoldTextSource(block: (BoldTextSource) -> T): T? = + boldTextSourceOrNull() ?.let(block) + +public inline fun TextSource.botCommandTextSourceOrNull(): BotCommandTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource + +public inline fun TextSource.botCommandTextSourceOrThrow(): BotCommandTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource + +public inline fun TextSource.ifBotCommandTextSource(block: (BotCommandTextSource) -> T): T? = + botCommandTextSourceOrNull() ?.let(block) + +public inline fun TextSource.cashTagTextSourceOrNull(): CashTagTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.CashTagTextSource + +public inline fun TextSource.cashTagTextSourceOrThrow(): CashTagTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.CashTagTextSource + +public inline fun TextSource.ifCashTagTextSource(block: (CashTagTextSource) -> T): T? = + cashTagTextSourceOrNull() ?.let(block) + +public inline fun TextSource.codeTextSourceOrNull(): CodeTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.CodeTextSource + +public inline fun TextSource.codeTextSourceOrThrow(): CodeTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.CodeTextSource + +public inline fun TextSource.ifCodeTextSource(block: (CodeTextSource) -> T): T? = + codeTextSourceOrNull() ?.let(block) + +public inline fun TextSource.eMailTextSourceOrNull(): EMailTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.EMailTextSource + +public inline fun TextSource.eMailTextSourceOrThrow(): EMailTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.EMailTextSource + +public inline fun TextSource.ifEMailTextSource(block: (EMailTextSource) -> T): T? = + eMailTextSourceOrNull() ?.let(block) + +public inline fun TextSource.hashTagTextSourceOrNull(): HashTagTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource + +public inline fun TextSource.hashTagTextSourceOrThrow(): HashTagTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource + +public inline fun TextSource.ifHashTagTextSource(block: (HashTagTextSource) -> T): T? = + hashTagTextSourceOrNull() ?.let(block) + +public inline fun TextSource.italicTextSourceOrNull(): ItalicTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.ItalicTextSource + +public inline fun TextSource.italicTextSourceOrThrow(): ItalicTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.ItalicTextSource + +public inline fun TextSource.ifItalicTextSource(block: (ItalicTextSource) -> T): T? = + italicTextSourceOrNull() ?.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 + +public inline fun TextSource.ifMentionTextSource(block: (MentionTextSource) -> T): T? = + mentionTextSourceOrNull() ?.let(block) + +public inline fun TextSource.phoneNumberTextSourceOrNull(): PhoneNumberTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.PhoneNumberTextSource + +public inline fun TextSource.phoneNumberTextSourceOrThrow(): PhoneNumberTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.PhoneNumberTextSource + +public inline fun TextSource.ifPhoneNumberTextSource(block: (PhoneNumberTextSource) -> T): T? = + phoneNumberTextSourceOrNull() ?.let(block) + +public inline fun TextSource.preTextSourceOrNull(): PreTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.PreTextSource + +public inline fun TextSource.preTextSourceOrThrow(): PreTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.PreTextSource + +public inline fun TextSource.ifPreTextSource(block: (PreTextSource) -> T): T? = + preTextSourceOrNull() ?.let(block) + +public inline fun TextSource.regularTextSourceOrNull(): RegularTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.RegularTextSource + +public inline fun TextSource.regularTextSourceOrThrow(): RegularTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.RegularTextSource + +public inline fun TextSource.ifRegularTextSource(block: (RegularTextSource) -> T): T? = + regularTextSourceOrNull() ?.let(block) + +public inline fun TextSource.spoilerTextSourceOrNull(): SpoilerTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.SpoilerTextSource + +public inline fun TextSource.spoilerTextSourceOrThrow(): SpoilerTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.SpoilerTextSource + +public inline fun TextSource.ifSpoilerTextSource(block: (SpoilerTextSource) -> T): T? = + spoilerTextSourceOrNull() ?.let(block) + +public inline fun TextSource.strikethroughTextSourceOrNull(): StrikethroughTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.StrikethroughTextSource + +public inline fun TextSource.strikethroughTextSourceOrThrow(): StrikethroughTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.StrikethroughTextSource + +public inline fun TextSource.ifStrikethroughTextSource(block: (StrikethroughTextSource) -> T): + T? = strikethroughTextSourceOrNull() ?.let(block) + +public inline fun TextSource.textLinkTextSourceOrNull(): TextLinkTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.TextLinkTextSource + +public inline fun TextSource.textLinkTextSourceOrThrow(): TextLinkTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.TextLinkTextSource + +public inline fun TextSource.ifTextLinkTextSource(block: (TextLinkTextSource) -> T): T? = + textLinkTextSourceOrNull() ?.let(block) + +public inline fun TextSource.textMentionTextSourceOrNull(): TextMentionTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.TextMentionTextSource + +public inline fun TextSource.textMentionTextSourceOrThrow(): TextMentionTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.TextMentionTextSource + +public inline fun TextSource.ifTextMentionTextSource(block: (TextMentionTextSource) -> T): T? = + textMentionTextSourceOrNull() ?.let(block) + +public inline fun TextSource.multilevelTextSourceOrNull(): MultilevelTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.MultilevelTextSource + +public inline fun TextSource.multilevelTextSourceOrThrow(): MultilevelTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.MultilevelTextSource + +public inline fun TextSource.ifMultilevelTextSource(block: (MultilevelTextSource) -> T): T? = + multilevelTextSourceOrNull() ?.let(block) + +public inline fun TextSource.uRLTextSourceOrNull(): URLTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.URLTextSource + +public inline fun TextSource.uRLTextSourceOrThrow(): URLTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.URLTextSource + +public inline fun TextSource.ifURLTextSource(block: (URLTextSource) -> T): T? = + uRLTextSourceOrNull() ?.let(block) + +public inline fun TextSource.underlineTextSourceOrNull(): UnderlineTextSource? = this as? + dev.inmo.tgbotapi.types.message.textsources.UnderlineTextSource + +public inline fun TextSource.underlineTextSourceOrThrow(): UnderlineTextSource = this as + dev.inmo.tgbotapi.types.message.textsources.UnderlineTextSource + +public inline fun TextSource.ifUnderlineTextSource(block: (UnderlineTextSource) -> T): T? = + underlineTextSourceOrNull() ?.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 + +public inline fun + PassportElementError.ifUnknownPassportElementError(block: (UnknownPassportElementError) -> T): + T? = unknownPassportElementErrorOrNull() ?.let(block) + +public inline fun PassportElementError.passportSingleElementErrorOrNull(): + PassportSingleElementError? = this as? + dev.inmo.tgbotapi.types.passport.PassportSingleElementError + +public inline fun PassportElementError.passportSingleElementErrorOrThrow(): + PassportSingleElementError = this as dev.inmo.tgbotapi.types.passport.PassportSingleElementError + +public inline fun + PassportElementError.ifPassportSingleElementError(block: (PassportSingleElementError) -> T): T? + = passportSingleElementErrorOrNull() ?.let(block) + +public inline fun PassportElementError.passportMultipleElementsErrorOrNull(): + PassportMultipleElementsError? = this as? + dev.inmo.tgbotapi.types.passport.PassportMultipleElementsError + +public inline fun PassportElementError.passportMultipleElementsErrorOrThrow(): + PassportMultipleElementsError = this as + dev.inmo.tgbotapi.types.passport.PassportMultipleElementsError + +public inline fun + PassportElementError.ifPassportMultipleElementsError(block: (PassportMultipleElementsError) -> T): + T? = passportMultipleElementsErrorOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementFileErrorOrNull(): PassportElementFileError? = + this as? dev.inmo.tgbotapi.types.passport.PassportElementFileError + +public inline fun PassportElementError.passportElementFileErrorOrThrow(): PassportElementFileError = + this as dev.inmo.tgbotapi.types.passport.PassportElementFileError + +public inline fun + PassportElementError.ifPassportElementFileError(block: (PassportElementFileError) -> T): T? = + passportElementFileErrorOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementFilesErrorOrNull(): PassportElementFilesError? + = this as? dev.inmo.tgbotapi.types.passport.PassportElementFilesError + +public inline fun PassportElementError.passportElementFilesErrorOrThrow(): PassportElementFilesError + = this as dev.inmo.tgbotapi.types.passport.PassportElementFilesError + +public inline fun + PassportElementError.ifPassportElementFilesError(block: (PassportElementFilesError) -> T): T? = + passportElementFilesErrorOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorDataFieldOrNull(): + PassportElementErrorDataField? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorDataField + +public inline fun PassportElementError.passportElementErrorDataFieldOrThrow(): + PassportElementErrorDataField = this as + dev.inmo.tgbotapi.types.passport.PassportElementErrorDataField + +public inline fun + PassportElementError.ifPassportElementErrorDataField(block: (PassportElementErrorDataField) -> T): + T? = passportElementErrorDataFieldOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorFrontSideOrNull(): + PassportElementErrorFrontSide? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorFrontSide + +public inline fun PassportElementError.passportElementErrorFrontSideOrThrow(): + PassportElementErrorFrontSide = this as + dev.inmo.tgbotapi.types.passport.PassportElementErrorFrontSide + +public inline fun + PassportElementError.ifPassportElementErrorFrontSide(block: (PassportElementErrorFrontSide) -> T): + T? = passportElementErrorFrontSideOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorReverseSideOrNull(): + PassportElementErrorReverseSide? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorReverseSide + +public inline fun PassportElementError.passportElementErrorReverseSideOrThrow(): + PassportElementErrorReverseSide = this as + dev.inmo.tgbotapi.types.passport.PassportElementErrorReverseSide + +public inline fun + PassportElementError.ifPassportElementErrorReverseSide(block: (PassportElementErrorReverseSide) -> T): + T? = passportElementErrorReverseSideOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorSelfieOrNull(): + PassportElementErrorSelfie? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorSelfie + +public inline fun PassportElementError.passportElementErrorSelfieOrThrow(): + PassportElementErrorSelfie = this as dev.inmo.tgbotapi.types.passport.PassportElementErrorSelfie + +public inline fun + PassportElementError.ifPassportElementErrorSelfie(block: (PassportElementErrorSelfie) -> T): T? + = passportElementErrorSelfieOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorFileOrNull(): PassportElementErrorFile? = + this as? dev.inmo.tgbotapi.types.passport.PassportElementErrorFile + +public inline fun PassportElementError.passportElementErrorFileOrThrow(): PassportElementErrorFile = + this as dev.inmo.tgbotapi.types.passport.PassportElementErrorFile + +public inline fun + PassportElementError.ifPassportElementErrorFile(block: (PassportElementErrorFile) -> T): T? = + passportElementErrorFileOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorFilesOrNull(): PassportElementErrorFiles? + = this as? dev.inmo.tgbotapi.types.passport.PassportElementErrorFiles + +public inline fun PassportElementError.passportElementErrorFilesOrThrow(): PassportElementErrorFiles + = this as dev.inmo.tgbotapi.types.passport.PassportElementErrorFiles + +public inline fun + PassportElementError.ifPassportElementErrorFiles(block: (PassportElementErrorFiles) -> T): T? = + passportElementErrorFilesOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorTranslationFileOrNull(): + PassportElementErrorTranslationFile? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFile + +public inline fun PassportElementError.passportElementErrorTranslationFileOrThrow(): + PassportElementErrorTranslationFile = this as + dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFile + +public inline fun + PassportElementError.ifPassportElementErrorTranslationFile(block: (PassportElementErrorTranslationFile) -> T): + T? = passportElementErrorTranslationFileOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorTranslationFilesOrNull(): + PassportElementErrorTranslationFiles? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFiles + +public inline fun PassportElementError.passportElementErrorTranslationFilesOrThrow(): + PassportElementErrorTranslationFiles = this as + dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFiles + +public inline fun + PassportElementError.ifPassportElementErrorTranslationFiles(block: (PassportElementErrorTranslationFiles) -> T): + T? = passportElementErrorTranslationFilesOrNull() ?.let(block) + +public inline fun PassportElementError.passportElementErrorUnspecifiedOrNull(): + PassportElementErrorUnspecified? = this as? + dev.inmo.tgbotapi.types.passport.PassportElementErrorUnspecified + +public inline fun PassportElementError.passportElementErrorUnspecifiedOrThrow(): + PassportElementErrorUnspecified = this as + dev.inmo.tgbotapi.types.passport.PassportElementErrorUnspecified + +public inline fun + PassportElementError.ifPassportElementErrorUnspecified(block: (PassportElementErrorUnspecified) -> T): + T? = passportElementErrorUnspecifiedOrNull() ?.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 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.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.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.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.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.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.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.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 EncryptedPassportElement.emailOrNull(): Email? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.Email + +public inline fun EncryptedPassportElement.emailOrThrow(): Email = this as + dev.inmo.tgbotapi.types.passport.encrypted.Email + +public inline fun EncryptedPassportElement.ifEmail(block: (Email) -> T): T? = emailOrNull() + ?.let(block) + +public inline fun EncryptedPassportElement.encryptedAddressOrNull(): EncryptedAddress? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedAddress + +public inline fun EncryptedPassportElement.encryptedAddressOrThrow(): EncryptedAddress = this as + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedAddress + +public inline fun EncryptedPassportElement.ifEncryptedAddress(block: (EncryptedAddress) -> T): + T? = encryptedAddressOrNull() ?.let(block) + +public inline + fun EncryptedPassportElement.encryptedPassportElementWithTranslatableFilesCollectionOrNull(): + EncryptedPassportElementWithTranslatableFilesCollection? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableFilesCollection + +public inline + fun EncryptedPassportElement.encryptedPassportElementWithTranslatableFilesCollectionOrThrow(): + EncryptedPassportElementWithTranslatableFilesCollection = this as + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableFilesCollection + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithTranslatableFilesCollection(block: (EncryptedPassportElementWithTranslatableFilesCollection) -> T): + T? = encryptedPassportElementWithTranslatableFilesCollectionOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.utilityBillOrNull(): UtilityBill? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.UtilityBill + +public inline fun EncryptedPassportElement.utilityBillOrThrow(): UtilityBill = this as + dev.inmo.tgbotapi.types.passport.encrypted.UtilityBill + +public inline fun EncryptedPassportElement.ifUtilityBill(block: (UtilityBill) -> T): T? = + utilityBillOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.bankStatementOrNull(): BankStatement? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.BankStatement + +public inline fun EncryptedPassportElement.bankStatementOrThrow(): BankStatement = this as + dev.inmo.tgbotapi.types.passport.encrypted.BankStatement + +public inline fun EncryptedPassportElement.ifBankStatement(block: (BankStatement) -> T): T? = + bankStatementOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.rentalAgreementOrNull(): RentalAgreement? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.RentalAgreement + +public inline fun EncryptedPassportElement.rentalAgreementOrThrow(): RentalAgreement = this as + dev.inmo.tgbotapi.types.passport.encrypted.RentalAgreement + +public inline fun EncryptedPassportElement.ifRentalAgreement(block: (RentalAgreement) -> T): T? + = rentalAgreementOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.passportRegistrationOrNull(): PassportRegistration? = + this as? dev.inmo.tgbotapi.types.passport.encrypted.PassportRegistration + +public inline fun EncryptedPassportElement.passportRegistrationOrThrow(): PassportRegistration = + this as dev.inmo.tgbotapi.types.passport.encrypted.PassportRegistration + +public inline fun + EncryptedPassportElement.ifPassportRegistration(block: (PassportRegistration) -> T): T? = + passportRegistrationOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.temporaryRegistrationOrNull(): TemporaryRegistration? = + this as? dev.inmo.tgbotapi.types.passport.encrypted.TemporaryRegistration + +public inline fun EncryptedPassportElement.temporaryRegistrationOrThrow(): TemporaryRegistration = + this as dev.inmo.tgbotapi.types.passport.encrypted.TemporaryRegistration + +public inline fun + EncryptedPassportElement.ifTemporaryRegistration(block: (TemporaryRegistration) -> T): T? = + temporaryRegistrationOrNull() ?.let(block) + +public inline + fun EncryptedPassportElement.encryptedPassportElementWithTranslatableIDDocumentOrNull(): + EncryptedPassportElementWithTranslatableIDDocument? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableIDDocument + +public inline + fun EncryptedPassportElement.encryptedPassportElementWithTranslatableIDDocumentOrThrow(): + EncryptedPassportElementWithTranslatableIDDocument = this as + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableIDDocument + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithTranslatableIDDocument(block: (EncryptedPassportElementWithTranslatableIDDocument) -> T): + T? = encryptedPassportElementWithTranslatableIDDocumentOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.driverLicenseOrNull(): DriverLicense? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.DriverLicense + +public inline fun EncryptedPassportElement.driverLicenseOrThrow(): DriverLicense = this as + dev.inmo.tgbotapi.types.passport.encrypted.DriverLicense + +public inline fun EncryptedPassportElement.ifDriverLicense(block: (DriverLicense) -> T): T? = + driverLicenseOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.identityCardOrNull(): IdentityCard? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.IdentityCard + +public inline fun EncryptedPassportElement.identityCardOrThrow(): IdentityCard = this as + dev.inmo.tgbotapi.types.passport.encrypted.IdentityCard + +public inline fun EncryptedPassportElement.ifIdentityCard(block: (IdentityCard) -> T): T? = + identityCardOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPersonalDetailsOrNull(): + EncryptedPersonalDetails? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPersonalDetails + +public inline fun EncryptedPassportElement.encryptedPersonalDetailsOrThrow(): + EncryptedPersonalDetails = this as + dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPersonalDetails + +public inline fun + EncryptedPassportElement.ifEncryptedPersonalDetails(block: (EncryptedPersonalDetails) -> T): T? + = encryptedPersonalDetailsOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.passportOrNull(): Passport? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.Passport + +public inline fun EncryptedPassportElement.passportOrThrow(): Passport = this as + dev.inmo.tgbotapi.types.passport.encrypted.Passport + +public inline fun EncryptedPassportElement.ifPassport(block: (Passport) -> T): T? = + passportOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.commonPassportOrNull(): CommonPassport? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.CommonPassport + +public inline fun EncryptedPassportElement.commonPassportOrThrow(): CommonPassport = this as + dev.inmo.tgbotapi.types.passport.encrypted.CommonPassport + +public inline fun EncryptedPassportElement.ifCommonPassport(block: (CommonPassport) -> T): T? = + commonPassportOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.internalPassportOrNull(): InternalPassport? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.InternalPassport + +public inline fun EncryptedPassportElement.internalPassportOrThrow(): InternalPassport = this as + dev.inmo.tgbotapi.types.passport.encrypted.InternalPassport + +public inline fun EncryptedPassportElement.ifInternalPassport(block: (InternalPassport) -> T): + T? = internalPassportOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.phoneNumberOrNull(): PhoneNumber? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.PhoneNumber + +public inline fun EncryptedPassportElement.phoneNumberOrThrow(): PhoneNumber = this as + dev.inmo.tgbotapi.types.passport.encrypted.PhoneNumber + +public inline fun EncryptedPassportElement.ifPhoneNumber(block: (PhoneNumber) -> T): T? = + phoneNumberOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.unknownEncryptedPassportElementOrNull(): + UnknownEncryptedPassportElement? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.UnknownEncryptedPassportElement + +public inline fun EncryptedPassportElement.unknownEncryptedPassportElementOrThrow(): + UnknownEncryptedPassportElement = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.UnknownEncryptedPassportElement + +public inline fun + EncryptedPassportElement.ifUnknownEncryptedPassportElement(block: (UnknownEncryptedPassportElement) -> T): + T? = unknownEncryptedPassportElementOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementTranslatableOrNull(): + EncryptedPassportElementTranslatable? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementTranslatable + +public inline fun EncryptedPassportElement.encryptedPassportElementTranslatableOrThrow(): + EncryptedPassportElementTranslatable = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementTranslatable + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementTranslatable(block: (EncryptedPassportElementTranslatable) -> T): + T? = encryptedPassportElementTranslatableOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithDataOrNull(): + EncryptedPassportElementWithData? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithData + +public inline fun EncryptedPassportElement.encryptedPassportElementWithDataOrThrow(): + EncryptedPassportElementWithData = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithData + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithData(block: (EncryptedPassportElementWithData) -> T): + T? = encryptedPassportElementWithDataOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithEmailOrNull(): + EncryptedPassportElementWithEmail? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithEmail + +public inline fun EncryptedPassportElement.encryptedPassportElementWithEmailOrThrow(): + EncryptedPassportElementWithEmail = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithEmail + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithEmail(block: (EncryptedPassportElementWithEmail) -> T): + T? = encryptedPassportElementWithEmailOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithFilesCollectionOrNull(): + EncryptedPassportElementWithFilesCollection? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFilesCollection + +public inline fun EncryptedPassportElement.encryptedPassportElementWithFilesCollectionOrThrow(): + EncryptedPassportElementWithFilesCollection = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFilesCollection + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithFilesCollection(block: (EncryptedPassportElementWithFilesCollection) -> T): + T? = encryptedPassportElementWithFilesCollectionOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithFrontSideOrNull(): + EncryptedPassportElementWithFrontSide? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFrontSide + +public inline fun EncryptedPassportElement.encryptedPassportElementWithFrontSideOrThrow(): + EncryptedPassportElementWithFrontSide = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFrontSide + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithFrontSide(block: (EncryptedPassportElementWithFrontSide) -> T): + T? = encryptedPassportElementWithFrontSideOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithPhoneNumberOrNull(): + EncryptedPassportElementWithPhoneNumber? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithPhoneNumber + +public inline fun EncryptedPassportElement.encryptedPassportElementWithPhoneNumberOrThrow(): + EncryptedPassportElementWithPhoneNumber = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithPhoneNumber + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithPhoneNumber(block: (EncryptedPassportElementWithPhoneNumber) -> T): + T? = encryptedPassportElementWithPhoneNumberOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithReverseSideOrNull(): + EncryptedPassportElementWithReverseSide? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithReverseSide + +public inline fun EncryptedPassportElement.encryptedPassportElementWithReverseSideOrThrow(): + EncryptedPassportElementWithReverseSide = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithReverseSide + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithReverseSide(block: (EncryptedPassportElementWithReverseSide) -> T): + T? = encryptedPassportElementWithReverseSideOrNull() ?.let(block) + +public inline fun EncryptedPassportElement.encryptedPassportElementWithSelfieOrNull(): + EncryptedPassportElementWithSelfie? = this as? + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithSelfie + +public inline fun EncryptedPassportElement.encryptedPassportElementWithSelfieOrThrow(): + EncryptedPassportElementWithSelfie = this as + dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithSelfie + +public inline fun + EncryptedPassportElement.ifEncryptedPassportElementWithSelfie(block: (EncryptedPassportElementWithSelfie) -> T): + T? = encryptedPassportElementWithSelfieOrNull() ?.let(block) + +public inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrNull(): ExactScheduledCloseInfo? = + this as? dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo + +public inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrThrow(): ExactScheduledCloseInfo = + this as dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo + +public inline fun + ScheduledCloseInfo.ifExactScheduledCloseInfo(block: (ExactScheduledCloseInfo) -> T): T? = + exactScheduledCloseInfoOrNull() ?.let(block) + +public inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrNull(): + ApproximateScheduledCloseInfo? = this as? + dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo + +public inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrThrow(): + ApproximateScheduledCloseInfo = this as + dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo + +public inline fun + ScheduledCloseInfo.ifApproximateScheduledCloseInfo(block: (ApproximateScheduledCloseInfo) -> T): + T? = approximateScheduledCloseInfoOrNull() ?.let(block) + +public inline fun Poll.multipleAnswersPollOrNull(): MultipleAnswersPoll? = this as? + dev.inmo.tgbotapi.types.polls.MultipleAnswersPoll + +public inline fun Poll.multipleAnswersPollOrThrow(): MultipleAnswersPoll = this as + dev.inmo.tgbotapi.types.polls.MultipleAnswersPoll + +public inline fun Poll.ifMultipleAnswersPoll(block: (MultipleAnswersPoll) -> T): T? = + multipleAnswersPollOrNull() ?.let(block) + +public inline fun Poll.unknownPollTypeOrNull(): UnknownPollType? = this as? + dev.inmo.tgbotapi.types.polls.UnknownPollType + +public inline fun Poll.unknownPollTypeOrThrow(): UnknownPollType = this as + dev.inmo.tgbotapi.types.polls.UnknownPollType + +public inline fun Poll.ifUnknownPollType(block: (UnknownPollType) -> T): T? = + unknownPollTypeOrNull() ?.let(block) + +public inline fun Poll.regularPollOrNull(): RegularPoll? = this as? + dev.inmo.tgbotapi.types.polls.RegularPoll + +public inline fun Poll.regularPollOrThrow(): RegularPoll = this as + dev.inmo.tgbotapi.types.polls.RegularPoll + +public inline fun Poll.ifRegularPoll(block: (RegularPoll) -> T): T? = regularPollOrNull() + ?.let(block) + +public inline fun Poll.quizPollOrNull(): QuizPoll? = this as? dev.inmo.tgbotapi.types.polls.QuizPoll + +public inline fun Poll.quizPollOrThrow(): QuizPoll = this as dev.inmo.tgbotapi.types.polls.QuizPoll + +public inline fun Poll.ifQuizPoll(block: (QuizPoll) -> T): T? = quizPollOrNull() ?.let(block) + +public inline fun Update.callbackQueryUpdateOrNull(): CallbackQueryUpdate? = this as? + dev.inmo.tgbotapi.types.update.CallbackQueryUpdate + +public inline fun Update.callbackQueryUpdateOrThrow(): CallbackQueryUpdate = this as + dev.inmo.tgbotapi.types.update.CallbackQueryUpdate + +public inline fun Update.ifCallbackQueryUpdate(block: (CallbackQueryUpdate) -> T): T? = + callbackQueryUpdateOrNull() ?.let(block) + +public inline fun Update.channelPostUpdateOrNull(): ChannelPostUpdate? = this as? + dev.inmo.tgbotapi.types.update.ChannelPostUpdate + +public inline fun Update.channelPostUpdateOrThrow(): ChannelPostUpdate = this as + dev.inmo.tgbotapi.types.update.ChannelPostUpdate + +public inline fun Update.ifChannelPostUpdate(block: (ChannelPostUpdate) -> T): T? = + channelPostUpdateOrNull() ?.let(block) + +public inline fun Update.chatJoinRequestUpdateOrNull(): ChatJoinRequestUpdate? = this as? + dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate + +public inline fun Update.chatJoinRequestUpdateOrThrow(): ChatJoinRequestUpdate = this as + dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate + +public inline fun Update.ifChatJoinRequestUpdate(block: (ChatJoinRequestUpdate) -> T): T? = + chatJoinRequestUpdateOrNull() ?.let(block) + +public inline fun Update.chosenInlineResultUpdateOrNull(): ChosenInlineResultUpdate? = this as? + dev.inmo.tgbotapi.types.update.ChosenInlineResultUpdate + +public inline fun Update.chosenInlineResultUpdateOrThrow(): ChosenInlineResultUpdate = this as + dev.inmo.tgbotapi.types.update.ChosenInlineResultUpdate + +public inline fun Update.ifChosenInlineResultUpdate(block: (ChosenInlineResultUpdate) -> T): T? + = chosenInlineResultUpdateOrNull() ?.let(block) + +public inline fun Update.commonChatMemberUpdatedUpdateOrNull(): CommonChatMemberUpdatedUpdate? = + this as? dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate + +public inline fun Update.commonChatMemberUpdatedUpdateOrThrow(): CommonChatMemberUpdatedUpdate = + this as dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate + +public inline fun + Update.ifCommonChatMemberUpdatedUpdate(block: (CommonChatMemberUpdatedUpdate) -> T): T? = + commonChatMemberUpdatedUpdateOrNull() ?.let(block) + +public inline fun Update.editChannelPostUpdateOrNull(): EditChannelPostUpdate? = this as? + dev.inmo.tgbotapi.types.update.EditChannelPostUpdate + +public inline fun Update.editChannelPostUpdateOrThrow(): EditChannelPostUpdate = this as + dev.inmo.tgbotapi.types.update.EditChannelPostUpdate + +public inline fun Update.ifEditChannelPostUpdate(block: (EditChannelPostUpdate) -> T): T? = + editChannelPostUpdateOrNull() ?.let(block) + +public inline fun Update.editMessageUpdateOrNull(): EditMessageUpdate? = this as? + dev.inmo.tgbotapi.types.update.EditMessageUpdate + +public inline fun Update.editMessageUpdateOrThrow(): EditMessageUpdate = this as + dev.inmo.tgbotapi.types.update.EditMessageUpdate + +public inline fun Update.ifEditMessageUpdate(block: (EditMessageUpdate) -> T): T? = + editMessageUpdateOrNull() ?.let(block) + +public inline fun Update.inlineQueryUpdateOrNull(): InlineQueryUpdate? = this as? + dev.inmo.tgbotapi.types.update.InlineQueryUpdate + +public inline fun Update.inlineQueryUpdateOrThrow(): InlineQueryUpdate = this as + dev.inmo.tgbotapi.types.update.InlineQueryUpdate + +public inline fun Update.ifInlineQueryUpdate(block: (InlineQueryUpdate) -> T): T? = + inlineQueryUpdateOrNull() ?.let(block) + +public inline fun Update.messageUpdateOrNull(): MessageUpdate? = this as? + dev.inmo.tgbotapi.types.update.MessageUpdate + +public inline fun Update.messageUpdateOrThrow(): MessageUpdate = this as + dev.inmo.tgbotapi.types.update.MessageUpdate + +public inline fun Update.ifMessageUpdate(block: (MessageUpdate) -> T): T? = + messageUpdateOrNull() ?.let(block) + +public inline fun Update.myChatMemberUpdatedUpdateOrNull(): MyChatMemberUpdatedUpdate? = this as? + dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate + +public inline fun Update.myChatMemberUpdatedUpdateOrThrow(): MyChatMemberUpdatedUpdate = this as + dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate + +public inline fun Update.ifMyChatMemberUpdatedUpdate(block: (MyChatMemberUpdatedUpdate) -> T): + T? = myChatMemberUpdatedUpdateOrNull() ?.let(block) + +public inline fun Update.pollAnswerUpdateOrNull(): PollAnswerUpdate? = this as? + dev.inmo.tgbotapi.types.update.PollAnswerUpdate + +public inline fun Update.pollAnswerUpdateOrThrow(): PollAnswerUpdate = this as + dev.inmo.tgbotapi.types.update.PollAnswerUpdate + +public inline fun Update.ifPollAnswerUpdate(block: (PollAnswerUpdate) -> T): T? = + pollAnswerUpdateOrNull() ?.let(block) + +public inline fun Update.pollUpdateOrNull(): PollUpdate? = this as? + dev.inmo.tgbotapi.types.update.PollUpdate + +public inline fun Update.pollUpdateOrThrow(): PollUpdate = this as + dev.inmo.tgbotapi.types.update.PollUpdate + +public inline fun Update.ifPollUpdate(block: (PollUpdate) -> T): T? = pollUpdateOrNull() + ?.let(block) + +public inline fun Update.preCheckoutQueryUpdateOrNull(): PreCheckoutQueryUpdate? = this as? + dev.inmo.tgbotapi.types.update.PreCheckoutQueryUpdate + +public inline fun Update.preCheckoutQueryUpdateOrThrow(): PreCheckoutQueryUpdate = this as + dev.inmo.tgbotapi.types.update.PreCheckoutQueryUpdate + +public inline fun Update.ifPreCheckoutQueryUpdate(block: (PreCheckoutQueryUpdate) -> T): T? = + preCheckoutQueryUpdateOrNull() ?.let(block) + +public inline fun Update.shippingQueryUpdateOrNull(): ShippingQueryUpdate? = this as? + dev.inmo.tgbotapi.types.update.ShippingQueryUpdate + +public inline fun Update.shippingQueryUpdateOrThrow(): ShippingQueryUpdate = this as + dev.inmo.tgbotapi.types.update.ShippingQueryUpdate + +public inline fun Update.ifShippingQueryUpdate(block: (ShippingQueryUpdate) -> T): T? = + shippingQueryUpdateOrNull() ?.let(block) + +public inline fun Update.baseEditMessageUpdateOrNull(): BaseEditMessageUpdate? = this as? + dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate + +public inline fun Update.baseEditMessageUpdateOrThrow(): BaseEditMessageUpdate = this as + dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate + +public inline fun Update.ifBaseEditMessageUpdate(block: (BaseEditMessageUpdate) -> T): T? = + baseEditMessageUpdateOrNull() ?.let(block) + +public inline fun Update.baseMessageUpdateOrNull(): BaseMessageUpdate? = this as? + dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate + +public inline fun Update.baseMessageUpdateOrThrow(): BaseMessageUpdate = this as + dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate + +public inline fun Update.ifBaseMessageUpdate(block: (BaseMessageUpdate) -> T): T? = + baseMessageUpdateOrNull() ?.let(block) + +public inline fun Update.baseSentMessageUpdateOrNull(): BaseSentMessageUpdate? = this as? + dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate + +public inline fun Update.baseSentMessageUpdateOrThrow(): BaseSentMessageUpdate = this as + dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate + +public inline fun Update.ifBaseSentMessageUpdate(block: (BaseSentMessageUpdate) -> T): T? = + baseSentMessageUpdateOrNull() ?.let(block) + +public inline fun Update.chatMemberUpdatedUpdateOrNull(): ChatMemberUpdatedUpdate? = this as? + dev.inmo.tgbotapi.types.update.abstracts.ChatMemberUpdatedUpdate + +public inline fun Update.chatMemberUpdatedUpdateOrThrow(): ChatMemberUpdatedUpdate = this as + dev.inmo.tgbotapi.types.update.abstracts.ChatMemberUpdatedUpdate + +public inline fun Update.ifChatMemberUpdatedUpdate(block: (ChatMemberUpdatedUpdate) -> T): T? = + chatMemberUpdatedUpdateOrNull() ?.let(block) + +public inline fun Update.unknownUpdateOrNull(): UnknownUpdate? = this as? + dev.inmo.tgbotapi.types.update.abstracts.UnknownUpdate + +public inline fun Update.unknownUpdateOrThrow(): UnknownUpdate = this as + dev.inmo.tgbotapi.types.update.abstracts.UnknownUpdate + +public inline fun Update.ifUnknownUpdate(block: (UnknownUpdate) -> T): T? = + unknownUpdateOrNull() ?.let(block) + +public inline fun Update.channelPostMediaGroupUpdateOrNull(): ChannelPostMediaGroupUpdate? = this + as? dev.inmo.tgbotapi.types.update.media_group.ChannelPostMediaGroupUpdate + +public inline fun Update.channelPostMediaGroupUpdateOrThrow(): ChannelPostMediaGroupUpdate = this as + dev.inmo.tgbotapi.types.update.media_group.ChannelPostMediaGroupUpdate + +public inline fun + Update.ifChannelPostMediaGroupUpdate(block: (ChannelPostMediaGroupUpdate) -> T): T? = + channelPostMediaGroupUpdateOrNull() ?.let(block) + +public inline fun Update.editChannelPostMediaGroupUpdateOrNull(): EditChannelPostMediaGroupUpdate? = + this as? dev.inmo.tgbotapi.types.update.media_group.EditChannelPostMediaGroupUpdate + +public inline fun Update.editChannelPostMediaGroupUpdateOrThrow(): EditChannelPostMediaGroupUpdate = + this as dev.inmo.tgbotapi.types.update.media_group.EditChannelPostMediaGroupUpdate + +public inline fun + Update.ifEditChannelPostMediaGroupUpdate(block: (EditChannelPostMediaGroupUpdate) -> T): T? = + editChannelPostMediaGroupUpdateOrNull() ?.let(block) + +public inline fun Update.editMessageMediaGroupUpdateOrNull(): EditMessageMediaGroupUpdate? = this + as? dev.inmo.tgbotapi.types.update.media_group.EditMessageMediaGroupUpdate + +public inline fun Update.editMessageMediaGroupUpdateOrThrow(): EditMessageMediaGroupUpdate = this as + dev.inmo.tgbotapi.types.update.media_group.EditMessageMediaGroupUpdate + +public inline fun + Update.ifEditMessageMediaGroupUpdate(block: (EditMessageMediaGroupUpdate) -> T): T? = + editMessageMediaGroupUpdateOrNull() ?.let(block) + +public inline fun Update.mediaGroupUpdateOrNull(): MediaGroupUpdate? = this as? + dev.inmo.tgbotapi.types.update.media_group.MediaGroupUpdate + +public inline fun Update.mediaGroupUpdateOrThrow(): MediaGroupUpdate = this as + dev.inmo.tgbotapi.types.update.media_group.MediaGroupUpdate + +public inline fun Update.ifMediaGroupUpdate(block: (MediaGroupUpdate) -> T): T? = + mediaGroupUpdateOrNull() ?.let(block) + +public inline fun Update.sentMediaGroupUpdateOrNull(): SentMediaGroupUpdate? = this as? + dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate + +public inline fun Update.sentMediaGroupUpdateOrThrow(): SentMediaGroupUpdate = this as + dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate + +public inline fun Update.ifSentMediaGroupUpdate(block: (SentMediaGroupUpdate) -> T): T? = + sentMediaGroupUpdateOrNull() ?.let(block) + +public inline fun Update.editMediaGroupUpdateOrNull(): EditMediaGroupUpdate? = this as? + dev.inmo.tgbotapi.types.update.media_group.EditMediaGroupUpdate + +public inline fun Update.editMediaGroupUpdateOrThrow(): EditMediaGroupUpdate = this as + dev.inmo.tgbotapi.types.update.media_group.EditMediaGroupUpdate + +public inline fun Update.ifEditMediaGroupUpdate(block: (EditMediaGroupUpdate) -> T): T? = + editMediaGroupUpdateOrNull() ?.let(block) + +public inline fun Update.messageMediaGroupUpdateOrNull(): MessageMediaGroupUpdate? = this as? + dev.inmo.tgbotapi.types.update.media_group.MessageMediaGroupUpdate + +public inline fun Update.messageMediaGroupUpdateOrThrow(): MessageMediaGroupUpdate = this as + dev.inmo.tgbotapi.types.update.media_group.MessageMediaGroupUpdate + +public inline fun Update.ifMessageMediaGroupUpdate(block: (MessageMediaGroupUpdate) -> T): T? = + messageMediaGroupUpdateOrNull() ?.let(block) diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAny.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAny.kt new file mode 100644 index 0000000000..c782f769ca --- /dev/null +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAny.kt @@ -0,0 +1,36 @@ +@file:Suppress("NOTHING_TO_INLINE", "unused", "UNCHECKED_CAST") + +package dev.inmo.tgbotapi.extensions.utils + +import dev.inmo.tgbotapi.abstracts.FromUser +import dev.inmo.tgbotapi.abstracts.WithUser +import dev.inmo.tgbotapi.types.abstracts.WithOptionalLanguageCode +import dev.inmo.tgbotapi.utils.PreviewFeature + +@PreviewFeature +inline fun Any.ifFromUser(block: (FromUser) -> T) = fromUserOrNull()?.let(block) + +@PreviewFeature +inline fun Any.fromUserOrNull(): FromUser? = this as? FromUser + +@PreviewFeature +inline fun Any.fromUserOrThrow(): FromUser = this as FromUser + +@PreviewFeature +inline fun Any.ifWithUser(block: (WithUser) -> T) = withUserOrNull()?.let(block) + +@PreviewFeature +inline fun Any.withUserOrNull(): WithUser? = this as? WithUser + +@PreviewFeature +inline fun Any.withUserOrThrow(): WithUser = this as WithUser + +@PreviewFeature +inline fun Any.ifWithOptionalLanguageCode(block: (WithOptionalLanguageCode) -> T) = + withOptionalLanguageCodeOrNull()?.let(block) + +@PreviewFeature +inline fun Any.withOptionalLanguageCodeOrNull(): WithOptionalLanguageCode? = this as? WithOptionalLanguageCode + +@PreviewFeature +inline fun Any.withOptionalLanguageCodeOrThrow(): WithOptionalLanguageCode = this as WithOptionalLanguageCode diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/NewClassCasts.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/NewClassCasts.kt deleted file mode 100644 index 9547763e56..0000000000 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/NewClassCasts.kt +++ /dev/null @@ -1,4451 +0,0 @@ -package dev.inmo.tgbotapi.extensions.utils - -import dev.inmo.tgbotapi.abstracts.CommonSendInvoiceData -import dev.inmo.tgbotapi.abstracts.FromUser -import dev.inmo.tgbotapi.abstracts.WithUser -import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink -import dev.inmo.tgbotapi.requests.send.payments.SendInvoice -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.InlineQueries.ChosenInlineResult.BaseChosenInlineResult -import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult -import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioCachedImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultContact -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentCachedImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGame -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifCachedImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultLocation -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifCachedImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoCachedImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultStickerCached -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVenue -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoCachedImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceCachedImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceImpl -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.DescribedInlineQueryResult -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.FileInlineQueryResult -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.OptionallyTitledInlineQueryResult -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.SizedInlineQueryResult -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbSizedInlineQueryResult -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedInlineQueryResult -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedWithMimeTypeInlineQueryResult -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.TitledInlineQueryResult -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.UrlInlineQueryResult -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCommon -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocument -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCached -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCommon -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCommon -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCached -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCommon -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhoto -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCached -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCommon -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCached -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCommon -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached -import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCommon -import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputContactMessageContent -import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent -import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputLocationMessageContent -import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputMessageContent -import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent -import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessageContent -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.PrimaryInviteLink -import dev.inmo.tgbotapi.types.SecondaryChatInviteLink -import dev.inmo.tgbotapi.types.actions.BotAction -import dev.inmo.tgbotapi.types.actions.ChooseStickerAction -import dev.inmo.tgbotapi.types.actions.CustomBotAction -import dev.inmo.tgbotapi.types.actions.FindLocationAction -import dev.inmo.tgbotapi.types.actions.RecordVideoAction -import dev.inmo.tgbotapi.types.actions.RecordVideoNoteAction -import dev.inmo.tgbotapi.types.actions.RecordVoiceAction -import dev.inmo.tgbotapi.types.actions.TypingAction -import dev.inmo.tgbotapi.types.actions.UploadDocumentAction -import dev.inmo.tgbotapi.types.actions.UploadPhotoAction -import dev.inmo.tgbotapi.types.actions.UploadVideoAction -import dev.inmo.tgbotapi.types.actions.UploadVideoNoteAction -import dev.inmo.tgbotapi.types.actions.UploadVoiceAction -import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackDataInlineKeyboardButton -import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackGameInlineKeyboardButton -import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.InlineKeyboardButton -import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.LoginURLInlineKeyboardButton -import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.PayInlineKeyboardButton -import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryCurrentChatInlineKeyboardButton -import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryInlineKeyboardButton -import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.URLInlineKeyboardButton -import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.UnknownInlineKeyboardButton -import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.WebAppInlineKeyboardButton -import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup -import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup -import dev.inmo.tgbotapi.types.buttons.ReplyForce -import dev.inmo.tgbotapi.types.buttons.ReplyKeyboardMarkup -import dev.inmo.tgbotapi.types.buttons.ReplyKeyboardRemove -import dev.inmo.tgbotapi.types.chat.AbleToAddInAttachmentMenuChat -import dev.inmo.tgbotapi.types.chat.Bot -import dev.inmo.tgbotapi.types.chat.ChannelChat -import dev.inmo.tgbotapi.types.chat.ChannelChatImpl -import dev.inmo.tgbotapi.types.chat.Chat -import dev.inmo.tgbotapi.types.chat.ChatJoinRequest -import dev.inmo.tgbotapi.types.chat.CommonBot -import dev.inmo.tgbotapi.types.chat.CommonUser -import dev.inmo.tgbotapi.types.chat.ExtendedBot -import dev.inmo.tgbotapi.types.chat.ExtendedChannelChat -import dev.inmo.tgbotapi.types.chat.ExtendedChannelChatImpl -import dev.inmo.tgbotapi.types.chat.ExtendedChat -import dev.inmo.tgbotapi.types.chat.ExtendedGroupChat -import dev.inmo.tgbotapi.types.chat.ExtendedGroupChatImpl -import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat -import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChatImpl -import dev.inmo.tgbotapi.types.chat.ExtendedPublicChat -import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat -import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChatImpl -import dev.inmo.tgbotapi.types.chat.GroupChat -import dev.inmo.tgbotapi.types.chat.GroupChatImpl -import dev.inmo.tgbotapi.types.chat.PossiblyPremiumChat -import dev.inmo.tgbotapi.types.chat.PrivateChat -import dev.inmo.tgbotapi.types.chat.PrivateChatImpl -import dev.inmo.tgbotapi.types.chat.PublicChat -import dev.inmo.tgbotapi.types.chat.SuperPublicChat -import dev.inmo.tgbotapi.types.chat.SupergroupChat -import dev.inmo.tgbotapi.types.chat.SupergroupChatImpl -import dev.inmo.tgbotapi.types.chat.UnknownChatType -import dev.inmo.tgbotapi.types.chat.UnknownExtendedChat -import dev.inmo.tgbotapi.types.chat.User -import dev.inmo.tgbotapi.types.chat.UsernameChat -import dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember -import dev.inmo.tgbotapi.types.chat.member.AdministratorChatMemberImpl -import dev.inmo.tgbotapi.types.chat.member.BannedChatMember -import dev.inmo.tgbotapi.types.chat.member.ChatMember -import dev.inmo.tgbotapi.types.chat.member.KickedChatMember -import dev.inmo.tgbotapi.types.chat.member.LeftChatMember -import dev.inmo.tgbotapi.types.chat.member.LeftChatMemberImpl -import dev.inmo.tgbotapi.types.chat.member.MemberChatMember -import dev.inmo.tgbotapi.types.chat.member.MemberChatMemberImpl -import dev.inmo.tgbotapi.types.chat.member.OwnerChatMember -import dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember -import dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember -import dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType -import dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType -import dev.inmo.tgbotapi.types.dice.CubeDiceAnimationType -import dev.inmo.tgbotapi.types.dice.CustomDiceAnimationType -import dev.inmo.tgbotapi.types.dice.DartsDiceAnimationType -import dev.inmo.tgbotapi.types.dice.DiceAnimationType -import dev.inmo.tgbotapi.types.dice.FootballDiceAnimationType -import dev.inmo.tgbotapi.types.dice.SlotMachineDiceAnimationType -import dev.inmo.tgbotapi.types.files.AnimatedSticker -import dev.inmo.tgbotapi.types.files.AnimationFile -import dev.inmo.tgbotapi.types.files.AudioFile -import dev.inmo.tgbotapi.types.files.DocumentFile -import dev.inmo.tgbotapi.types.files.File -import dev.inmo.tgbotapi.types.files.MimedMediaFile -import dev.inmo.tgbotapi.types.files.PassportFile -import dev.inmo.tgbotapi.types.files.PathedFile -import dev.inmo.tgbotapi.types.files.PhotoSize -import dev.inmo.tgbotapi.types.files.PlayableMediaFile -import dev.inmo.tgbotapi.types.files.SimpleSticker -import dev.inmo.tgbotapi.types.files.SizedMediaFile -import dev.inmo.tgbotapi.types.files.Sticker -import dev.inmo.tgbotapi.types.files.TelegramMediaFile -import dev.inmo.tgbotapi.types.files.ThumbedMediaFile -import dev.inmo.tgbotapi.types.files.VideoFile -import dev.inmo.tgbotapi.types.files.VideoNoteFile -import dev.inmo.tgbotapi.types.files.VideoSticker -import dev.inmo.tgbotapi.types.files.VoiceFile -import dev.inmo.tgbotapi.types.location.LiveLocation -import dev.inmo.tgbotapi.types.location.Location -import dev.inmo.tgbotapi.types.location.StaticLocation -import dev.inmo.tgbotapi.types.media.AudioMediaGroupMemberTelegramMedia -import dev.inmo.tgbotapi.types.media.DocumentMediaGroupMemberTelegramMedia -import dev.inmo.tgbotapi.types.media.DuratedTelegramMedia -import dev.inmo.tgbotapi.types.media.MediaGroupMemberTelegramMedia -import dev.inmo.tgbotapi.types.media.SizedTelegramMedia -import dev.inmo.tgbotapi.types.media.TelegramMedia -import dev.inmo.tgbotapi.types.media.TelegramMediaAnimation -import dev.inmo.tgbotapi.types.media.TelegramMediaAudio -import dev.inmo.tgbotapi.types.media.TelegramMediaDocument -import dev.inmo.tgbotapi.types.media.TelegramMediaPhoto -import dev.inmo.tgbotapi.types.media.TelegramMediaVideo -import dev.inmo.tgbotapi.types.media.ThumbedTelegramMedia -import dev.inmo.tgbotapi.types.media.TitledTelegramMedia -import dev.inmo.tgbotapi.types.media.VisualMediaGroupMemberTelegramMedia -import dev.inmo.tgbotapi.types.message.AnonymousGroupContentMessageImpl -import dev.inmo.tgbotapi.types.message.ChannelContentMessageImpl -import dev.inmo.tgbotapi.types.message.ChannelEventMessage -import dev.inmo.tgbotapi.types.message.ChannelMediaGroupMessage -import dev.inmo.tgbotapi.types.message.ChatEvents.ChannelChatCreated -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.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.GroupEvent -import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateEvent -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.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.CommonGroupContentMessageImpl -import dev.inmo.tgbotapi.types.message.CommonGroupEventMessage -import dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage -import dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage -import dev.inmo.tgbotapi.types.message.ConnectedFromChannelGroupContentMessageImpl -import dev.inmo.tgbotapi.types.message.ForwardInfo -import dev.inmo.tgbotapi.types.message.PassportMessage -import dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl -import dev.inmo.tgbotapi.types.message.PrivateEventMessage -import dev.inmo.tgbotapi.types.message.UnconnectedFromChannelGroupContentMessageImpl -import dev.inmo.tgbotapi.types.message.abstracts.AnonymousGroupContentMessage -import dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage -import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage -import dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage -import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage -import dev.inmo.tgbotapi.types.message.abstracts.ConnectedFromChannelGroupContentMessage -import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage -import dev.inmo.tgbotapi.types.message.abstracts.FromChannelGroupContentMessage -import dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage -import dev.inmo.tgbotapi.types.message.abstracts.GroupContentMessage -import dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage -import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage -import dev.inmo.tgbotapi.types.message.abstracts.Message -import dev.inmo.tgbotapi.types.message.abstracts.PossiblyEditedMessage -import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage -import dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage -import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage -import dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage -import dev.inmo.tgbotapi.types.message.abstracts.PublicContentMessage -import dev.inmo.tgbotapi.types.message.abstracts.SignedMessage -import dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage -import dev.inmo.tgbotapi.types.message.abstracts.UnconnectedFromChannelGroupContentMessage -import dev.inmo.tgbotapi.types.message.abstracts.UnknownMessageType -import dev.inmo.tgbotapi.types.message.content.AnimationContent -import dev.inmo.tgbotapi.types.message.content.AudioContent -import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.ContactContent -import dev.inmo.tgbotapi.types.message.content.DiceContent -import dev.inmo.tgbotapi.types.message.content.DocumentContent -import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.GameContent -import dev.inmo.tgbotapi.types.message.content.InvoiceContent -import dev.inmo.tgbotapi.types.message.content.LiveLocationContent -import dev.inmo.tgbotapi.types.message.content.LocationContent -import dev.inmo.tgbotapi.types.message.content.MediaCollectionContent -import dev.inmo.tgbotapi.types.message.content.MediaContent -import dev.inmo.tgbotapi.types.message.content.MediaGroupContent -import dev.inmo.tgbotapi.types.message.content.MessageContent -import dev.inmo.tgbotapi.types.message.content.PhotoContent -import dev.inmo.tgbotapi.types.message.content.PollContent -import dev.inmo.tgbotapi.types.message.content.ResendableContent -import dev.inmo.tgbotapi.types.message.content.StaticLocationContent -import dev.inmo.tgbotapi.types.message.content.StickerContent -import dev.inmo.tgbotapi.types.message.content.TextContent -import dev.inmo.tgbotapi.types.message.content.TextedMediaContent -import dev.inmo.tgbotapi.types.message.content.VenueContent -import dev.inmo.tgbotapi.types.message.content.VideoContent -import dev.inmo.tgbotapi.types.message.content.VideoNoteContent -import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.VoiceContent -import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent -import dev.inmo.tgbotapi.types.message.textsources.BoldTextSource -import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource -import dev.inmo.tgbotapi.types.message.textsources.CashTagTextSource -import dev.inmo.tgbotapi.types.message.textsources.CodeTextSource -import dev.inmo.tgbotapi.types.message.textsources.EMailTextSource -import dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource -import dev.inmo.tgbotapi.types.message.textsources.ItalicTextSource -import dev.inmo.tgbotapi.types.message.textsources.MentionTextSource -import dev.inmo.tgbotapi.types.message.textsources.MultilevelTextSource -import dev.inmo.tgbotapi.types.message.textsources.PhoneNumberTextSource -import dev.inmo.tgbotapi.types.message.textsources.PreTextSource -import dev.inmo.tgbotapi.types.message.textsources.RegularTextSource -import dev.inmo.tgbotapi.types.message.textsources.SpoilerTextSource -import dev.inmo.tgbotapi.types.message.textsources.StrikethroughTextSource -import dev.inmo.tgbotapi.types.message.textsources.TextLinkTextSource -import dev.inmo.tgbotapi.types.message.textsources.TextMentionTextSource -import dev.inmo.tgbotapi.types.message.textsources.TextSource -import dev.inmo.tgbotapi.types.message.textsources.URLTextSource -import dev.inmo.tgbotapi.types.message.textsources.UnderlineTextSource -import dev.inmo.tgbotapi.types.passport.PassportElementError -import dev.inmo.tgbotapi.types.passport.PassportElementErrorDataField -import dev.inmo.tgbotapi.types.passport.PassportElementErrorFile -import dev.inmo.tgbotapi.types.passport.PassportElementErrorFiles -import dev.inmo.tgbotapi.types.passport.PassportElementErrorFrontSide -import dev.inmo.tgbotapi.types.passport.PassportElementErrorReverseSide -import dev.inmo.tgbotapi.types.passport.PassportElementErrorSelfie -import dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFile -import dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFiles -import dev.inmo.tgbotapi.types.passport.PassportElementErrorUnspecified -import dev.inmo.tgbotapi.types.passport.PassportElementFileError -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 -import dev.inmo.tgbotapi.types.passport.encrypted.Email -import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedAddress -import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableFilesCollection -import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableIDDocument -import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPersonalDetails -import dev.inmo.tgbotapi.types.passport.encrypted.IdentityCard -import dev.inmo.tgbotapi.types.passport.encrypted.InternalPassport -import dev.inmo.tgbotapi.types.passport.encrypted.Passport -import dev.inmo.tgbotapi.types.passport.encrypted.PassportRegistration -import dev.inmo.tgbotapi.types.passport.encrypted.PhoneNumber -import dev.inmo.tgbotapi.types.passport.encrypted.RentalAgreement -import dev.inmo.tgbotapi.types.passport.encrypted.TemporaryRegistration -import dev.inmo.tgbotapi.types.passport.encrypted.UtilityBill -import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement -import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementTranslatable -import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithData -import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithEmail -import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFilesCollection -import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFrontSide -import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithPhoneNumber -import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithReverseSide -import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithSelfie -import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.UnknownEncryptedPassportElement -import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery -import dev.inmo.tgbotapi.types.payments.ShippingQuery -import dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo -import dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo -import dev.inmo.tgbotapi.types.polls.MultipleAnswersPoll -import dev.inmo.tgbotapi.types.polls.Poll -import dev.inmo.tgbotapi.types.polls.PollAnswer -import dev.inmo.tgbotapi.types.polls.QuizPoll -import dev.inmo.tgbotapi.types.polls.RegularPoll -import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo -import dev.inmo.tgbotapi.types.polls.UnknownPollType -import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery -import dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery -import dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery -import dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery -import dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery -import dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery -import dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery -import dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery -import dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery -import dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType -import dev.inmo.tgbotapi.types.update.CallbackQueryUpdate -import dev.inmo.tgbotapi.types.update.ChannelPostUpdate -import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate -import dev.inmo.tgbotapi.types.update.ChosenInlineResultUpdate -import dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate -import dev.inmo.tgbotapi.types.update.EditChannelPostUpdate -import dev.inmo.tgbotapi.types.update.EditMessageUpdate -import dev.inmo.tgbotapi.types.update.InlineQueryUpdate -import dev.inmo.tgbotapi.types.update.MessageUpdate -import dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate -import dev.inmo.tgbotapi.types.update.PollAnswerUpdate -import dev.inmo.tgbotapi.types.update.PollUpdate -import dev.inmo.tgbotapi.types.update.PreCheckoutQueryUpdate -import dev.inmo.tgbotapi.types.update.ShippingQueryUpdate -import dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate -import dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate -import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate -import dev.inmo.tgbotapi.types.update.abstracts.ChatMemberUpdatedUpdate -import dev.inmo.tgbotapi.types.update.abstracts.UnknownUpdate -import dev.inmo.tgbotapi.types.update.abstracts.Update -import dev.inmo.tgbotapi.types.update.media_group.ChannelPostMediaGroupUpdate -import dev.inmo.tgbotapi.types.update.media_group.EditChannelPostMediaGroupUpdate -import dev.inmo.tgbotapi.types.update.media_group.EditMediaGroupUpdate -import dev.inmo.tgbotapi.types.update.media_group.EditMessageMediaGroupUpdate -import dev.inmo.tgbotapi.types.update.media_group.MediaGroupUpdate -import dev.inmo.tgbotapi.types.update.media_group.MessageMediaGroupUpdate -import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate - -public inline fun CommonSendInvoiceData.createInvoiceLinkOrNull(): CreateInvoiceLink? = this as? - dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink - -public inline fun CommonSendInvoiceData.createInvoiceLinkOrThrow(): CreateInvoiceLink = this as - dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink - -public inline fun CommonSendInvoiceData.ifCreateInvoiceLink(block: (CreateInvoiceLink) -> T): T? - = createInvoiceLinkOrNull() ?.let(block) - -public inline fun CommonSendInvoiceData.sendInvoiceOrNull(): SendInvoice? = this as? - dev.inmo.tgbotapi.requests.send.payments.SendInvoice - -public inline fun CommonSendInvoiceData.sendInvoiceOrThrow(): SendInvoice = this as - dev.inmo.tgbotapi.requests.send.payments.SendInvoice - -public inline fun CommonSendInvoiceData.ifSendInvoice(block: (SendInvoice) -> T): T? = - sendInvoiceOrNull() ?.let(block) - -public inline fun CommonSendInvoiceData.inputInvoiceMessageContentOrNull(): - InputInvoiceMessageContent? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent - -public inline fun CommonSendInvoiceData.inputInvoiceMessageContentOrThrow(): - InputInvoiceMessageContent = this as - dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent - -public inline fun - CommonSendInvoiceData.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T): T? - = inputInvoiceMessageContentOrNull() ?.let(block) - -public inline fun WithUser.fromUserOrNull(): FromUser? = this as? - dev.inmo.tgbotapi.abstracts.FromUser - -public inline fun WithUser.fromUserOrThrow(): FromUser = this as - dev.inmo.tgbotapi.abstracts.FromUser - -public inline fun WithUser.ifFromUser(block: (FromUser) -> T): T? = fromUserOrNull() - ?.let(block) - -public inline fun WithUser.chatInviteLinkOrNull(): ChatInviteLink? = this as? - dev.inmo.tgbotapi.types.ChatInviteLink - -public inline fun WithUser.chatInviteLinkOrThrow(): ChatInviteLink = this as - dev.inmo.tgbotapi.types.ChatInviteLink - -public inline fun WithUser.ifChatInviteLink(block: (ChatInviteLink) -> T): T? = - chatInviteLinkOrNull() ?.let(block) - -public inline fun WithUser.secondaryChatInviteLinkOrNull(): SecondaryChatInviteLink? = this as? - dev.inmo.tgbotapi.types.SecondaryChatInviteLink - -public inline fun WithUser.secondaryChatInviteLinkOrThrow(): SecondaryChatInviteLink = this as - dev.inmo.tgbotapi.types.SecondaryChatInviteLink - -public inline fun WithUser.ifSecondaryChatInviteLink(block: (SecondaryChatInviteLink) -> T): T? - = secondaryChatInviteLinkOrNull() ?.let(block) - -public inline fun WithUser.primaryInviteLinkOrNull(): PrimaryInviteLink? = this as? - dev.inmo.tgbotapi.types.PrimaryInviteLink - -public inline fun WithUser.primaryInviteLinkOrThrow(): PrimaryInviteLink = this as - dev.inmo.tgbotapi.types.PrimaryInviteLink - -public inline fun WithUser.ifPrimaryInviteLink(block: (PrimaryInviteLink) -> T): T? = - primaryInviteLinkOrNull() ?.let(block) - -public inline fun WithUser.chatInviteLinkWithJoinRequestOrNull(): ChatInviteLinkWithJoinRequest? = - this as? dev.inmo.tgbotapi.types.ChatInviteLinkWithJoinRequest - -public inline fun WithUser.chatInviteLinkWithJoinRequestOrThrow(): ChatInviteLinkWithJoinRequest = - this as dev.inmo.tgbotapi.types.ChatInviteLinkWithJoinRequest - -public inline fun - WithUser.ifChatInviteLinkWithJoinRequest(block: (ChatInviteLinkWithJoinRequest) -> T): T? = - chatInviteLinkWithJoinRequestOrNull() ?.let(block) - -public inline fun WithUser.chatInviteLinkWithLimitedMembersOrNull(): - ChatInviteLinkWithLimitedMembers? = this as? - dev.inmo.tgbotapi.types.ChatInviteLinkWithLimitedMembers - -public inline fun WithUser.chatInviteLinkWithLimitedMembersOrThrow(): - ChatInviteLinkWithLimitedMembers = this as - dev.inmo.tgbotapi.types.ChatInviteLinkWithLimitedMembers - -public inline fun - WithUser.ifChatInviteLinkWithLimitedMembers(block: (ChatInviteLinkWithLimitedMembers) -> T): T? - = chatInviteLinkWithLimitedMembersOrNull() ?.let(block) - -public inline fun WithUser.chatInviteLinkUnlimitedOrNull(): ChatInviteLinkUnlimited? = this as? - dev.inmo.tgbotapi.types.ChatInviteLinkUnlimited - -public inline fun WithUser.chatInviteLinkUnlimitedOrThrow(): ChatInviteLinkUnlimited = this as - dev.inmo.tgbotapi.types.ChatInviteLinkUnlimited - -public inline fun WithUser.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T): T? - = chatInviteLinkUnlimitedOrNull() ?.let(block) - -public inline fun WithUser.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this as? - dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult - -public inline fun WithUser.baseChosenInlineResultOrThrow(): BaseChosenInlineResult = this as - dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult - -public inline fun WithUser.ifBaseChosenInlineResult(block: (BaseChosenInlineResult) -> T): T? = - baseChosenInlineResultOrNull() ?.let(block) - -public inline fun WithUser.chosenInlineResultOrNull(): ChosenInlineResult? = this as? - dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult - -public inline fun WithUser.chosenInlineResultOrThrow(): ChosenInlineResult = this as - dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult - -public inline fun WithUser.ifChosenInlineResult(block: (ChosenInlineResult) -> T): T? = - chosenInlineResultOrNull() ?.let(block) - -public inline fun WithUser.locationChosenInlineResultOrNull(): LocationChosenInlineResult? = this - as? dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult - -public inline fun WithUser.locationChosenInlineResultOrThrow(): LocationChosenInlineResult = this as - dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult - -public inline fun - WithUser.ifLocationChosenInlineResult(block: (LocationChosenInlineResult) -> T): T? = - locationChosenInlineResultOrNull() ?.let(block) - -public inline fun WithUser.baseInlineQueryOrNull(): BaseInlineQuery? = this as? - dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery - -public inline fun WithUser.baseInlineQueryOrThrow(): BaseInlineQuery = this as - dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery - -public inline fun WithUser.ifBaseInlineQuery(block: (BaseInlineQuery) -> T): T? = - baseInlineQueryOrNull() ?.let(block) - -public inline fun WithUser.inlineQueryOrNull(): InlineQuery? = this as? - dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery - -public inline fun WithUser.inlineQueryOrThrow(): InlineQuery = this as - dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery - -public inline fun WithUser.ifInlineQuery(block: (InlineQuery) -> T): T? = inlineQueryOrNull() - ?.let(block) - -public inline fun WithUser.locationInlineQueryOrNull(): LocationInlineQuery? = this as? - dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery - -public inline fun WithUser.locationInlineQueryOrThrow(): LocationInlineQuery = this as - dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery - -public inline fun WithUser.ifLocationInlineQuery(block: (LocationInlineQuery) -> T): T? = - locationInlineQueryOrNull() ?.let(block) - -public inline fun WithUser.chatJoinRequestOrNull(): ChatJoinRequest? = this as? - dev.inmo.tgbotapi.types.chat.ChatJoinRequest - -public inline fun WithUser.chatJoinRequestOrThrow(): ChatJoinRequest = this as - dev.inmo.tgbotapi.types.chat.ChatJoinRequest - -public inline fun WithUser.ifChatJoinRequest(block: (ChatJoinRequest) -> T): T? = - chatJoinRequestOrNull() ?.let(block) - -public inline fun WithUser.administratorChatMemberOrNull(): AdministratorChatMember? = this as? - dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember - -public inline fun WithUser.administratorChatMemberOrThrow(): AdministratorChatMember = this as - dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember - -public inline fun WithUser.ifAdministratorChatMember(block: (AdministratorChatMember) -> T): T? - = administratorChatMemberOrNull() ?.let(block) - -public inline fun WithUser.administratorChatMemberImplOrNull(): AdministratorChatMemberImpl? = this - as? dev.inmo.tgbotapi.types.chat.member.AdministratorChatMemberImpl - -public inline fun WithUser.administratorChatMemberImplOrThrow(): AdministratorChatMemberImpl = this - as dev.inmo.tgbotapi.types.chat.member.AdministratorChatMemberImpl - -public inline fun - WithUser.ifAdministratorChatMemberImpl(block: (AdministratorChatMemberImpl) -> T): T? = - administratorChatMemberImplOrNull() ?.let(block) - -public inline fun WithUser.bannedChatMemberOrNull(): BannedChatMember? = this as? - dev.inmo.tgbotapi.types.chat.member.BannedChatMember - -public inline fun WithUser.bannedChatMemberOrThrow(): BannedChatMember = this as - dev.inmo.tgbotapi.types.chat.member.BannedChatMember - -public inline fun WithUser.ifBannedChatMember(block: (BannedChatMember) -> T): T? = - bannedChatMemberOrNull() ?.let(block) - -public inline fun WithUser.chatMemberOrNull(): ChatMember? = this as? - dev.inmo.tgbotapi.types.chat.member.ChatMember - -public inline fun WithUser.chatMemberOrThrow(): ChatMember = this as - dev.inmo.tgbotapi.types.chat.member.ChatMember - -public inline fun WithUser.ifChatMember(block: (ChatMember) -> T): T? = chatMemberOrNull() - ?.let(block) - -public inline fun WithUser.kickedChatMemberOrNull(): KickedChatMember? = this as? - dev.inmo.tgbotapi.types.chat.member.KickedChatMember - -public inline fun WithUser.kickedChatMemberOrThrow(): KickedChatMember = this as - dev.inmo.tgbotapi.types.chat.member.KickedChatMember - -public inline fun WithUser.ifKickedChatMember(block: (KickedChatMember) -> T): T? = - kickedChatMemberOrNull() ?.let(block) - -public inline fun WithUser.leftChatMemberOrNull(): LeftChatMember? = this as? - dev.inmo.tgbotapi.types.chat.member.LeftChatMember - -public inline fun WithUser.leftChatMemberOrThrow(): LeftChatMember = this as - dev.inmo.tgbotapi.types.chat.member.LeftChatMember - -public inline fun WithUser.ifLeftChatMember(block: (LeftChatMember) -> T): T? = - leftChatMemberOrNull() ?.let(block) - -public inline fun WithUser.leftChatMemberImplOrNull(): LeftChatMemberImpl? = this as? - dev.inmo.tgbotapi.types.chat.member.LeftChatMemberImpl - -public inline fun WithUser.leftChatMemberImplOrThrow(): LeftChatMemberImpl = this as - dev.inmo.tgbotapi.types.chat.member.LeftChatMemberImpl - -public inline fun WithUser.ifLeftChatMemberImpl(block: (LeftChatMemberImpl) -> T): T? = - leftChatMemberImplOrNull() ?.let(block) - -public inline fun WithUser.memberChatMemberOrNull(): MemberChatMember? = this as? - dev.inmo.tgbotapi.types.chat.member.MemberChatMember - -public inline fun WithUser.memberChatMemberOrThrow(): MemberChatMember = this as - dev.inmo.tgbotapi.types.chat.member.MemberChatMember - -public inline fun WithUser.ifMemberChatMember(block: (MemberChatMember) -> T): T? = - memberChatMemberOrNull() ?.let(block) - -public inline fun WithUser.memberChatMemberImplOrNull(): MemberChatMemberImpl? = this as? - dev.inmo.tgbotapi.types.chat.member.MemberChatMemberImpl - -public inline fun WithUser.memberChatMemberImplOrThrow(): MemberChatMemberImpl = this as - dev.inmo.tgbotapi.types.chat.member.MemberChatMemberImpl - -public inline fun WithUser.ifMemberChatMemberImpl(block: (MemberChatMemberImpl) -> T): T? = - memberChatMemberImplOrNull() ?.let(block) - -public inline fun WithUser.ownerChatMemberOrNull(): OwnerChatMember? = this as? - dev.inmo.tgbotapi.types.chat.member.OwnerChatMember - -public inline fun WithUser.ownerChatMemberOrThrow(): OwnerChatMember = this as - dev.inmo.tgbotapi.types.chat.member.OwnerChatMember - -public inline fun WithUser.ifOwnerChatMember(block: (OwnerChatMember) -> T): T? = - ownerChatMemberOrNull() ?.let(block) - -public inline fun WithUser.restrictedChatMemberOrNull(): RestrictedChatMember? = this as? - dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember - -public inline fun WithUser.restrictedChatMemberOrThrow(): RestrictedChatMember = this as - dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember - -public inline fun WithUser.ifRestrictedChatMember(block: (RestrictedChatMember) -> T): T? = - restrictedChatMemberOrNull() ?.let(block) - -public inline fun WithUser.specialRightsChatMemberOrNull(): SpecialRightsChatMember? = this as? - dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember - -public inline fun WithUser.specialRightsChatMemberOrThrow(): SpecialRightsChatMember = this as - dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember - -public inline fun WithUser.ifSpecialRightsChatMember(block: (SpecialRightsChatMember) -> T): T? - = specialRightsChatMemberOrNull() ?.let(block) - -public inline fun WithUser.leftChatMemberEventOrNull(): LeftChatMemberEvent? = this as? - dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent - -public inline fun WithUser.leftChatMemberEventOrThrow(): LeftChatMemberEvent = this as - dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent - -public inline fun WithUser.ifLeftChatMemberEvent(block: (LeftChatMemberEvent) -> T): T? = - leftChatMemberEventOrNull() ?.let(block) - -public inline fun WithUser.commonGroupEventMessageOrNull(): CommonGroupEventMessage? = - this as? - dev.inmo.tgbotapi.types.message.CommonGroupEventMessage - -public inline fun WithUser.commonGroupEventMessageOrThrow(): CommonGroupEventMessage = - this as - dev.inmo.tgbotapi.types.message.CommonGroupEventMessage - -public inline fun - WithUser.ifCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T): T? = - commonGroupEventMessageOrNull() ?.let(block) - -public inline fun WithUser.commonMediaGroupMessageOrNull(): - CommonMediaGroupMessage? = this as? - dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage - -public inline fun WithUser.commonMediaGroupMessageOrThrow(): - CommonMediaGroupMessage = this as - dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage - -public inline fun - WithUser.ifCommonMediaGroupMessage(block: (CommonMediaGroupMessage) -> T): T? - = commonMediaGroupMessageOrNull() ?.let(block) - -public inline fun WithUser.commonSupergroupEventMessageOrNull(): - CommonSupergroupEventMessage? = this as? - dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage - -public inline fun WithUser.commonSupergroupEventMessageOrThrow(): - CommonSupergroupEventMessage = this as - dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage - -public inline fun - WithUser.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T): - T? = commonSupergroupEventMessageOrNull() ?.let(block) - -public inline fun WithUser.commonGroupContentMessageImplOrNull(): - CommonGroupContentMessageImpl? = this as? - dev.inmo.tgbotapi.types.message.CommonGroupContentMessageImpl - -public inline fun WithUser.commonGroupContentMessageImplOrThrow(): - CommonGroupContentMessageImpl = this as - dev.inmo.tgbotapi.types.message.CommonGroupContentMessageImpl - -public inline fun - WithUser.ifCommonGroupContentMessageImpl(block: (CommonGroupContentMessageImpl) -> T): - T? = commonGroupContentMessageImplOrNull() ?.let(block) - -public inline fun WithUser.passportMessageOrNull(): PassportMessage? = this as? - dev.inmo.tgbotapi.types.message.PassportMessage - -public inline fun WithUser.passportMessageOrThrow(): PassportMessage = this as - dev.inmo.tgbotapi.types.message.PassportMessage - -public inline fun WithUser.ifPassportMessage(block: (PassportMessage) -> T): T? = - passportMessageOrNull() ?.let(block) - -public inline fun WithUser.privateContentMessageImplOrNull(): - PrivateContentMessageImpl? = this as? - dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl - -public inline fun WithUser.privateContentMessageImplOrThrow(): - PrivateContentMessageImpl = this as - dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl - -public inline fun - WithUser.ifPrivateContentMessageImpl(block: (PrivateContentMessageImpl) -> T): - T? = privateContentMessageImplOrNull() ?.let(block) - -public inline fun WithUser.fromUserMessageOrNull(): FromUserMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage - -public inline fun WithUser.fromUserMessageOrThrow(): FromUserMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage - -public inline fun WithUser.ifFromUserMessage(block: (FromUserMessage) -> T): T? = - fromUserMessageOrNull() ?.let(block) - -public inline fun WithUser.groupEventMessageOrNull(): GroupEventMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage - -public inline fun WithUser.groupEventMessageOrThrow(): GroupEventMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage - -public inline fun WithUser.ifGroupEventMessage(block: (GroupEventMessage) -> T): T? - = groupEventMessageOrNull() ?.let(block) - -public inline fun WithUser.commonGroupContentMessageOrNull(): - CommonGroupContentMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage - -public inline fun WithUser.commonGroupContentMessageOrThrow(): - CommonGroupContentMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage - -public inline fun - WithUser.ifCommonGroupContentMessage(block: (CommonGroupContentMessage) -> T): - T? = commonGroupContentMessageOrNull() ?.let(block) - -public inline fun WithUser.privateContentMessageOrNull(): PrivateContentMessage? = - this as? - dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage - -public inline fun WithUser.privateContentMessageOrThrow(): PrivateContentMessage = - this as - dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage - -public inline fun - WithUser.ifPrivateContentMessage(block: (PrivateContentMessage) -> T): T? = - privateContentMessageOrNull() ?.let(block) - -public inline fun WithUser.supergroupEventMessageOrNull(): SupergroupEventMessage? - = this as? - dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage - -public inline fun WithUser.supergroupEventMessageOrThrow(): SupergroupEventMessage - = this as - dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage - -public inline fun - WithUser.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T): T? = - supergroupEventMessageOrNull() ?.let(block) - -public inline fun WithUser.preCheckoutQueryOrNull(): PreCheckoutQuery? = this as? - dev.inmo.tgbotapi.types.payments.PreCheckoutQuery - -public inline fun WithUser.preCheckoutQueryOrThrow(): PreCheckoutQuery = this as - dev.inmo.tgbotapi.types.payments.PreCheckoutQuery - -public inline fun WithUser.ifPreCheckoutQuery(block: (PreCheckoutQuery) -> T): T? = - preCheckoutQueryOrNull() ?.let(block) - -public inline fun WithUser.shippingQueryOrNull(): ShippingQuery? = this as? - dev.inmo.tgbotapi.types.payments.ShippingQuery - -public inline fun WithUser.shippingQueryOrThrow(): ShippingQuery = this as - dev.inmo.tgbotapi.types.payments.ShippingQuery - -public inline fun WithUser.ifShippingQuery(block: (ShippingQuery) -> T): T? = - shippingQueryOrNull() ?.let(block) - -public inline fun WithUser.pollAnswerOrNull(): PollAnswer? = this as? - dev.inmo.tgbotapi.types.polls.PollAnswer - -public inline fun WithUser.pollAnswerOrThrow(): PollAnswer = this as - dev.inmo.tgbotapi.types.polls.PollAnswer - -public inline fun WithUser.ifPollAnswer(block: (PollAnswer) -> T): T? = pollAnswerOrNull() - ?.let(block) - -public inline fun WithUser.callbackQueryOrNull(): CallbackQuery? = this as? - dev.inmo.tgbotapi.types.queries.callback.CallbackQuery - -public inline fun WithUser.callbackQueryOrThrow(): CallbackQuery = this as - dev.inmo.tgbotapi.types.queries.callback.CallbackQuery - -public inline fun WithUser.ifCallbackQuery(block: (CallbackQuery) -> T): T? = - callbackQueryOrNull() ?.let(block) - -public inline fun WithUser.unknownCallbackQueryTypeOrNull(): UnknownCallbackQueryType? = this as? - dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType - -public inline fun WithUser.unknownCallbackQueryTypeOrThrow(): UnknownCallbackQueryType = this as - dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType - -public inline fun WithUser.ifUnknownCallbackQueryType(block: (UnknownCallbackQueryType) -> T): - T? = unknownCallbackQueryTypeOrNull() ?.let(block) - -public inline fun WithUser.dataCallbackQueryOrNull(): DataCallbackQuery? = this as? - dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery - -public inline fun WithUser.dataCallbackQueryOrThrow(): DataCallbackQuery = this as - dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery - -public inline fun WithUser.ifDataCallbackQuery(block: (DataCallbackQuery) -> T): T? = - dataCallbackQueryOrNull() ?.let(block) - -public inline fun WithUser.gameShortNameCallbackQueryOrNull(): GameShortNameCallbackQuery? = this - as? dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery - -public inline fun WithUser.gameShortNameCallbackQueryOrThrow(): GameShortNameCallbackQuery = this as - dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery - -public inline fun - WithUser.ifGameShortNameCallbackQuery(block: (GameShortNameCallbackQuery) -> T): T? = - gameShortNameCallbackQueryOrNull() ?.let(block) - -public inline fun WithUser.inlineMessageIdCallbackQueryOrNull(): InlineMessageIdCallbackQuery? = - this as? dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery - -public inline fun WithUser.inlineMessageIdCallbackQueryOrThrow(): InlineMessageIdCallbackQuery = - this as dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery - -public inline fun - WithUser.ifInlineMessageIdCallbackQuery(block: (InlineMessageIdCallbackQuery) -> T): T? = - inlineMessageIdCallbackQueryOrNull() ?.let(block) - -public inline fun WithUser.inlineMessageIdDataCallbackQueryOrNull(): - InlineMessageIdDataCallbackQuery? = this as? - dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery - -public inline fun WithUser.inlineMessageIdDataCallbackQueryOrThrow(): - InlineMessageIdDataCallbackQuery = this as - dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery - -public inline fun - WithUser.ifInlineMessageIdDataCallbackQuery(block: (InlineMessageIdDataCallbackQuery) -> T): T? - = inlineMessageIdDataCallbackQueryOrNull() ?.let(block) - -public inline fun WithUser.inlineMessageIdGameShortNameCallbackQueryOrNull(): - InlineMessageIdGameShortNameCallbackQuery? = this as? - dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery - -public inline fun WithUser.inlineMessageIdGameShortNameCallbackQueryOrThrow(): - InlineMessageIdGameShortNameCallbackQuery = this as - dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery - -public inline fun - WithUser.ifInlineMessageIdGameShortNameCallbackQuery(block: (InlineMessageIdGameShortNameCallbackQuery) -> T): - T? = inlineMessageIdGameShortNameCallbackQueryOrNull() ?.let(block) - -public inline fun WithUser.messageCallbackQueryOrNull(): MessageCallbackQuery? = this as? - dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery - -public inline fun WithUser.messageCallbackQueryOrThrow(): MessageCallbackQuery = this as - dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery - -public inline fun WithUser.ifMessageCallbackQuery(block: (MessageCallbackQuery) -> T): T? = - messageCallbackQueryOrNull() ?.let(block) - -public inline fun WithUser.messageDataCallbackQueryOrNull(): MessageDataCallbackQuery? = this as? - dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery - -public inline fun WithUser.messageDataCallbackQueryOrThrow(): MessageDataCallbackQuery = this as - dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery - -public inline fun WithUser.ifMessageDataCallbackQuery(block: (MessageDataCallbackQuery) -> T): - T? = messageDataCallbackQueryOrNull() ?.let(block) - -public inline fun WithUser.messageGameShortNameCallbackQueryOrNull(): - MessageGameShortNameCallbackQuery? = this as? - dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery - -public inline fun WithUser.messageGameShortNameCallbackQueryOrThrow(): - MessageGameShortNameCallbackQuery = this as - dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery - -public inline fun - WithUser.ifMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T): - T? = messageGameShortNameCallbackQueryOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultArticleOrNull(): InlineQueryResultArticle? = - this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle - -public inline fun InlineQueryResult.inlineQueryResultArticleOrThrow(): InlineQueryResultArticle = - this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle - -public inline fun - InlineQueryResult.ifInlineQueryResultArticle(block: (InlineQueryResultArticle) -> T): T? = - inlineQueryResultArticleOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultAudioCachedImplOrNull(): - InlineQueryResultAudioCachedImpl? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioCachedImpl - -public inline fun InlineQueryResult.inlineQueryResultAudioCachedImplOrThrow(): - InlineQueryResultAudioCachedImpl = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioCachedImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultAudioCachedImpl(block: (InlineQueryResultAudioCachedImpl) -> T): - T? = inlineQueryResultAudioCachedImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultAudioImplOrNull(): InlineQueryResultAudioImpl? - = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioImpl - -public inline fun InlineQueryResult.inlineQueryResultAudioImplOrThrow(): InlineQueryResultAudioImpl - = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultAudioImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultAudioImpl(block: (InlineQueryResultAudioImpl) -> T): T? = - inlineQueryResultAudioImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultContactOrNull(): InlineQueryResultContact? = - this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultContact - -public inline fun InlineQueryResult.inlineQueryResultContactOrThrow(): InlineQueryResultContact = - this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultContact - -public inline fun - InlineQueryResult.ifInlineQueryResultContact(block: (InlineQueryResultContact) -> T): T? = - inlineQueryResultContactOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultDocumentCachedImplOrNull(): - InlineQueryResultDocumentCachedImpl? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentCachedImpl - -public inline fun InlineQueryResult.inlineQueryResultDocumentCachedImplOrThrow(): - InlineQueryResultDocumentCachedImpl = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentCachedImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultDocumentCachedImpl(block: (InlineQueryResultDocumentCachedImpl) -> T): - T? = inlineQueryResultDocumentCachedImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultDocumentImplOrNull(): - InlineQueryResultDocumentImpl? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentImpl - -public inline fun InlineQueryResult.inlineQueryResultDocumentImplOrThrow(): - InlineQueryResultDocumentImpl = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultDocumentImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultDocumentImpl(block: (InlineQueryResultDocumentImpl) -> T): - T? = inlineQueryResultDocumentImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultGameOrNull(): InlineQueryResultGame? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGame - -public inline fun InlineQueryResult.inlineQueryResultGameOrThrow(): InlineQueryResultGame = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGame - -public inline fun - InlineQueryResult.ifInlineQueryResultGame(block: (InlineQueryResultGame) -> T): T? = - inlineQueryResultGameOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultGifCachedImplOrNull(): - InlineQueryResultGifCachedImpl? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifCachedImpl - -public inline fun InlineQueryResult.inlineQueryResultGifCachedImplOrThrow(): - InlineQueryResultGifCachedImpl = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifCachedImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultGifCachedImpl(block: (InlineQueryResultGifCachedImpl) -> T): - T? = inlineQueryResultGifCachedImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultGifImplOrNull(): InlineQueryResultGifImpl? = - this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifImpl - -public inline fun InlineQueryResult.inlineQueryResultGifImplOrThrow(): InlineQueryResultGifImpl = - this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGifImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultGifImpl(block: (InlineQueryResultGifImpl) -> T): T? = - inlineQueryResultGifImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultLocationOrNull(): InlineQueryResultLocation? = - this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultLocation - -public inline fun InlineQueryResult.inlineQueryResultLocationOrThrow(): InlineQueryResultLocation = - this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultLocation - -public inline fun - InlineQueryResult.ifInlineQueryResultLocation(block: (InlineQueryResultLocation) -> T): T? = - inlineQueryResultLocationOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedImplOrNull(): - InlineQueryResultMpeg4GifCachedImpl? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifCachedImpl - -public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedImplOrThrow(): - InlineQueryResultMpeg4GifCachedImpl = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifCachedImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultMpeg4GifCachedImpl(block: (InlineQueryResultMpeg4GifCachedImpl) -> T): - T? = inlineQueryResultMpeg4GifCachedImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultMpeg4GifImplOrNull(): - InlineQueryResultMpeg4GifImpl? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifImpl - -public inline fun InlineQueryResult.inlineQueryResultMpeg4GifImplOrThrow(): - InlineQueryResultMpeg4GifImpl = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultMpeg4GifImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultMpeg4GifImpl(block: (InlineQueryResultMpeg4GifImpl) -> T): - T? = inlineQueryResultMpeg4GifImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultPhotoCachedImplOrNull(): - InlineQueryResultPhotoCachedImpl? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoCachedImpl - -public inline fun InlineQueryResult.inlineQueryResultPhotoCachedImplOrThrow(): - InlineQueryResultPhotoCachedImpl = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoCachedImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultPhotoCachedImpl(block: (InlineQueryResultPhotoCachedImpl) -> T): - T? = inlineQueryResultPhotoCachedImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultPhotoImplOrNull(): InlineQueryResultPhotoImpl? - = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoImpl - -public inline fun InlineQueryResult.inlineQueryResultPhotoImplOrThrow(): InlineQueryResultPhotoImpl - = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultPhotoImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultPhotoImpl(block: (InlineQueryResultPhotoImpl) -> T): T? = - inlineQueryResultPhotoImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultStickerCachedOrNull(): - InlineQueryResultStickerCached? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultStickerCached - -public inline fun InlineQueryResult.inlineQueryResultStickerCachedOrThrow(): - InlineQueryResultStickerCached = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultStickerCached - -public inline fun - InlineQueryResult.ifInlineQueryResultStickerCached(block: (InlineQueryResultStickerCached) -> T): - T? = inlineQueryResultStickerCachedOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultVenueOrNull(): InlineQueryResultVenue? = this - as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVenue - -public inline fun InlineQueryResult.inlineQueryResultVenueOrThrow(): InlineQueryResultVenue = this - as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVenue - -public inline fun - InlineQueryResult.ifInlineQueryResultVenue(block: (InlineQueryResultVenue) -> T): T? = - inlineQueryResultVenueOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultVideoCachedImplOrNull(): - InlineQueryResultVideoCachedImpl? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoCachedImpl - -public inline fun InlineQueryResult.inlineQueryResultVideoCachedImplOrThrow(): - InlineQueryResultVideoCachedImpl = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoCachedImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultVideoCachedImpl(block: (InlineQueryResultVideoCachedImpl) -> T): - T? = inlineQueryResultVideoCachedImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultVideoImplOrNull(): InlineQueryResultVideoImpl? - = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoImpl - -public inline fun InlineQueryResult.inlineQueryResultVideoImplOrThrow(): InlineQueryResultVideoImpl - = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVideoImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultVideoImpl(block: (InlineQueryResultVideoImpl) -> T): T? = - inlineQueryResultVideoImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultVoiceCachedImplOrNull(): - InlineQueryResultVoiceCachedImpl? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceCachedImpl - -public inline fun InlineQueryResult.inlineQueryResultVoiceCachedImplOrThrow(): - InlineQueryResultVoiceCachedImpl = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceCachedImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultVoiceCachedImpl(block: (InlineQueryResultVoiceCachedImpl) -> T): - T? = inlineQueryResultVoiceCachedImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultVoiceImplOrNull(): InlineQueryResultVoiceImpl? - = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceImpl - -public inline fun InlineQueryResult.inlineQueryResultVoiceImplOrThrow(): InlineQueryResultVoiceImpl - = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVoiceImpl - -public inline fun - InlineQueryResult.ifInlineQueryResultVoiceImpl(block: (InlineQueryResultVoiceImpl) -> T): T? = - inlineQueryResultVoiceImplOrNull() ?.let(block) - -public inline fun InlineQueryResult.describedInlineQueryResultOrNull(): DescribedInlineQueryResult? - = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.DescribedInlineQueryResult - -public inline fun InlineQueryResult.describedInlineQueryResultOrThrow(): DescribedInlineQueryResult - = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.DescribedInlineQueryResult - -public inline fun - InlineQueryResult.ifDescribedInlineQueryResult(block: (DescribedInlineQueryResult) -> T): T? = - describedInlineQueryResultOrNull() ?.let(block) - -public inline fun InlineQueryResult.fileInlineQueryResultOrNull(): FileInlineQueryResult? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.FileInlineQueryResult - -public inline fun InlineQueryResult.fileInlineQueryResultOrThrow(): FileInlineQueryResult = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.FileInlineQueryResult - -public inline fun - InlineQueryResult.ifFileInlineQueryResult(block: (FileInlineQueryResult) -> T): T? = - fileInlineQueryResultOrNull() ?.let(block) - -public inline fun InlineQueryResult.optionallyTitledInlineQueryResultOrNull(): - OptionallyTitledInlineQueryResult? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.OptionallyTitledInlineQueryResult - -public inline fun InlineQueryResult.optionallyTitledInlineQueryResultOrThrow(): - OptionallyTitledInlineQueryResult = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.OptionallyTitledInlineQueryResult - -public inline fun - InlineQueryResult.ifOptionallyTitledInlineQueryResult(block: (OptionallyTitledInlineQueryResult) -> T): - T? = optionallyTitledInlineQueryResultOrNull() ?.let(block) - -public inline fun InlineQueryResult.sizedInlineQueryResultOrNull(): SizedInlineQueryResult? = this - as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.SizedInlineQueryResult - -public inline fun InlineQueryResult.sizedInlineQueryResultOrThrow(): SizedInlineQueryResult = this - as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.SizedInlineQueryResult - -public inline fun - InlineQueryResult.ifSizedInlineQueryResult(block: (SizedInlineQueryResult) -> T): T? = - sizedInlineQueryResultOrNull() ?.let(block) - -public inline fun InlineQueryResult.thumbSizedInlineQueryResultOrNull(): - ThumbSizedInlineQueryResult? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbSizedInlineQueryResult - -public inline fun InlineQueryResult.thumbSizedInlineQueryResultOrThrow(): - ThumbSizedInlineQueryResult = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbSizedInlineQueryResult - -public inline fun - InlineQueryResult.ifThumbSizedInlineQueryResult(block: (ThumbSizedInlineQueryResult) -> T): T? = - thumbSizedInlineQueryResultOrNull() ?.let(block) - -public inline fun InlineQueryResult.thumbedInlineQueryResultOrNull(): ThumbedInlineQueryResult? = - this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedInlineQueryResult - -public inline fun InlineQueryResult.thumbedInlineQueryResultOrThrow(): ThumbedInlineQueryResult = - this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedInlineQueryResult - -public inline fun - InlineQueryResult.ifThumbedInlineQueryResult(block: (ThumbedInlineQueryResult) -> T): T? = - thumbedInlineQueryResultOrNull() ?.let(block) - -public inline fun InlineQueryResult.thumbedWithMimeTypeInlineQueryResultOrNull(): - ThumbedWithMimeTypeInlineQueryResult? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedWithMimeTypeInlineQueryResult - -public inline fun InlineQueryResult.thumbedWithMimeTypeInlineQueryResultOrThrow(): - ThumbedWithMimeTypeInlineQueryResult = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedWithMimeTypeInlineQueryResult - -public inline fun - InlineQueryResult.ifThumbedWithMimeTypeInlineQueryResult(block: (ThumbedWithMimeTypeInlineQueryResult) -> T): - T? = thumbedWithMimeTypeInlineQueryResultOrNull() ?.let(block) - -public inline fun InlineQueryResult.titledInlineQueryResultOrNull(): TitledInlineQueryResult? = this - as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.TitledInlineQueryResult - -public inline fun InlineQueryResult.titledInlineQueryResultOrThrow(): TitledInlineQueryResult = this - as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.TitledInlineQueryResult - -public inline fun - InlineQueryResult.ifTitledInlineQueryResult(block: (TitledInlineQueryResult) -> T): T? = - titledInlineQueryResultOrNull() ?.let(block) - -public inline fun InlineQueryResult.urlInlineQueryResultOrNull(): UrlInlineQueryResult? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.UrlInlineQueryResult - -public inline fun InlineQueryResult.urlInlineQueryResultOrThrow(): UrlInlineQueryResult = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.UrlInlineQueryResult - -public inline fun InlineQueryResult.ifUrlInlineQueryResult(block: (UrlInlineQueryResult) -> T): - T? = urlInlineQueryResultOrNull() ?.let(block) - -public inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrNull(): - WithInputMessageContentInlineQueryResult? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult - -public inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrThrow(): - WithInputMessageContentInlineQueryResult = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult - -public inline fun - InlineQueryResult.ifWithInputMessageContentInlineQueryResult(block: (WithInputMessageContentInlineQueryResult) -> T): - T? = withInputMessageContentInlineQueryResultOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultAudioOrNull(): InlineQueryResultAudio? = this - as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio - -public inline fun InlineQueryResult.inlineQueryResultAudioOrThrow(): InlineQueryResultAudio = this - as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio - -public inline fun - InlineQueryResult.ifInlineQueryResultAudio(block: (InlineQueryResultAudio) -> T): T? = - inlineQueryResultAudioOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultAudioCachedOrNull(): - InlineQueryResultAudioCached? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached - -public inline fun InlineQueryResult.inlineQueryResultAudioCachedOrThrow(): - InlineQueryResultAudioCached = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached - -public inline fun - InlineQueryResult.ifInlineQueryResultAudioCached(block: (InlineQueryResultAudioCached) -> T): T? - = inlineQueryResultAudioCachedOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultAudioCommonOrNull(): - InlineQueryResultAudioCommon? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCommon - -public inline fun InlineQueryResult.inlineQueryResultAudioCommonOrThrow(): - InlineQueryResultAudioCommon = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCommon - -public inline fun - InlineQueryResult.ifInlineQueryResultAudioCommon(block: (InlineQueryResultAudioCommon) -> T): T? - = inlineQueryResultAudioCommonOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultDocumentOrNull(): InlineQueryResultDocument? = - this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocument - -public inline fun InlineQueryResult.inlineQueryResultDocumentOrThrow(): InlineQueryResultDocument = - this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocument - -public inline fun - InlineQueryResult.ifInlineQueryResultDocument(block: (InlineQueryResultDocument) -> T): T? = - inlineQueryResultDocumentOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultDocumentCachedOrNull(): - InlineQueryResultDocumentCached? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCached - -public inline fun InlineQueryResult.inlineQueryResultDocumentCachedOrThrow(): - InlineQueryResultDocumentCached = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCached - -public inline fun - InlineQueryResult.ifInlineQueryResultDocumentCached(block: (InlineQueryResultDocumentCached) -> T): - T? = inlineQueryResultDocumentCachedOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultDocumentCommonOrNull(): - InlineQueryResultDocumentCommon? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCommon - -public inline fun InlineQueryResult.inlineQueryResultDocumentCommonOrThrow(): - InlineQueryResultDocumentCommon = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCommon - -public inline fun - InlineQueryResult.ifInlineQueryResultDocumentCommon(block: (InlineQueryResultDocumentCommon) -> T): - T? = inlineQueryResultDocumentCommonOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultGifOrNull(): InlineQueryResultGif? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif - -public inline fun InlineQueryResult.inlineQueryResultGifOrThrow(): InlineQueryResultGif = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif - -public inline fun InlineQueryResult.ifInlineQueryResultGif(block: (InlineQueryResultGif) -> T): - T? = inlineQueryResultGifOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultGifCachedOrNull(): InlineQueryResultGifCached? - = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached - -public inline fun InlineQueryResult.inlineQueryResultGifCachedOrThrow(): InlineQueryResultGifCached - = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached - -public inline fun - InlineQueryResult.ifInlineQueryResultGifCached(block: (InlineQueryResultGifCached) -> T): T? = - inlineQueryResultGifCachedOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultGifCommonOrNull(): InlineQueryResultGifCommon? - = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCommon - -public inline fun InlineQueryResult.inlineQueryResultGifCommonOrThrow(): InlineQueryResultGifCommon - = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCommon - -public inline fun - InlineQueryResult.ifInlineQueryResultGifCommon(block: (InlineQueryResultGifCommon) -> T): T? = - inlineQueryResultGifCommonOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultMpeg4GifOrNull(): InlineQueryResultMpeg4Gif? = - this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif - -public inline fun InlineQueryResult.inlineQueryResultMpeg4GifOrThrow(): InlineQueryResultMpeg4Gif = - this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif - -public inline fun - InlineQueryResult.ifInlineQueryResultMpeg4Gif(block: (InlineQueryResultMpeg4Gif) -> T): T? = - inlineQueryResultMpeg4GifOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedOrNull(): - InlineQueryResultMpeg4GifCached? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCached - -public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedOrThrow(): - InlineQueryResultMpeg4GifCached = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCached - -public inline fun - InlineQueryResult.ifInlineQueryResultMpeg4GifCached(block: (InlineQueryResultMpeg4GifCached) -> T): - T? = inlineQueryResultMpeg4GifCachedOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCommonOrNull(): - InlineQueryResultMpeg4GifCommon? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCommon - -public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCommonOrThrow(): - InlineQueryResultMpeg4GifCommon = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCommon - -public inline fun - InlineQueryResult.ifInlineQueryResultMpeg4GifCommon(block: (InlineQueryResultMpeg4GifCommon) -> T): - T? = inlineQueryResultMpeg4GifCommonOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultPhotoOrNull(): InlineQueryResultPhoto? = this - as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhoto - -public inline fun InlineQueryResult.inlineQueryResultPhotoOrThrow(): InlineQueryResultPhoto = this - as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhoto - -public inline fun - InlineQueryResult.ifInlineQueryResultPhoto(block: (InlineQueryResultPhoto) -> T): T? = - inlineQueryResultPhotoOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultPhotoCachedOrNull(): - InlineQueryResultPhotoCached? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCached - -public inline fun InlineQueryResult.inlineQueryResultPhotoCachedOrThrow(): - InlineQueryResultPhotoCached = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCached - -public inline fun - InlineQueryResult.ifInlineQueryResultPhotoCached(block: (InlineQueryResultPhotoCached) -> T): T? - = inlineQueryResultPhotoCachedOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultPhotoCommonOrNull(): - InlineQueryResultPhotoCommon? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCommon - -public inline fun InlineQueryResult.inlineQueryResultPhotoCommonOrThrow(): - InlineQueryResultPhotoCommon = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCommon - -public inline fun - InlineQueryResult.ifInlineQueryResultPhotoCommon(block: (InlineQueryResultPhotoCommon) -> T): T? - = inlineQueryResultPhotoCommonOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultVideoOrNull(): InlineQueryResultVideo? = this - as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo - -public inline fun InlineQueryResult.inlineQueryResultVideoOrThrow(): InlineQueryResultVideo = this - as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo - -public inline fun - InlineQueryResult.ifInlineQueryResultVideo(block: (InlineQueryResultVideo) -> T): T? = - inlineQueryResultVideoOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultVideoCachedOrNull(): - InlineQueryResultVideoCached? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCached - -public inline fun InlineQueryResult.inlineQueryResultVideoCachedOrThrow(): - InlineQueryResultVideoCached = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCached - -public inline fun - InlineQueryResult.ifInlineQueryResultVideoCached(block: (InlineQueryResultVideoCached) -> T): T? - = inlineQueryResultVideoCachedOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultVideoCommonOrNull(): - InlineQueryResultVideoCommon? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCommon - -public inline fun InlineQueryResult.inlineQueryResultVideoCommonOrThrow(): - InlineQueryResultVideoCommon = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCommon - -public inline fun - InlineQueryResult.ifInlineQueryResultVideoCommon(block: (InlineQueryResultVideoCommon) -> T): T? - = inlineQueryResultVideoCommonOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultVoiceOrNull(): InlineQueryResultVoice? = this - as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice - -public inline fun InlineQueryResult.inlineQueryResultVoiceOrThrow(): InlineQueryResultVoice = this - as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice - -public inline fun - InlineQueryResult.ifInlineQueryResultVoice(block: (InlineQueryResultVoice) -> T): T? = - inlineQueryResultVoiceOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultVoiceCachedOrNull(): - InlineQueryResultVoiceCached? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached - -public inline fun InlineQueryResult.inlineQueryResultVoiceCachedOrThrow(): - InlineQueryResultVoiceCached = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached - -public inline fun - InlineQueryResult.ifInlineQueryResultVoiceCached(block: (InlineQueryResultVoiceCached) -> T): T? - = inlineQueryResultVoiceCachedOrNull() ?.let(block) - -public inline fun InlineQueryResult.inlineQueryResultVoiceCommonOrNull(): - InlineQueryResultVoiceCommon? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCommon - -public inline fun InlineQueryResult.inlineQueryResultVoiceCommonOrThrow(): - InlineQueryResultVoiceCommon = this as - dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCommon - -public inline fun - InlineQueryResult.ifInlineQueryResultVoiceCommon(block: (InlineQueryResultVoiceCommon) -> T): T? - = inlineQueryResultVoiceCommonOrNull() ?.let(block) - -public inline fun InputMessageContent.inputContactMessageContentOrNull(): - InputContactMessageContent? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputContactMessageContent - -public inline fun InputMessageContent.inputContactMessageContentOrThrow(): - InputContactMessageContent = this as - dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputContactMessageContent - -public inline fun - InputMessageContent.ifInputContactMessageContent(block: (InputContactMessageContent) -> T): T? = - inputContactMessageContentOrNull() ?.let(block) - -public inline fun InputMessageContent.inputInvoiceMessageContentOrNull(): - InputInvoiceMessageContent? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent - -public inline fun InputMessageContent.inputInvoiceMessageContentOrThrow(): - InputInvoiceMessageContent = this as - dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent - -public inline fun - InputMessageContent.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T): T? = - inputInvoiceMessageContentOrNull() ?.let(block) - -public inline fun InputMessageContent.inputLocationMessageContentOrNull(): - InputLocationMessageContent? = this as? - dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputLocationMessageContent - -public inline fun InputMessageContent.inputLocationMessageContentOrThrow(): - InputLocationMessageContent = this as - dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputLocationMessageContent - -public inline fun - InputMessageContent.ifInputLocationMessageContent(block: (InputLocationMessageContent) -> T): T? - = inputLocationMessageContentOrNull() ?.let(block) - -public inline fun InputMessageContent.inputTextMessageContentOrNull(): InputTextMessageContent? = - this as? dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent - -public inline fun InputMessageContent.inputTextMessageContentOrThrow(): InputTextMessageContent = - this as dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent - -public inline fun - InputMessageContent.ifInputTextMessageContent(block: (InputTextMessageContent) -> T): T? = - inputTextMessageContentOrNull() ?.let(block) - -public inline fun InputMessageContent.inputVenueMessageContentOrNull(): InputVenueMessageContent? = - this as? dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessageContent - -public inline fun InputMessageContent.inputVenueMessageContentOrThrow(): InputVenueMessageContent = - this as dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessageContent - -public inline fun - InputMessageContent.ifInputVenueMessageContent(block: (InputVenueMessageContent) -> T): T? = - inputVenueMessageContentOrNull() ?.let(block) - -public inline fun BotAction.typingActionOrNull(): TypingAction? = this as? - dev.inmo.tgbotapi.types.actions.TypingAction - -public inline fun BotAction.typingActionOrThrow(): TypingAction = this as - dev.inmo.tgbotapi.types.actions.TypingAction - -public inline fun BotAction.ifTypingAction(block: (TypingAction) -> T): T? = - typingActionOrNull() ?.let(block) - -public inline fun BotAction.uploadPhotoActionOrNull(): UploadPhotoAction? = this as? - dev.inmo.tgbotapi.types.actions.UploadPhotoAction - -public inline fun BotAction.uploadPhotoActionOrThrow(): UploadPhotoAction = this as - dev.inmo.tgbotapi.types.actions.UploadPhotoAction - -public inline fun BotAction.ifUploadPhotoAction(block: (UploadPhotoAction) -> T): T? = - uploadPhotoActionOrNull() ?.let(block) - -public inline fun BotAction.recordVideoActionOrNull(): RecordVideoAction? = this as? - dev.inmo.tgbotapi.types.actions.RecordVideoAction - -public inline fun BotAction.recordVideoActionOrThrow(): RecordVideoAction = this as - dev.inmo.tgbotapi.types.actions.RecordVideoAction - -public inline fun BotAction.ifRecordVideoAction(block: (RecordVideoAction) -> T): T? = - recordVideoActionOrNull() ?.let(block) - -public inline fun BotAction.uploadVideoActionOrNull(): UploadVideoAction? = this as? - dev.inmo.tgbotapi.types.actions.UploadVideoAction - -public inline fun BotAction.uploadVideoActionOrThrow(): UploadVideoAction = this as - dev.inmo.tgbotapi.types.actions.UploadVideoAction - -public inline fun BotAction.ifUploadVideoAction(block: (UploadVideoAction) -> T): T? = - uploadVideoActionOrNull() ?.let(block) - -public inline fun BotAction.recordVoiceActionOrNull(): RecordVoiceAction? = this as? - dev.inmo.tgbotapi.types.actions.RecordVoiceAction - -public inline fun BotAction.recordVoiceActionOrThrow(): RecordVoiceAction = this as - dev.inmo.tgbotapi.types.actions.RecordVoiceAction - -public inline fun BotAction.ifRecordVoiceAction(block: (RecordVoiceAction) -> T): T? = - recordVoiceActionOrNull() ?.let(block) - -public inline fun BotAction.uploadVoiceActionOrNull(): UploadVoiceAction? = this as? - dev.inmo.tgbotapi.types.actions.UploadVoiceAction - -public inline fun BotAction.uploadVoiceActionOrThrow(): UploadVoiceAction = this as - dev.inmo.tgbotapi.types.actions.UploadVoiceAction - -public inline fun BotAction.ifUploadVoiceAction(block: (UploadVoiceAction) -> T): T? = - uploadVoiceActionOrNull() ?.let(block) - -public inline fun BotAction.uploadDocumentActionOrNull(): UploadDocumentAction? = this as? - dev.inmo.tgbotapi.types.actions.UploadDocumentAction - -public inline fun BotAction.uploadDocumentActionOrThrow(): UploadDocumentAction = this as - dev.inmo.tgbotapi.types.actions.UploadDocumentAction - -public inline fun BotAction.ifUploadDocumentAction(block: (UploadDocumentAction) -> T): T? = - uploadDocumentActionOrNull() ?.let(block) - -public inline fun BotAction.findLocationActionOrNull(): FindLocationAction? = this as? - dev.inmo.tgbotapi.types.actions.FindLocationAction - -public inline fun BotAction.findLocationActionOrThrow(): FindLocationAction = this as - dev.inmo.tgbotapi.types.actions.FindLocationAction - -public inline fun BotAction.ifFindLocationAction(block: (FindLocationAction) -> T): T? = - findLocationActionOrNull() ?.let(block) - -public inline fun BotAction.recordVideoNoteActionOrNull(): RecordVideoNoteAction? = this as? - dev.inmo.tgbotapi.types.actions.RecordVideoNoteAction - -public inline fun BotAction.recordVideoNoteActionOrThrow(): RecordVideoNoteAction = this as - dev.inmo.tgbotapi.types.actions.RecordVideoNoteAction - -public inline fun BotAction.ifRecordVideoNoteAction(block: (RecordVideoNoteAction) -> T): T? = - recordVideoNoteActionOrNull() ?.let(block) - -public inline fun BotAction.uploadVideoNoteActionOrNull(): UploadVideoNoteAction? = this as? - dev.inmo.tgbotapi.types.actions.UploadVideoNoteAction - -public inline fun BotAction.uploadVideoNoteActionOrThrow(): UploadVideoNoteAction = this as - dev.inmo.tgbotapi.types.actions.UploadVideoNoteAction - -public inline fun BotAction.ifUploadVideoNoteAction(block: (UploadVideoNoteAction) -> T): T? = - uploadVideoNoteActionOrNull() ?.let(block) - -public inline fun BotAction.chooseStickerActionOrNull(): ChooseStickerAction? = this as? - dev.inmo.tgbotapi.types.actions.ChooseStickerAction - -public inline fun BotAction.chooseStickerActionOrThrow(): ChooseStickerAction = this as - dev.inmo.tgbotapi.types.actions.ChooseStickerAction - -public inline fun BotAction.ifChooseStickerAction(block: (ChooseStickerAction) -> T): T? = - chooseStickerActionOrNull() ?.let(block) - -public inline fun BotAction.customBotActionOrNull(): CustomBotAction? = this as? - dev.inmo.tgbotapi.types.actions.CustomBotAction - -public inline fun BotAction.customBotActionOrThrow(): CustomBotAction = this as - dev.inmo.tgbotapi.types.actions.CustomBotAction - -public inline fun BotAction.ifCustomBotAction(block: (CustomBotAction) -> T): T? = - customBotActionOrNull() ?.let(block) - -public inline fun InlineKeyboardButton.unknownInlineKeyboardButtonOrNull(): - UnknownInlineKeyboardButton? = this as? - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.UnknownInlineKeyboardButton - -public inline fun InlineKeyboardButton.unknownInlineKeyboardButtonOrThrow(): - UnknownInlineKeyboardButton = this as - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.UnknownInlineKeyboardButton - -public inline fun - InlineKeyboardButton.ifUnknownInlineKeyboardButton(block: (UnknownInlineKeyboardButton) -> T): - T? = unknownInlineKeyboardButtonOrNull() ?.let(block) - -public inline fun InlineKeyboardButton.payInlineKeyboardButtonOrNull(): PayInlineKeyboardButton? = - this as? dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.PayInlineKeyboardButton - -public inline fun InlineKeyboardButton.payInlineKeyboardButtonOrThrow(): PayInlineKeyboardButton = - this as dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.PayInlineKeyboardButton - -public inline fun - InlineKeyboardButton.ifPayInlineKeyboardButton(block: (PayInlineKeyboardButton) -> T): T? = - payInlineKeyboardButtonOrNull() ?.let(block) - -public inline fun InlineKeyboardButton.callbackDataInlineKeyboardButtonOrNull(): - CallbackDataInlineKeyboardButton? = this as? - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackDataInlineKeyboardButton - -public inline fun InlineKeyboardButton.callbackDataInlineKeyboardButtonOrThrow(): - CallbackDataInlineKeyboardButton = this as - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackDataInlineKeyboardButton - -public inline fun - InlineKeyboardButton.ifCallbackDataInlineKeyboardButton(block: (CallbackDataInlineKeyboardButton) -> T): - T? = callbackDataInlineKeyboardButtonOrNull() ?.let(block) - -public inline fun InlineKeyboardButton.callbackGameInlineKeyboardButtonOrNull(): - CallbackGameInlineKeyboardButton? = this as? - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackGameInlineKeyboardButton - -public inline fun InlineKeyboardButton.callbackGameInlineKeyboardButtonOrThrow(): - CallbackGameInlineKeyboardButton = this as - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CallbackGameInlineKeyboardButton - -public inline fun - InlineKeyboardButton.ifCallbackGameInlineKeyboardButton(block: (CallbackGameInlineKeyboardButton) -> T): - T? = callbackGameInlineKeyboardButtonOrNull() ?.let(block) - -public inline fun InlineKeyboardButton.loginURLInlineKeyboardButtonOrNull(): - LoginURLInlineKeyboardButton? = this as? - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.LoginURLInlineKeyboardButton - -public inline fun InlineKeyboardButton.loginURLInlineKeyboardButtonOrThrow(): - LoginURLInlineKeyboardButton = this as - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.LoginURLInlineKeyboardButton - -public inline fun - InlineKeyboardButton.ifLoginURLInlineKeyboardButton(block: (LoginURLInlineKeyboardButton) -> T): - T? = loginURLInlineKeyboardButtonOrNull() ?.let(block) - -public inline fun InlineKeyboardButton.switchInlineQueryCurrentChatInlineKeyboardButtonOrNull(): - SwitchInlineQueryCurrentChatInlineKeyboardButton? = this as? - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryCurrentChatInlineKeyboardButton - -public inline fun InlineKeyboardButton.switchInlineQueryCurrentChatInlineKeyboardButtonOrThrow(): - SwitchInlineQueryCurrentChatInlineKeyboardButton = this as - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryCurrentChatInlineKeyboardButton - -public inline fun - InlineKeyboardButton.ifSwitchInlineQueryCurrentChatInlineKeyboardButton(block: (SwitchInlineQueryCurrentChatInlineKeyboardButton) -> T): - T? = switchInlineQueryCurrentChatInlineKeyboardButtonOrNull() ?.let(block) - -public inline fun InlineKeyboardButton.switchInlineQueryInlineKeyboardButtonOrNull(): - SwitchInlineQueryInlineKeyboardButton? = this as? - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryInlineKeyboardButton - -public inline fun InlineKeyboardButton.switchInlineQueryInlineKeyboardButtonOrThrow(): - SwitchInlineQueryInlineKeyboardButton = this as - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryInlineKeyboardButton - -public inline fun - InlineKeyboardButton.ifSwitchInlineQueryInlineKeyboardButton(block: (SwitchInlineQueryInlineKeyboardButton) -> T): - T? = switchInlineQueryInlineKeyboardButtonOrNull() ?.let(block) - -public inline fun InlineKeyboardButton.uRLInlineKeyboardButtonOrNull(): URLInlineKeyboardButton? = - this as? dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.URLInlineKeyboardButton - -public inline fun InlineKeyboardButton.uRLInlineKeyboardButtonOrThrow(): URLInlineKeyboardButton = - this as dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.URLInlineKeyboardButton - -public inline fun - InlineKeyboardButton.ifURLInlineKeyboardButton(block: (URLInlineKeyboardButton) -> T): T? = - uRLInlineKeyboardButtonOrNull() ?.let(block) - -public inline fun InlineKeyboardButton.webAppInlineKeyboardButtonOrNull(): - WebAppInlineKeyboardButton? = this as? - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.WebAppInlineKeyboardButton - -public inline fun InlineKeyboardButton.webAppInlineKeyboardButtonOrThrow(): - WebAppInlineKeyboardButton = this as - dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.WebAppInlineKeyboardButton - -public inline fun - InlineKeyboardButton.ifWebAppInlineKeyboardButton(block: (WebAppInlineKeyboardButton) -> T): T? - = webAppInlineKeyboardButtonOrNull() ?.let(block) - -public inline fun KeyboardMarkup.inlineKeyboardMarkupOrNull(): InlineKeyboardMarkup? = this as? - dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup - -public inline fun KeyboardMarkup.inlineKeyboardMarkupOrThrow(): InlineKeyboardMarkup = this as - dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup - -public inline fun KeyboardMarkup.ifInlineKeyboardMarkup(block: (InlineKeyboardMarkup) -> T): T? - = inlineKeyboardMarkupOrNull() ?.let(block) - -public inline fun KeyboardMarkup.replyForceOrNull(): ReplyForce? = this as? - dev.inmo.tgbotapi.types.buttons.ReplyForce - -public inline fun KeyboardMarkup.replyForceOrThrow(): ReplyForce = this as - dev.inmo.tgbotapi.types.buttons.ReplyForce - -public inline fun KeyboardMarkup.ifReplyForce(block: (ReplyForce) -> T): T? = replyForceOrNull() - ?.let(block) - -public inline fun KeyboardMarkup.replyKeyboardMarkupOrNull(): ReplyKeyboardMarkup? = this as? - dev.inmo.tgbotapi.types.buttons.ReplyKeyboardMarkup - -public inline fun KeyboardMarkup.replyKeyboardMarkupOrThrow(): ReplyKeyboardMarkup = this as - dev.inmo.tgbotapi.types.buttons.ReplyKeyboardMarkup - -public inline fun KeyboardMarkup.ifReplyKeyboardMarkup(block: (ReplyKeyboardMarkup) -> T): T? = - replyKeyboardMarkupOrNull() ?.let(block) - -public inline fun KeyboardMarkup.replyKeyboardRemoveOrNull(): ReplyKeyboardRemove? = this as? - dev.inmo.tgbotapi.types.buttons.ReplyKeyboardRemove - -public inline fun KeyboardMarkup.replyKeyboardRemoveOrThrow(): ReplyKeyboardRemove = this as - dev.inmo.tgbotapi.types.buttons.ReplyKeyboardRemove - -public inline fun KeyboardMarkup.ifReplyKeyboardRemove(block: (ReplyKeyboardRemove) -> T): T? = - replyKeyboardRemoveOrNull() ?.let(block) - -public inline fun Chat.channelChatOrNull(): ChannelChat? = this as? - dev.inmo.tgbotapi.types.chat.ChannelChat - -public inline fun Chat.channelChatOrThrow(): ChannelChat = this as - dev.inmo.tgbotapi.types.chat.ChannelChat - -public inline fun Chat.ifChannelChat(block: (ChannelChat) -> T): T? = channelChatOrNull() - ?.let(block) - -public inline fun Chat.groupChatOrNull(): GroupChat? = this as? - dev.inmo.tgbotapi.types.chat.GroupChat - -public inline fun Chat.groupChatOrThrow(): GroupChat = this as - dev.inmo.tgbotapi.types.chat.GroupChat - -public inline fun Chat.ifGroupChat(block: (GroupChat) -> T): T? = groupChatOrNull() ?.let(block) - -public inline fun Chat.privateChatOrNull(): PrivateChat? = this as? - dev.inmo.tgbotapi.types.chat.PrivateChat - -public inline fun Chat.privateChatOrThrow(): PrivateChat = this as - dev.inmo.tgbotapi.types.chat.PrivateChat - -public inline fun Chat.ifPrivateChat(block: (PrivateChat) -> T): T? = privateChatOrNull() - ?.let(block) - -public inline fun Chat.publicChatOrNull(): PublicChat? = this as? - dev.inmo.tgbotapi.types.chat.PublicChat - -public inline fun Chat.publicChatOrThrow(): PublicChat = this as - dev.inmo.tgbotapi.types.chat.PublicChat - -public inline fun Chat.ifPublicChat(block: (PublicChat) -> T): T? = publicChatOrNull() - ?.let(block) - -public inline fun Chat.supergroupChatOrNull(): SupergroupChat? = this as? - dev.inmo.tgbotapi.types.chat.SupergroupChat - -public inline fun Chat.supergroupChatOrThrow(): SupergroupChat = this as - dev.inmo.tgbotapi.types.chat.SupergroupChat - -public inline fun Chat.ifSupergroupChat(block: (SupergroupChat) -> T): T? = - supergroupChatOrNull() ?.let(block) - -public inline fun Chat.superPublicChatOrNull(): SuperPublicChat? = this as? - dev.inmo.tgbotapi.types.chat.SuperPublicChat - -public inline fun Chat.superPublicChatOrThrow(): SuperPublicChat = this as - dev.inmo.tgbotapi.types.chat.SuperPublicChat - -public inline fun Chat.ifSuperPublicChat(block: (SuperPublicChat) -> T): T? = - superPublicChatOrNull() ?.let(block) - -public inline fun Chat.usernameChatOrNull(): UsernameChat? = this as? - dev.inmo.tgbotapi.types.chat.UsernameChat - -public inline fun Chat.usernameChatOrThrow(): UsernameChat = this as - dev.inmo.tgbotapi.types.chat.UsernameChat - -public inline fun Chat.ifUsernameChat(block: (UsernameChat) -> T): T? = usernameChatOrNull() - ?.let(block) - -public inline fun Chat.possiblyPremiumChatOrNull(): PossiblyPremiumChat? = this as? - dev.inmo.tgbotapi.types.chat.PossiblyPremiumChat - -public inline fun Chat.possiblyPremiumChatOrThrow(): PossiblyPremiumChat = this as - dev.inmo.tgbotapi.types.chat.PossiblyPremiumChat - -public inline fun Chat.ifPossiblyPremiumChat(block: (PossiblyPremiumChat) -> T): T? = - possiblyPremiumChatOrNull() ?.let(block) - -public inline fun Chat.ableToAddInAttachmentMenuChatOrNull(): AbleToAddInAttachmentMenuChat? = this - as? dev.inmo.tgbotapi.types.chat.AbleToAddInAttachmentMenuChat - -public inline fun Chat.ableToAddInAttachmentMenuChatOrThrow(): AbleToAddInAttachmentMenuChat = this - as dev.inmo.tgbotapi.types.chat.AbleToAddInAttachmentMenuChat - -public inline fun - Chat.ifAbleToAddInAttachmentMenuChat(block: (AbleToAddInAttachmentMenuChat) -> T): T? = - ableToAddInAttachmentMenuChatOrNull() ?.let(block) - -public inline fun Chat.extendedChannelChatImplOrNull(): ExtendedChannelChatImpl? = this as? - dev.inmo.tgbotapi.types.chat.ExtendedChannelChatImpl - -public inline fun Chat.extendedChannelChatImplOrThrow(): ExtendedChannelChatImpl = this as - dev.inmo.tgbotapi.types.chat.ExtendedChannelChatImpl - -public inline fun Chat.ifExtendedChannelChatImpl(block: (ExtendedChannelChatImpl) -> T): T? = - extendedChannelChatImplOrNull() ?.let(block) - -public inline fun Chat.extendedGroupChatImplOrNull(): ExtendedGroupChatImpl? = this as? - dev.inmo.tgbotapi.types.chat.ExtendedGroupChatImpl - -public inline fun Chat.extendedGroupChatImplOrThrow(): ExtendedGroupChatImpl = this as - dev.inmo.tgbotapi.types.chat.ExtendedGroupChatImpl - -public inline fun Chat.ifExtendedGroupChatImpl(block: (ExtendedGroupChatImpl) -> T): T? = - extendedGroupChatImplOrNull() ?.let(block) - -public inline fun Chat.extendedPrivateChatImplOrNull(): ExtendedPrivateChatImpl? = this as? - dev.inmo.tgbotapi.types.chat.ExtendedPrivateChatImpl - -public inline fun Chat.extendedPrivateChatImplOrThrow(): ExtendedPrivateChatImpl = this as - dev.inmo.tgbotapi.types.chat.ExtendedPrivateChatImpl - -public inline fun Chat.ifExtendedPrivateChatImpl(block: (ExtendedPrivateChatImpl) -> T): T? = - extendedPrivateChatImplOrNull() ?.let(block) - -public inline fun Chat.extendedSupergroupChatImplOrNull(): ExtendedSupergroupChatImpl? = this as? - dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChatImpl - -public inline fun Chat.extendedSupergroupChatImplOrThrow(): ExtendedSupergroupChatImpl = this as - dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChatImpl - -public inline fun Chat.ifExtendedSupergroupChatImpl(block: (ExtendedSupergroupChatImpl) -> T): - T? = extendedSupergroupChatImplOrNull() ?.let(block) - -public inline fun Chat.extendedBotOrNull(): ExtendedBot? = this as? - dev.inmo.tgbotapi.types.chat.ExtendedBot - -public inline fun Chat.extendedBotOrThrow(): ExtendedBot = this as - dev.inmo.tgbotapi.types.chat.ExtendedBot - -public inline fun Chat.ifExtendedBot(block: (ExtendedBot) -> T): T? = extendedBotOrNull() - ?.let(block) - -public inline fun Chat.unknownExtendedChatOrNull(): UnknownExtendedChat? = this as? - dev.inmo.tgbotapi.types.chat.UnknownExtendedChat - -public inline fun Chat.unknownExtendedChatOrThrow(): UnknownExtendedChat = this as - dev.inmo.tgbotapi.types.chat.UnknownExtendedChat - -public inline fun Chat.ifUnknownExtendedChat(block: (UnknownExtendedChat) -> T): T? = - unknownExtendedChatOrNull() ?.let(block) - -public inline fun Chat.extendedChannelChatOrNull(): ExtendedChannelChat? = this as? - dev.inmo.tgbotapi.types.chat.ExtendedChannelChat - -public inline fun Chat.extendedChannelChatOrThrow(): ExtendedChannelChat = this as - dev.inmo.tgbotapi.types.chat.ExtendedChannelChat - -public inline fun Chat.ifExtendedChannelChat(block: (ExtendedChannelChat) -> T): T? = - extendedChannelChatOrNull() ?.let(block) - -public inline fun Chat.extendedGroupChatOrNull(): ExtendedGroupChat? = this as? - dev.inmo.tgbotapi.types.chat.ExtendedGroupChat - -public inline fun Chat.extendedGroupChatOrThrow(): ExtendedGroupChat = this as - dev.inmo.tgbotapi.types.chat.ExtendedGroupChat - -public inline fun Chat.ifExtendedGroupChat(block: (ExtendedGroupChat) -> T): T? = - extendedGroupChatOrNull() ?.let(block) - -public inline fun Chat.extendedPrivateChatOrNull(): ExtendedPrivateChat? = this as? - dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat - -public inline fun Chat.extendedPrivateChatOrThrow(): ExtendedPrivateChat = this as - dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat - -public inline fun Chat.ifExtendedPrivateChat(block: (ExtendedPrivateChat) -> T): T? = - extendedPrivateChatOrNull() ?.let(block) - -public inline fun Chat.extendedPublicChatOrNull(): ExtendedPublicChat? = this as? - dev.inmo.tgbotapi.types.chat.ExtendedPublicChat - -public inline fun Chat.extendedPublicChatOrThrow(): ExtendedPublicChat = this as - dev.inmo.tgbotapi.types.chat.ExtendedPublicChat - -public inline fun Chat.ifExtendedPublicChat(block: (ExtendedPublicChat) -> T): T? = - extendedPublicChatOrNull() ?.let(block) - -public inline fun Chat.extendedSupergroupChatOrNull(): ExtendedSupergroupChat? = this as? - dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat - -public inline fun Chat.extendedSupergroupChatOrThrow(): ExtendedSupergroupChat = this as - dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat - -public inline fun Chat.ifExtendedSupergroupChat(block: (ExtendedSupergroupChat) -> T): T? = - extendedSupergroupChatOrNull() ?.let(block) - -public inline fun Chat.extendedChatOrNull(): ExtendedChat? = this as? - dev.inmo.tgbotapi.types.chat.ExtendedChat - -public inline fun Chat.extendedChatOrThrow(): ExtendedChat = this as - dev.inmo.tgbotapi.types.chat.ExtendedChat - -public inline fun Chat.ifExtendedChat(block: (ExtendedChat) -> T): T? = extendedChatOrNull() - ?.let(block) - -public inline fun Chat.groupChatImplOrNull(): GroupChatImpl? = this as? - dev.inmo.tgbotapi.types.chat.GroupChatImpl - -public inline fun Chat.groupChatImplOrThrow(): GroupChatImpl = this as - dev.inmo.tgbotapi.types.chat.GroupChatImpl - -public inline fun Chat.ifGroupChatImpl(block: (GroupChatImpl) -> T): T? = groupChatImplOrNull() - ?.let(block) - -public inline fun Chat.privateChatImplOrNull(): PrivateChatImpl? = this as? - dev.inmo.tgbotapi.types.chat.PrivateChatImpl - -public inline fun Chat.privateChatImplOrThrow(): PrivateChatImpl = this as - dev.inmo.tgbotapi.types.chat.PrivateChatImpl - -public inline fun Chat.ifPrivateChatImpl(block: (PrivateChatImpl) -> T): T? = - privateChatImplOrNull() ?.let(block) - -public inline fun Chat.supergroupChatImplOrNull(): SupergroupChatImpl? = this as? - dev.inmo.tgbotapi.types.chat.SupergroupChatImpl - -public inline fun Chat.supergroupChatImplOrThrow(): SupergroupChatImpl = this as - dev.inmo.tgbotapi.types.chat.SupergroupChatImpl - -public inline fun Chat.ifSupergroupChatImpl(block: (SupergroupChatImpl) -> T): T? = - supergroupChatImplOrNull() ?.let(block) - -public inline fun Chat.channelChatImplOrNull(): ChannelChatImpl? = this as? - dev.inmo.tgbotapi.types.chat.ChannelChatImpl - -public inline fun Chat.channelChatImplOrThrow(): ChannelChatImpl = this as - dev.inmo.tgbotapi.types.chat.ChannelChatImpl - -public inline fun Chat.ifChannelChatImpl(block: (ChannelChatImpl) -> T): T? = - channelChatImplOrNull() ?.let(block) - -public inline fun Chat.userOrNull(): User? = this as? dev.inmo.tgbotapi.types.chat.User - -public inline fun Chat.userOrThrow(): User = this as dev.inmo.tgbotapi.types.chat.User - -public inline fun Chat.ifUser(block: (User) -> T): T? = userOrNull() ?.let(block) - -public inline fun Chat.botOrNull(): Bot? = this as? dev.inmo.tgbotapi.types.chat.Bot - -public inline fun Chat.botOrThrow(): Bot = this as dev.inmo.tgbotapi.types.chat.Bot - -public inline fun Chat.ifBot(block: (Bot) -> T): T? = botOrNull() ?.let(block) - -public inline fun Chat.commonBotOrNull(): CommonBot? = this as? - dev.inmo.tgbotapi.types.chat.CommonBot - -public inline fun Chat.commonBotOrThrow(): CommonBot = this as - dev.inmo.tgbotapi.types.chat.CommonBot - -public inline fun Chat.ifCommonBot(block: (CommonBot) -> T): T? = commonBotOrNull() ?.let(block) - -public inline fun Chat.commonUserOrNull(): CommonUser? = this as? - dev.inmo.tgbotapi.types.chat.CommonUser - -public inline fun Chat.commonUserOrThrow(): CommonUser = this as - dev.inmo.tgbotapi.types.chat.CommonUser - -public inline fun Chat.ifCommonUser(block: (CommonUser) -> T): T? = commonUserOrNull() - ?.let(block) - -public inline fun Chat.unknownChatTypeOrNull(): UnknownChatType? = this as? - dev.inmo.tgbotapi.types.chat.UnknownChatType - -public inline fun Chat.unknownChatTypeOrThrow(): UnknownChatType = this as - dev.inmo.tgbotapi.types.chat.UnknownChatType - -public inline fun Chat.ifUnknownChatType(block: (UnknownChatType) -> T): T? = - unknownChatTypeOrNull() ?.let(block) - -public inline fun DiceAnimationType.cubeDiceAnimationTypeOrNull(): CubeDiceAnimationType? = this as? - dev.inmo.tgbotapi.types.dice.CubeDiceAnimationType - -public inline fun DiceAnimationType.cubeDiceAnimationTypeOrThrow(): CubeDiceAnimationType = this as - dev.inmo.tgbotapi.types.dice.CubeDiceAnimationType - -public inline fun - DiceAnimationType.ifCubeDiceAnimationType(block: (CubeDiceAnimationType) -> T): T? = - cubeDiceAnimationTypeOrNull() ?.let(block) - -public inline fun DiceAnimationType.dartsDiceAnimationTypeOrNull(): DartsDiceAnimationType? = this - as? dev.inmo.tgbotapi.types.dice.DartsDiceAnimationType - -public inline fun DiceAnimationType.dartsDiceAnimationTypeOrThrow(): DartsDiceAnimationType = this - as dev.inmo.tgbotapi.types.dice.DartsDiceAnimationType - -public inline fun - DiceAnimationType.ifDartsDiceAnimationType(block: (DartsDiceAnimationType) -> T): T? = - dartsDiceAnimationTypeOrNull() ?.let(block) - -public inline fun DiceAnimationType.basketballDiceAnimationTypeOrNull(): - BasketballDiceAnimationType? = this as? dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType - -public inline fun DiceAnimationType.basketballDiceAnimationTypeOrThrow(): - BasketballDiceAnimationType = this as dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType - -public inline fun - DiceAnimationType.ifBasketballDiceAnimationType(block: (BasketballDiceAnimationType) -> T): T? = - basketballDiceAnimationTypeOrNull() ?.let(block) - -public inline fun DiceAnimationType.footballDiceAnimationTypeOrNull(): FootballDiceAnimationType? = - this as? dev.inmo.tgbotapi.types.dice.FootballDiceAnimationType - -public inline fun DiceAnimationType.footballDiceAnimationTypeOrThrow(): FootballDiceAnimationType = - this as dev.inmo.tgbotapi.types.dice.FootballDiceAnimationType - -public inline fun - DiceAnimationType.ifFootballDiceAnimationType(block: (FootballDiceAnimationType) -> T): T? = - footballDiceAnimationTypeOrNull() ?.let(block) - -public inline fun DiceAnimationType.bowlingDiceAnimationTypeOrNull(): BowlingDiceAnimationType? = - this as? dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType - -public inline fun DiceAnimationType.bowlingDiceAnimationTypeOrThrow(): BowlingDiceAnimationType = - this as dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType - -public inline fun - DiceAnimationType.ifBowlingDiceAnimationType(block: (BowlingDiceAnimationType) -> T): T? = - bowlingDiceAnimationTypeOrNull() ?.let(block) - -public inline fun DiceAnimationType.slotMachineDiceAnimationTypeOrNull(): - SlotMachineDiceAnimationType? = this as? - dev.inmo.tgbotapi.types.dice.SlotMachineDiceAnimationType - -public inline fun DiceAnimationType.slotMachineDiceAnimationTypeOrThrow(): - SlotMachineDiceAnimationType = this as dev.inmo.tgbotapi.types.dice.SlotMachineDiceAnimationType - -public inline fun - DiceAnimationType.ifSlotMachineDiceAnimationType(block: (SlotMachineDiceAnimationType) -> T): T? - = slotMachineDiceAnimationTypeOrNull() ?.let(block) - -public inline fun DiceAnimationType.customDiceAnimationTypeOrNull(): CustomDiceAnimationType? = this - as? dev.inmo.tgbotapi.types.dice.CustomDiceAnimationType - -public inline fun DiceAnimationType.customDiceAnimationTypeOrThrow(): CustomDiceAnimationType = this - as dev.inmo.tgbotapi.types.dice.CustomDiceAnimationType - -public inline fun - DiceAnimationType.ifCustomDiceAnimationType(block: (CustomDiceAnimationType) -> T): T? = - customDiceAnimationTypeOrNull() ?.let(block) - -public inline fun TelegramMediaFile.animationFileOrNull(): AnimationFile? = this as? - dev.inmo.tgbotapi.types.files.AnimationFile - -public inline fun TelegramMediaFile.animationFileOrThrow(): AnimationFile = this as - dev.inmo.tgbotapi.types.files.AnimationFile - -public inline fun TelegramMediaFile.ifAnimationFile(block: (AnimationFile) -> T): T? = - animationFileOrNull() ?.let(block) - -public inline fun TelegramMediaFile.audioFileOrNull(): AudioFile? = this as? - dev.inmo.tgbotapi.types.files.AudioFile - -public inline fun TelegramMediaFile.audioFileOrThrow(): AudioFile = this as - dev.inmo.tgbotapi.types.files.AudioFile - -public inline fun TelegramMediaFile.ifAudioFile(block: (AudioFile) -> T): T? = audioFileOrNull() - ?.let(block) - -public inline fun TelegramMediaFile.documentFileOrNull(): DocumentFile? = this as? - dev.inmo.tgbotapi.types.files.DocumentFile - -public inline fun TelegramMediaFile.documentFileOrThrow(): DocumentFile = this as - dev.inmo.tgbotapi.types.files.DocumentFile - -public inline fun TelegramMediaFile.ifDocumentFile(block: (DocumentFile) -> T): T? = - documentFileOrNull() ?.let(block) - -public inline fun TelegramMediaFile.fileOrNull(): File? = this as? - dev.inmo.tgbotapi.types.files.File - -public inline fun TelegramMediaFile.fileOrThrow(): File = this as dev.inmo.tgbotapi.types.files.File - -public inline fun TelegramMediaFile.ifFile(block: (File) -> T): T? = fileOrNull() ?.let(block) - -public inline fun TelegramMediaFile.mimedMediaFileOrNull(): MimedMediaFile? = this as? - dev.inmo.tgbotapi.types.files.MimedMediaFile - -public inline fun TelegramMediaFile.mimedMediaFileOrThrow(): MimedMediaFile = this as - dev.inmo.tgbotapi.types.files.MimedMediaFile - -public inline fun TelegramMediaFile.ifMimedMediaFile(block: (MimedMediaFile) -> T): T? = - mimedMediaFileOrNull() ?.let(block) - -public inline fun TelegramMediaFile.passportFileOrNull(): PassportFile? = this as? - dev.inmo.tgbotapi.types.files.PassportFile - -public inline fun TelegramMediaFile.passportFileOrThrow(): PassportFile = this as - dev.inmo.tgbotapi.types.files.PassportFile - -public inline fun TelegramMediaFile.ifPassportFile(block: (PassportFile) -> T): T? = - passportFileOrNull() ?.let(block) - -public inline fun TelegramMediaFile.pathedFileOrNull(): PathedFile? = this as? - dev.inmo.tgbotapi.types.files.PathedFile - -public inline fun TelegramMediaFile.pathedFileOrThrow(): PathedFile = this as - dev.inmo.tgbotapi.types.files.PathedFile - -public inline fun TelegramMediaFile.ifPathedFile(block: (PathedFile) -> T): T? = - pathedFileOrNull() ?.let(block) - -public inline fun TelegramMediaFile.photoSizeOrNull(): PhotoSize? = this as? - dev.inmo.tgbotapi.types.files.PhotoSize - -public inline fun TelegramMediaFile.photoSizeOrThrow(): PhotoSize = this as - dev.inmo.tgbotapi.types.files.PhotoSize - -public inline fun TelegramMediaFile.ifPhotoSize(block: (PhotoSize) -> T): T? = photoSizeOrNull() - ?.let(block) - -public inline fun TelegramMediaFile.playableMediaFileOrNull(): PlayableMediaFile? = this as? - dev.inmo.tgbotapi.types.files.PlayableMediaFile - -public inline fun TelegramMediaFile.playableMediaFileOrThrow(): PlayableMediaFile = this as - dev.inmo.tgbotapi.types.files.PlayableMediaFile - -public inline fun TelegramMediaFile.ifPlayableMediaFile(block: (PlayableMediaFile) -> T): T? = - playableMediaFileOrNull() ?.let(block) - -public inline fun TelegramMediaFile.sizedMediaFileOrNull(): SizedMediaFile? = this as? - dev.inmo.tgbotapi.types.files.SizedMediaFile - -public inline fun TelegramMediaFile.sizedMediaFileOrThrow(): SizedMediaFile = this as - dev.inmo.tgbotapi.types.files.SizedMediaFile - -public inline fun TelegramMediaFile.ifSizedMediaFile(block: (SizedMediaFile) -> T): T? = - sizedMediaFileOrNull() ?.let(block) - -public inline fun TelegramMediaFile.stickerOrNull(): Sticker? = this as? - dev.inmo.tgbotapi.types.files.Sticker - -public inline fun TelegramMediaFile.stickerOrThrow(): Sticker = this as - dev.inmo.tgbotapi.types.files.Sticker - -public inline fun TelegramMediaFile.ifSticker(block: (Sticker) -> T): T? = stickerOrNull() - ?.let(block) - -public inline fun TelegramMediaFile.simpleStickerOrNull(): SimpleSticker? = this as? - dev.inmo.tgbotapi.types.files.SimpleSticker - -public inline fun TelegramMediaFile.simpleStickerOrThrow(): SimpleSticker = this as - dev.inmo.tgbotapi.types.files.SimpleSticker - -public inline fun TelegramMediaFile.ifSimpleSticker(block: (SimpleSticker) -> T): T? = - simpleStickerOrNull() ?.let(block) - -public inline fun TelegramMediaFile.animatedStickerOrNull(): AnimatedSticker? = this as? - dev.inmo.tgbotapi.types.files.AnimatedSticker - -public inline fun TelegramMediaFile.animatedStickerOrThrow(): AnimatedSticker = this as - dev.inmo.tgbotapi.types.files.AnimatedSticker - -public inline fun TelegramMediaFile.ifAnimatedSticker(block: (AnimatedSticker) -> T): T? = - animatedStickerOrNull() ?.let(block) - -public inline fun TelegramMediaFile.videoStickerOrNull(): VideoSticker? = this as? - dev.inmo.tgbotapi.types.files.VideoSticker - -public inline fun TelegramMediaFile.videoStickerOrThrow(): VideoSticker = this as - dev.inmo.tgbotapi.types.files.VideoSticker - -public inline fun TelegramMediaFile.ifVideoSticker(block: (VideoSticker) -> T): T? = - videoStickerOrNull() ?.let(block) - -public inline fun TelegramMediaFile.thumbedMediaFileOrNull(): ThumbedMediaFile? = this as? - dev.inmo.tgbotapi.types.files.ThumbedMediaFile - -public inline fun TelegramMediaFile.thumbedMediaFileOrThrow(): ThumbedMediaFile = this as - dev.inmo.tgbotapi.types.files.ThumbedMediaFile - -public inline fun TelegramMediaFile.ifThumbedMediaFile(block: (ThumbedMediaFile) -> T): T? = - thumbedMediaFileOrNull() ?.let(block) - -public inline fun TelegramMediaFile.videoFileOrNull(): VideoFile? = this as? - dev.inmo.tgbotapi.types.files.VideoFile - -public inline fun TelegramMediaFile.videoFileOrThrow(): VideoFile = this as - dev.inmo.tgbotapi.types.files.VideoFile - -public inline fun TelegramMediaFile.ifVideoFile(block: (VideoFile) -> T): T? = videoFileOrNull() - ?.let(block) - -public inline fun TelegramMediaFile.videoNoteFileOrNull(): VideoNoteFile? = this as? - dev.inmo.tgbotapi.types.files.VideoNoteFile - -public inline fun TelegramMediaFile.videoNoteFileOrThrow(): VideoNoteFile = this as - dev.inmo.tgbotapi.types.files.VideoNoteFile - -public inline fun TelegramMediaFile.ifVideoNoteFile(block: (VideoNoteFile) -> T): T? = - videoNoteFileOrNull() ?.let(block) - -public inline fun TelegramMediaFile.voiceFileOrNull(): VoiceFile? = this as? - dev.inmo.tgbotapi.types.files.VoiceFile - -public inline fun TelegramMediaFile.voiceFileOrThrow(): VoiceFile = this as - dev.inmo.tgbotapi.types.files.VoiceFile - -public inline fun TelegramMediaFile.ifVoiceFile(block: (VoiceFile) -> T): T? = voiceFileOrNull() - ?.let(block) - -public inline fun Location.staticLocationOrNull(): StaticLocation? = this as? - dev.inmo.tgbotapi.types.location.StaticLocation - -public inline fun Location.staticLocationOrThrow(): StaticLocation = this as - dev.inmo.tgbotapi.types.location.StaticLocation - -public inline fun Location.ifStaticLocation(block: (StaticLocation) -> T): T? = - staticLocationOrNull() ?.let(block) - -public inline fun Location.liveLocationOrNull(): LiveLocation? = this as? - dev.inmo.tgbotapi.types.location.LiveLocation - -public inline fun Location.liveLocationOrThrow(): LiveLocation = this as - dev.inmo.tgbotapi.types.location.LiveLocation - -public inline fun Location.ifLiveLocation(block: (LiveLocation) -> T): T? = liveLocationOrNull() - ?.let(block) - -public inline fun TelegramMedia.duratedTelegramMediaOrNull(): DuratedTelegramMedia? = this as? - dev.inmo.tgbotapi.types.media.DuratedTelegramMedia - -public inline fun TelegramMedia.duratedTelegramMediaOrThrow(): DuratedTelegramMedia = this as - dev.inmo.tgbotapi.types.media.DuratedTelegramMedia - -public inline fun TelegramMedia.ifDuratedTelegramMedia(block: (DuratedTelegramMedia) -> T): T? = - duratedTelegramMediaOrNull() ?.let(block) - -public inline fun TelegramMedia.mediaGroupMemberTelegramMediaOrNull(): - MediaGroupMemberTelegramMedia? = this as? - dev.inmo.tgbotapi.types.media.MediaGroupMemberTelegramMedia - -public inline fun TelegramMedia.mediaGroupMemberTelegramMediaOrThrow(): - MediaGroupMemberTelegramMedia = this as - dev.inmo.tgbotapi.types.media.MediaGroupMemberTelegramMedia - -public inline fun - TelegramMedia.ifMediaGroupMemberTelegramMedia(block: (MediaGroupMemberTelegramMedia) -> T): T? = - mediaGroupMemberTelegramMediaOrNull() ?.let(block) - -public inline fun TelegramMedia.audioMediaGroupMemberTelegramMediaOrNull(): - AudioMediaGroupMemberTelegramMedia? = this as? - dev.inmo.tgbotapi.types.media.AudioMediaGroupMemberTelegramMedia - -public inline fun TelegramMedia.audioMediaGroupMemberTelegramMediaOrThrow(): - AudioMediaGroupMemberTelegramMedia = this as - dev.inmo.tgbotapi.types.media.AudioMediaGroupMemberTelegramMedia - -public inline fun - TelegramMedia.ifAudioMediaGroupMemberTelegramMedia(block: (AudioMediaGroupMemberTelegramMedia) -> T): - T? = audioMediaGroupMemberTelegramMediaOrNull() ?.let(block) - -public inline fun TelegramMedia.documentMediaGroupMemberTelegramMediaOrNull(): - DocumentMediaGroupMemberTelegramMedia? = this as? - dev.inmo.tgbotapi.types.media.DocumentMediaGroupMemberTelegramMedia - -public inline fun TelegramMedia.documentMediaGroupMemberTelegramMediaOrThrow(): - DocumentMediaGroupMemberTelegramMedia = this as - dev.inmo.tgbotapi.types.media.DocumentMediaGroupMemberTelegramMedia - -public inline fun - TelegramMedia.ifDocumentMediaGroupMemberTelegramMedia(block: (DocumentMediaGroupMemberTelegramMedia) -> T): - T? = documentMediaGroupMemberTelegramMediaOrNull() ?.let(block) - -public inline fun TelegramMedia.visualMediaGroupMemberTelegramMediaOrNull(): - VisualMediaGroupMemberTelegramMedia? = this as? - dev.inmo.tgbotapi.types.media.VisualMediaGroupMemberTelegramMedia - -public inline fun TelegramMedia.visualMediaGroupMemberTelegramMediaOrThrow(): - VisualMediaGroupMemberTelegramMedia = this as - dev.inmo.tgbotapi.types.media.VisualMediaGroupMemberTelegramMedia - -public inline fun - TelegramMedia.ifVisualMediaGroupMemberTelegramMedia(block: (VisualMediaGroupMemberTelegramMedia) -> T): - T? = visualMediaGroupMemberTelegramMediaOrNull() ?.let(block) - -public inline fun TelegramMedia.sizedTelegramMediaOrNull(): SizedTelegramMedia? = this as? - dev.inmo.tgbotapi.types.media.SizedTelegramMedia - -public inline fun TelegramMedia.sizedTelegramMediaOrThrow(): SizedTelegramMedia = this as - dev.inmo.tgbotapi.types.media.SizedTelegramMedia - -public inline fun TelegramMedia.ifSizedTelegramMedia(block: (SizedTelegramMedia) -> T): T? = - sizedTelegramMediaOrNull() ?.let(block) - -public inline fun TelegramMedia.telegramMediaAnimationOrNull(): TelegramMediaAnimation? = this as? - dev.inmo.tgbotapi.types.media.TelegramMediaAnimation - -public inline fun TelegramMedia.telegramMediaAnimationOrThrow(): TelegramMediaAnimation = this as - dev.inmo.tgbotapi.types.media.TelegramMediaAnimation - -public inline fun TelegramMedia.ifTelegramMediaAnimation(block: (TelegramMediaAnimation) -> T): - T? = telegramMediaAnimationOrNull() ?.let(block) - -public inline fun TelegramMedia.telegramMediaAudioOrNull(): TelegramMediaAudio? = this as? - dev.inmo.tgbotapi.types.media.TelegramMediaAudio - -public inline fun TelegramMedia.telegramMediaAudioOrThrow(): TelegramMediaAudio = this as - dev.inmo.tgbotapi.types.media.TelegramMediaAudio - -public inline fun TelegramMedia.ifTelegramMediaAudio(block: (TelegramMediaAudio) -> T): T? = - telegramMediaAudioOrNull() ?.let(block) - -public inline fun TelegramMedia.telegramMediaDocumentOrNull(): TelegramMediaDocument? = this as? - dev.inmo.tgbotapi.types.media.TelegramMediaDocument - -public inline fun TelegramMedia.telegramMediaDocumentOrThrow(): TelegramMediaDocument = this as - dev.inmo.tgbotapi.types.media.TelegramMediaDocument - -public inline fun TelegramMedia.ifTelegramMediaDocument(block: (TelegramMediaDocument) -> T): T? - = telegramMediaDocumentOrNull() ?.let(block) - -public inline fun TelegramMedia.telegramMediaPhotoOrNull(): TelegramMediaPhoto? = this as? - dev.inmo.tgbotapi.types.media.TelegramMediaPhoto - -public inline fun TelegramMedia.telegramMediaPhotoOrThrow(): TelegramMediaPhoto = this as - dev.inmo.tgbotapi.types.media.TelegramMediaPhoto - -public inline fun TelegramMedia.ifTelegramMediaPhoto(block: (TelegramMediaPhoto) -> T): T? = - telegramMediaPhotoOrNull() ?.let(block) - -public inline fun TelegramMedia.telegramMediaVideoOrNull(): TelegramMediaVideo? = this as? - dev.inmo.tgbotapi.types.media.TelegramMediaVideo - -public inline fun TelegramMedia.telegramMediaVideoOrThrow(): TelegramMediaVideo = this as - dev.inmo.tgbotapi.types.media.TelegramMediaVideo - -public inline fun TelegramMedia.ifTelegramMediaVideo(block: (TelegramMediaVideo) -> T): T? = - telegramMediaVideoOrNull() ?.let(block) - -public inline fun TelegramMedia.thumbedTelegramMediaOrNull(): ThumbedTelegramMedia? = this as? - dev.inmo.tgbotapi.types.media.ThumbedTelegramMedia - -public inline fun TelegramMedia.thumbedTelegramMediaOrThrow(): ThumbedTelegramMedia = this as - dev.inmo.tgbotapi.types.media.ThumbedTelegramMedia - -public inline fun TelegramMedia.ifThumbedTelegramMedia(block: (ThumbedTelegramMedia) -> T): T? = - thumbedTelegramMediaOrNull() ?.let(block) - -public inline fun TelegramMedia.titledTelegramMediaOrNull(): TitledTelegramMedia? = this as? - dev.inmo.tgbotapi.types.media.TitledTelegramMedia - -public inline fun TelegramMedia.titledTelegramMediaOrThrow(): TitledTelegramMedia = this as - dev.inmo.tgbotapi.types.media.TitledTelegramMedia - -public inline fun TelegramMedia.ifTitledTelegramMedia(block: (TitledTelegramMedia) -> T): T? = - titledTelegramMediaOrNull() ?.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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 ForwardInfo.byAnonymousOrNull(): ForwardInfo.ByAnonymous? = this as? - dev.inmo.tgbotapi.types.message.ForwardInfo.ByAnonymous - -public inline fun ForwardInfo.byAnonymousOrThrow(): ForwardInfo.ByAnonymous = this as - dev.inmo.tgbotapi.types.message.ForwardInfo.ByAnonymous - -public inline fun ForwardInfo.ifByAnonymous(block: (ForwardInfo.ByAnonymous) -> T): T? = - byAnonymousOrNull() ?.let(block) - -public inline fun ForwardInfo.byUserOrNull(): ForwardInfo.ByUser? = this as? - dev.inmo.tgbotapi.types.message.ForwardInfo.ByUser - -public inline fun ForwardInfo.byUserOrThrow(): ForwardInfo.ByUser = this as - dev.inmo.tgbotapi.types.message.ForwardInfo.ByUser - -public inline fun ForwardInfo.ifByUser(block: (ForwardInfo.ByUser) -> T): T? = byUserOrNull() - ?.let(block) - -public inline fun ForwardInfo.publicChatOrNull(): ForwardInfo.PublicChat? = this as? - dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat - -public inline fun ForwardInfo.publicChatOrThrow(): ForwardInfo.PublicChat = this as - dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat - -public inline fun ForwardInfo.ifPublicChat(block: (ForwardInfo.PublicChat) -> T): T? = - publicChatOrNull() ?.let(block) - -public inline fun ForwardInfo.fromChannelOrNull(): ForwardInfo.PublicChat.FromChannel? = this as? - dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.FromChannel - -public inline fun ForwardInfo.fromChannelOrThrow(): ForwardInfo.PublicChat.FromChannel = this as - dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.FromChannel - -public inline fun ForwardInfo.ifFromChannel(block: (ForwardInfo.PublicChat.FromChannel) -> T): - T? = fromChannelOrNull() ?.let(block) - -public inline fun ForwardInfo.fromSupergroupOrNull(): ForwardInfo.PublicChat.FromSupergroup? = this - as? dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.FromSupergroup - -public inline fun ForwardInfo.fromSupergroupOrThrow(): ForwardInfo.PublicChat.FromSupergroup = this - as dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.FromSupergroup - -public inline fun - ForwardInfo.ifFromSupergroup(block: (ForwardInfo.PublicChat.FromSupergroup) -> T): T? = - fromSupergroupOrNull() ?.let(block) - -public inline fun ForwardInfo.sentByChannelOrNull(): ForwardInfo.PublicChat.SentByChannel? = this - as? dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.SentByChannel - -public inline fun ForwardInfo.sentByChannelOrThrow(): ForwardInfo.PublicChat.SentByChannel = this as - dev.inmo.tgbotapi.types.message.ForwardInfo.PublicChat.SentByChannel - -public inline fun - ForwardInfo.ifSentByChannel(block: (ForwardInfo.PublicChat.SentByChannel) -> T): T? = - sentByChannelOrNull() ?.let(block) - -public inline fun Message.channelContentMessageImplOrNull(): - ChannelContentMessageImpl? = this as? - dev.inmo.tgbotapi.types.message.ChannelContentMessageImpl - -public inline fun Message.channelContentMessageImplOrThrow(): - ChannelContentMessageImpl = this as - dev.inmo.tgbotapi.types.message.ChannelContentMessageImpl - -public inline fun - Message.ifChannelContentMessageImpl(block: (ChannelContentMessageImpl) -> T): T? - = channelContentMessageImplOrNull() ?.let(block) - -public inline fun Message.channelEventMessageOrNull(): ChannelEventMessage? = this as? - dev.inmo.tgbotapi.types.message.ChannelEventMessage - -public inline fun Message.channelEventMessageOrThrow(): ChannelEventMessage = this as - dev.inmo.tgbotapi.types.message.ChannelEventMessage - -public inline fun - Message.ifChannelEventMessage(block: (ChannelEventMessage) -> T): T? = - channelEventMessageOrNull() ?.let(block) - -public inline fun Message.channelMediaGroupMessageOrNull(): - ChannelMediaGroupMessage? = this as? - dev.inmo.tgbotapi.types.message.ChannelMediaGroupMessage - -public inline fun Message.channelMediaGroupMessageOrThrow(): - ChannelMediaGroupMessage = this as - dev.inmo.tgbotapi.types.message.ChannelMediaGroupMessage - -public inline fun - Message.ifChannelMediaGroupMessage(block: (ChannelMediaGroupMessage) -> T): - T? = channelMediaGroupMessageOrNull() ?.let(block) - -public inline fun Message.commonGroupEventMessageOrNull(): CommonGroupEventMessage? = - this as? - dev.inmo.tgbotapi.types.message.CommonGroupEventMessage - -public inline fun Message.commonGroupEventMessageOrThrow(): CommonGroupEventMessage = - this as - dev.inmo.tgbotapi.types.message.CommonGroupEventMessage - -public inline fun - Message.ifCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T): T? = - commonGroupEventMessageOrNull() ?.let(block) - -public inline fun Message.commonMediaGroupMessageOrNull(): - CommonMediaGroupMessage? = this as? - dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage - -public inline fun Message.commonMediaGroupMessageOrThrow(): - CommonMediaGroupMessage = this as - dev.inmo.tgbotapi.types.message.CommonMediaGroupMessage - -public inline fun - Message.ifCommonMediaGroupMessage(block: (CommonMediaGroupMessage) -> T): T? - = commonMediaGroupMessageOrNull() ?.let(block) - -public inline fun Message.commonSupergroupEventMessageOrNull(): - CommonSupergroupEventMessage? = this as? - dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage - -public inline fun Message.commonSupergroupEventMessageOrThrow(): - CommonSupergroupEventMessage = this as - dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage - -public inline fun - Message.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T): - T? = commonSupergroupEventMessageOrNull() ?.let(block) - -public inline fun Message.connectedFromChannelGroupContentMessageImplOrNull(): - ConnectedFromChannelGroupContentMessageImpl? = this as? - dev.inmo.tgbotapi.types.message.ConnectedFromChannelGroupContentMessageImpl - -public inline fun Message.connectedFromChannelGroupContentMessageImplOrThrow(): - ConnectedFromChannelGroupContentMessageImpl = this as - dev.inmo.tgbotapi.types.message.ConnectedFromChannelGroupContentMessageImpl - -public inline fun - Message.ifConnectedFromChannelGroupContentMessageImpl(block: (ConnectedFromChannelGroupContentMessageImpl) -> T): - T? = connectedFromChannelGroupContentMessageImplOrNull() ?.let(block) - -public inline fun Message.unconnectedFromChannelGroupContentMessageImplOrNull(): - UnconnectedFromChannelGroupContentMessageImpl? = this as? - dev.inmo.tgbotapi.types.message.UnconnectedFromChannelGroupContentMessageImpl - -public inline fun Message.unconnectedFromChannelGroupContentMessageImplOrThrow(): - UnconnectedFromChannelGroupContentMessageImpl = this as - dev.inmo.tgbotapi.types.message.UnconnectedFromChannelGroupContentMessageImpl - -public inline fun - Message.ifUnconnectedFromChannelGroupContentMessageImpl(block: (UnconnectedFromChannelGroupContentMessageImpl) -> T): - T? = unconnectedFromChannelGroupContentMessageImplOrNull() ?.let(block) - -public inline fun Message.anonymousGroupContentMessageImplOrNull(): - AnonymousGroupContentMessageImpl? = this as? - dev.inmo.tgbotapi.types.message.AnonymousGroupContentMessageImpl - -public inline fun Message.anonymousGroupContentMessageImplOrThrow(): - AnonymousGroupContentMessageImpl = this as - dev.inmo.tgbotapi.types.message.AnonymousGroupContentMessageImpl - -public inline fun - Message.ifAnonymousGroupContentMessageImpl(block: (AnonymousGroupContentMessageImpl) -> T): - T? = anonymousGroupContentMessageImplOrNull() ?.let(block) - -public inline fun Message.commonGroupContentMessageImplOrNull(): - CommonGroupContentMessageImpl? = this as? - dev.inmo.tgbotapi.types.message.CommonGroupContentMessageImpl - -public inline fun Message.commonGroupContentMessageImplOrThrow(): - CommonGroupContentMessageImpl = this as - dev.inmo.tgbotapi.types.message.CommonGroupContentMessageImpl - -public inline fun - Message.ifCommonGroupContentMessageImpl(block: (CommonGroupContentMessageImpl) -> T): - T? = commonGroupContentMessageImplOrNull() ?.let(block) - -public inline fun Message.passportMessageOrNull(): PassportMessage? = this as? - dev.inmo.tgbotapi.types.message.PassportMessage - -public inline fun Message.passportMessageOrThrow(): PassportMessage = this as - dev.inmo.tgbotapi.types.message.PassportMessage - -public inline fun Message.ifPassportMessage(block: (PassportMessage) -> T): T? = - passportMessageOrNull() ?.let(block) - -public inline fun Message.privateContentMessageImplOrNull(): - PrivateContentMessageImpl? = this as? - dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl - -public inline fun Message.privateContentMessageImplOrThrow(): - PrivateContentMessageImpl = this as - dev.inmo.tgbotapi.types.message.PrivateContentMessageImpl - -public inline fun - Message.ifPrivateContentMessageImpl(block: (PrivateContentMessageImpl) -> T): T? - = privateContentMessageImplOrNull() ?.let(block) - -public inline fun Message.privateEventMessageOrNull(): PrivateEventMessage? = this as? - dev.inmo.tgbotapi.types.message.PrivateEventMessage - -public inline fun Message.privateEventMessageOrThrow(): PrivateEventMessage = this as - dev.inmo.tgbotapi.types.message.PrivateEventMessage - -public inline fun - Message.ifPrivateEventMessage(block: (PrivateEventMessage) -> T): T? = - privateEventMessageOrNull() ?.let(block) - -public inline fun Message.channelContentMessageOrNull(): ChannelContentMessage? = - this as? - dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage - -public inline fun Message.channelContentMessageOrThrow(): ChannelContentMessage = - this as - dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage - -public inline fun - Message.ifChannelContentMessage(block: (ChannelContentMessage) -> T): T? = - channelContentMessageOrNull() ?.let(block) - -public inline fun Message.chatEventMessageOrNull(): ChatEventMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage - -public inline fun Message.chatEventMessageOrThrow(): ChatEventMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage - -public inline fun Message.ifChatEventMessage(block: (ChatEventMessage) -> T): T? = - chatEventMessageOrNull() ?.let(block) - -public inline fun Message.commonMessageOrNull(): CommonMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.CommonMessage - -public inline fun Message.commonMessageOrThrow(): CommonMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.CommonMessage - -public inline fun Message.ifCommonMessage(block: (CommonMessage) -> T): T? = - commonMessageOrNull() ?.let(block) - -public inline fun Message.contentMessageOrNull(): ContentMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.ContentMessage - -public inline fun Message.contentMessageOrThrow(): ContentMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.ContentMessage - -public inline fun Message.ifContentMessage(block: (ContentMessage) -> T): T? = - contentMessageOrNull() ?.let(block) - -public inline fun Message.fromUserMessageOrNull(): FromUserMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage - -public inline fun Message.fromUserMessageOrThrow(): FromUserMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage - -public inline fun Message.ifFromUserMessage(block: (FromUserMessage) -> T): T? = - fromUserMessageOrNull() ?.let(block) - -public inline fun Message.groupEventMessageOrNull(): GroupEventMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage - -public inline fun Message.groupEventMessageOrThrow(): GroupEventMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage - -public inline fun Message.ifGroupEventMessage(block: (GroupEventMessage) -> T): T? = - groupEventMessageOrNull() ?.let(block) - -public inline fun Message.groupContentMessageOrNull(): GroupContentMessage? = this - as? - dev.inmo.tgbotapi.types.message.abstracts.GroupContentMessage - -public inline fun Message.groupContentMessageOrThrow(): GroupContentMessage = this - as - dev.inmo.tgbotapi.types.message.abstracts.GroupContentMessage - -public inline fun - Message.ifGroupContentMessage(block: (GroupContentMessage) -> T): T? = - groupContentMessageOrNull() ?.let(block) - -public inline fun Message.fromChannelGroupContentMessageOrNull(): - FromChannelGroupContentMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.FromChannelGroupContentMessage - -public inline fun Message.fromChannelGroupContentMessageOrThrow(): - FromChannelGroupContentMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.FromChannelGroupContentMessage - -public inline fun - Message.ifFromChannelGroupContentMessage(block: (FromChannelGroupContentMessage) -> T): - T? = fromChannelGroupContentMessageOrNull() ?.let(block) - -public inline fun Message.connectedFromChannelGroupContentMessageOrNull(): - ConnectedFromChannelGroupContentMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.ConnectedFromChannelGroupContentMessage - -public inline fun Message.connectedFromChannelGroupContentMessageOrThrow(): - ConnectedFromChannelGroupContentMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.ConnectedFromChannelGroupContentMessage - -public inline fun - Message.ifConnectedFromChannelGroupContentMessage(block: (ConnectedFromChannelGroupContentMessage) -> T): - T? = connectedFromChannelGroupContentMessageOrNull() ?.let(block) - -public inline fun Message.unconnectedFromChannelGroupContentMessageOrNull(): - UnconnectedFromChannelGroupContentMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.UnconnectedFromChannelGroupContentMessage - -public inline fun Message.unconnectedFromChannelGroupContentMessageOrThrow(): - UnconnectedFromChannelGroupContentMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.UnconnectedFromChannelGroupContentMessage - -public inline fun - Message.ifUnconnectedFromChannelGroupContentMessage(block: (UnconnectedFromChannelGroupContentMessage) -> T): - T? = unconnectedFromChannelGroupContentMessageOrNull() ?.let(block) - -public inline fun Message.anonymousGroupContentMessageOrNull(): - AnonymousGroupContentMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.AnonymousGroupContentMessage - -public inline fun Message.anonymousGroupContentMessageOrThrow(): - AnonymousGroupContentMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.AnonymousGroupContentMessage - -public inline fun - Message.ifAnonymousGroupContentMessage(block: (AnonymousGroupContentMessage) -> T): - T? = anonymousGroupContentMessageOrNull() ?.let(block) - -public inline fun Message.commonGroupContentMessageOrNull(): - CommonGroupContentMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage - -public inline fun Message.commonGroupContentMessageOrThrow(): - CommonGroupContentMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage - -public inline fun - Message.ifCommonGroupContentMessage(block: (CommonGroupContentMessage) -> T): T? - = commonGroupContentMessageOrNull() ?.let(block) - -public inline fun Message.mediaGroupMessageOrNull(): MediaGroupMessage? = this - as? - dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage - -public inline fun Message.mediaGroupMessageOrThrow(): MediaGroupMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage - -public inline fun - Message.ifMediaGroupMessage(block: (MediaGroupMessage) -> T): T? = - mediaGroupMessageOrNull() ?.let(block) - -public inline fun Message.unknownMessageTypeOrNull(): UnknownMessageType? = this as? - dev.inmo.tgbotapi.types.message.abstracts.UnknownMessageType - -public inline fun Message.unknownMessageTypeOrThrow(): UnknownMessageType = this as - dev.inmo.tgbotapi.types.message.abstracts.UnknownMessageType - -public inline fun Message.ifUnknownMessageType(block: (UnknownMessageType) -> T): T? = - unknownMessageTypeOrNull() ?.let(block) - -public inline fun Message.possiblyEditedMessageOrNull(): PossiblyEditedMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.PossiblyEditedMessage - -public inline fun Message.possiblyEditedMessageOrThrow(): PossiblyEditedMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.PossiblyEditedMessage - -public inline fun Message.ifPossiblyEditedMessage(block: (PossiblyEditedMessage) -> T): T? = - possiblyEditedMessageOrNull() ?.let(block) - -public inline fun Message.possiblyForwardedMessageOrNull(): PossiblyForwardedMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage - -public inline fun Message.possiblyForwardedMessageOrThrow(): PossiblyForwardedMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage - -public inline fun Message.ifPossiblyForwardedMessage(block: (PossiblyForwardedMessage) -> T): T? - = possiblyForwardedMessageOrNull() ?.let(block) - -public inline fun Message.possiblyPaymentMessageOrNull(): PossiblyPaymentMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage - -public inline fun Message.possiblyPaymentMessageOrThrow(): PossiblyPaymentMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage - -public inline fun Message.ifPossiblyPaymentMessage(block: (PossiblyPaymentMessage) -> T): T? = - possiblyPaymentMessageOrNull() ?.let(block) - -public inline fun Message.possiblySentViaBotCommonMessageOrNull(): - PossiblySentViaBotCommonMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage - -public inline fun Message.possiblySentViaBotCommonMessageOrThrow(): - PossiblySentViaBotCommonMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage - -public inline fun - Message.ifPossiblySentViaBotCommonMessage(block: (PossiblySentViaBotCommonMessage) -> T): - T? = possiblySentViaBotCommonMessageOrNull() ?.let(block) - -public inline fun Message.privateContentMessageOrNull(): PrivateContentMessage? = - this as? - dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage - -public inline fun Message.privateContentMessageOrThrow(): PrivateContentMessage = - this as - dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage - -public inline fun - Message.ifPrivateContentMessage(block: (PrivateContentMessage) -> T): T? = - privateContentMessageOrNull() ?.let(block) - -public inline fun Message.publicContentMessageOrNull(): PublicContentMessage? = this - as? - dev.inmo.tgbotapi.types.message.abstracts.PublicContentMessage - -public inline fun Message.publicContentMessageOrThrow(): PublicContentMessage = this - as - dev.inmo.tgbotapi.types.message.abstracts.PublicContentMessage - -public inline fun - Message.ifPublicContentMessage(block: (PublicContentMessage) -> T): T? = - publicContentMessageOrNull() ?.let(block) - -public inline fun Message.signedMessageOrNull(): SignedMessage? = this as? - dev.inmo.tgbotapi.types.message.abstracts.SignedMessage - -public inline fun Message.signedMessageOrThrow(): SignedMessage = this as - dev.inmo.tgbotapi.types.message.abstracts.SignedMessage - -public inline fun Message.ifSignedMessage(block: (SignedMessage) -> T): T? = - signedMessageOrNull() ?.let(block) - -public inline fun Message.supergroupEventMessageOrNull(): SupergroupEventMessage? = - this as? - dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage - -public inline fun Message.supergroupEventMessageOrThrow(): SupergroupEventMessage = - this as - dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage - -public inline fun - Message.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T): T? = - supergroupEventMessageOrNull() ?.let(block) - -public inline fun ResendableContent.messageContentOrNull(): MessageContent? = this as? - dev.inmo.tgbotapi.types.message.content.MessageContent - -public inline fun ResendableContent.messageContentOrThrow(): MessageContent = this as - dev.inmo.tgbotapi.types.message.content.MessageContent - -public inline fun ResendableContent.ifMessageContent(block: (MessageContent) -> T): T? = - messageContentOrNull() ?.let(block) - -public inline fun ResendableContent.mediaCollectionContentOrNull(): - MediaCollectionContent? = this as? - dev.inmo.tgbotapi.types.message.content.MediaCollectionContent - -public inline fun ResendableContent.mediaCollectionContentOrThrow(): - MediaCollectionContent = this as - dev.inmo.tgbotapi.types.message.content.MediaCollectionContent - -public inline fun - ResendableContent.ifMediaCollectionContent(block: (MediaCollectionContent) -> T): - T? = mediaCollectionContentOrNull() ?.let(block) - -public inline fun ResendableContent.mediaContentOrNull(): MediaContent? = this as? - dev.inmo.tgbotapi.types.message.content.MediaContent - -public inline fun ResendableContent.mediaContentOrThrow(): MediaContent = this as - dev.inmo.tgbotapi.types.message.content.MediaContent - -public inline fun ResendableContent.ifMediaContent(block: (MediaContent) -> T): T? = - mediaContentOrNull() ?.let(block) - -public inline fun ResendableContent.audioMediaGroupContentOrNull(): AudioMediaGroupContent? = this - as? dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent - -public inline fun ResendableContent.audioMediaGroupContentOrThrow(): AudioMediaGroupContent = this - as dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent - -public inline fun - ResendableContent.ifAudioMediaGroupContent(block: (AudioMediaGroupContent) -> T): T? = - audioMediaGroupContentOrNull() ?.let(block) - -public inline fun ResendableContent.documentMediaGroupContentOrNull(): DocumentMediaGroupContent? = - this as? dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent - -public inline fun ResendableContent.documentMediaGroupContentOrThrow(): DocumentMediaGroupContent = - this as dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent - -public inline fun - ResendableContent.ifDocumentMediaGroupContent(block: (DocumentMediaGroupContent) -> T): T? = - documentMediaGroupContentOrNull() ?.let(block) - -public inline fun ResendableContent.mediaGroupContentOrNull(): MediaGroupContent? = this as? - dev.inmo.tgbotapi.types.message.content.MediaGroupContent - -public inline fun ResendableContent.mediaGroupContentOrThrow(): MediaGroupContent = this as - dev.inmo.tgbotapi.types.message.content.MediaGroupContent - -public inline fun ResendableContent.ifMediaGroupContent(block: (MediaGroupContent) -> T): T? = - mediaGroupContentOrNull() ?.let(block) - -public inline fun ResendableContent.textedMediaContentOrNull(): TextedMediaContent? = this as? - dev.inmo.tgbotapi.types.message.content.TextedMediaContent - -public inline fun ResendableContent.textedMediaContentOrThrow(): TextedMediaContent = this as - dev.inmo.tgbotapi.types.message.content.TextedMediaContent - -public inline fun ResendableContent.ifTextedMediaContent(block: (TextedMediaContent) -> T): T? = - textedMediaContentOrNull() ?.let(block) - -public inline fun ResendableContent.visualMediaGroupContentOrNull(): VisualMediaGroupContent? = this - as? dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent - -public inline fun ResendableContent.visualMediaGroupContentOrThrow(): VisualMediaGroupContent = this - as dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent - -public inline fun - ResendableContent.ifVisualMediaGroupContent(block: (VisualMediaGroupContent) -> T): T? = - visualMediaGroupContentOrNull() ?.let(block) - -public inline fun ResendableContent.animationContentOrNull(): AnimationContent? = this as? - dev.inmo.tgbotapi.types.message.content.AnimationContent - -public inline fun ResendableContent.animationContentOrThrow(): AnimationContent = this as - dev.inmo.tgbotapi.types.message.content.AnimationContent - -public inline fun ResendableContent.ifAnimationContent(block: (AnimationContent) -> T): T? = - animationContentOrNull() ?.let(block) - -public inline fun ResendableContent.audioContentOrNull(): AudioContent? = this as? - dev.inmo.tgbotapi.types.message.content.AudioContent - -public inline fun ResendableContent.audioContentOrThrow(): AudioContent = this as - dev.inmo.tgbotapi.types.message.content.AudioContent - -public inline fun ResendableContent.ifAudioContent(block: (AudioContent) -> T): T? = - audioContentOrNull() ?.let(block) - -public inline fun ResendableContent.contactContentOrNull(): ContactContent? = this as? - dev.inmo.tgbotapi.types.message.content.ContactContent - -public inline fun ResendableContent.contactContentOrThrow(): ContactContent = this as - dev.inmo.tgbotapi.types.message.content.ContactContent - -public inline fun ResendableContent.ifContactContent(block: (ContactContent) -> T): T? = - contactContentOrNull() ?.let(block) - -public inline fun ResendableContent.diceContentOrNull(): DiceContent? = this as? - dev.inmo.tgbotapi.types.message.content.DiceContent - -public inline fun ResendableContent.diceContentOrThrow(): DiceContent = this as - dev.inmo.tgbotapi.types.message.content.DiceContent - -public inline fun ResendableContent.ifDiceContent(block: (DiceContent) -> T): T? = - diceContentOrNull() ?.let(block) - -public inline fun ResendableContent.documentContentOrNull(): DocumentContent? = this as? - dev.inmo.tgbotapi.types.message.content.DocumentContent - -public inline fun ResendableContent.documentContentOrThrow(): DocumentContent = this as - dev.inmo.tgbotapi.types.message.content.DocumentContent - -public inline fun ResendableContent.ifDocumentContent(block: (DocumentContent) -> T): T? = - documentContentOrNull() ?.let(block) - -public inline fun ResendableContent.gameContentOrNull(): GameContent? = this as? - dev.inmo.tgbotapi.types.message.content.GameContent - -public inline fun ResendableContent.gameContentOrThrow(): GameContent = this as - dev.inmo.tgbotapi.types.message.content.GameContent - -public inline fun ResendableContent.ifGameContent(block: (GameContent) -> T): T? = - gameContentOrNull() ?.let(block) - -public inline fun ResendableContent.invoiceContentOrNull(): InvoiceContent? = this as? - dev.inmo.tgbotapi.types.message.content.InvoiceContent - -public inline fun ResendableContent.invoiceContentOrThrow(): InvoiceContent = this as - dev.inmo.tgbotapi.types.message.content.InvoiceContent - -public inline fun ResendableContent.ifInvoiceContent(block: (InvoiceContent) -> T): T? = - invoiceContentOrNull() ?.let(block) - -public inline fun ResendableContent.locationContentOrNull(): LocationContent? = this as? - dev.inmo.tgbotapi.types.message.content.LocationContent - -public inline fun ResendableContent.locationContentOrThrow(): LocationContent = this as - dev.inmo.tgbotapi.types.message.content.LocationContent - -public inline fun ResendableContent.ifLocationContent(block: (LocationContent) -> T): T? = - locationContentOrNull() ?.let(block) - -public inline fun ResendableContent.liveLocationContentOrNull(): LiveLocationContent? = this as? - dev.inmo.tgbotapi.types.message.content.LiveLocationContent - -public inline fun ResendableContent.liveLocationContentOrThrow(): LiveLocationContent = this as - dev.inmo.tgbotapi.types.message.content.LiveLocationContent - -public inline fun ResendableContent.ifLiveLocationContent(block: (LiveLocationContent) -> T): T? - = liveLocationContentOrNull() ?.let(block) - -public inline fun ResendableContent.staticLocationContentOrNull(): StaticLocationContent? = this as? - dev.inmo.tgbotapi.types.message.content.StaticLocationContent - -public inline fun ResendableContent.staticLocationContentOrThrow(): StaticLocationContent = this as - dev.inmo.tgbotapi.types.message.content.StaticLocationContent - -public inline fun - ResendableContent.ifStaticLocationContent(block: (StaticLocationContent) -> T): T? = - staticLocationContentOrNull() ?.let(block) - -public inline fun ResendableContent.photoContentOrNull(): PhotoContent? = this as? - dev.inmo.tgbotapi.types.message.content.PhotoContent - -public inline fun ResendableContent.photoContentOrThrow(): PhotoContent = this as - dev.inmo.tgbotapi.types.message.content.PhotoContent - -public inline fun ResendableContent.ifPhotoContent(block: (PhotoContent) -> T): T? = - photoContentOrNull() ?.let(block) - -public inline fun ResendableContent.pollContentOrNull(): PollContent? = this as? - dev.inmo.tgbotapi.types.message.content.PollContent - -public inline fun ResendableContent.pollContentOrThrow(): PollContent = this as - dev.inmo.tgbotapi.types.message.content.PollContent - -public inline fun ResendableContent.ifPollContent(block: (PollContent) -> T): T? = - pollContentOrNull() ?.let(block) - -public inline fun ResendableContent.stickerContentOrNull(): StickerContent? = this as? - dev.inmo.tgbotapi.types.message.content.StickerContent - -public inline fun ResendableContent.stickerContentOrThrow(): StickerContent = this as - dev.inmo.tgbotapi.types.message.content.StickerContent - -public inline fun ResendableContent.ifStickerContent(block: (StickerContent) -> T): T? = - stickerContentOrNull() ?.let(block) - -public inline fun ResendableContent.textContentOrNull(): TextContent? = this as? - dev.inmo.tgbotapi.types.message.content.TextContent - -public inline fun ResendableContent.textContentOrThrow(): TextContent = this as - dev.inmo.tgbotapi.types.message.content.TextContent - -public inline fun ResendableContent.ifTextContent(block: (TextContent) -> T): T? = - textContentOrNull() ?.let(block) - -public inline fun ResendableContent.venueContentOrNull(): VenueContent? = this as? - dev.inmo.tgbotapi.types.message.content.VenueContent - -public inline fun ResendableContent.venueContentOrThrow(): VenueContent = this as - dev.inmo.tgbotapi.types.message.content.VenueContent - -public inline fun ResendableContent.ifVenueContent(block: (VenueContent) -> T): T? = - venueContentOrNull() ?.let(block) - -public inline fun ResendableContent.videoContentOrNull(): VideoContent? = this as? - dev.inmo.tgbotapi.types.message.content.VideoContent - -public inline fun ResendableContent.videoContentOrThrow(): VideoContent = this as - dev.inmo.tgbotapi.types.message.content.VideoContent - -public inline fun ResendableContent.ifVideoContent(block: (VideoContent) -> T): T? = - videoContentOrNull() ?.let(block) - -public inline fun ResendableContent.videoNoteContentOrNull(): VideoNoteContent? = this as? - dev.inmo.tgbotapi.types.message.content.VideoNoteContent - -public inline fun ResendableContent.videoNoteContentOrThrow(): VideoNoteContent = this as - dev.inmo.tgbotapi.types.message.content.VideoNoteContent - -public inline fun ResendableContent.ifVideoNoteContent(block: (VideoNoteContent) -> T): T? = - videoNoteContentOrNull() ?.let(block) - -public inline fun ResendableContent.voiceContentOrNull(): VoiceContent? = this as? - dev.inmo.tgbotapi.types.message.content.VoiceContent - -public inline fun ResendableContent.voiceContentOrThrow(): VoiceContent = this as - dev.inmo.tgbotapi.types.message.content.VoiceContent - -public inline fun ResendableContent.ifVoiceContent(block: (VoiceContent) -> T): T? = - voiceContentOrNull() ?.let(block) - -public inline fun TextSource.boldTextSourceOrNull(): BoldTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.BoldTextSource - -public inline fun TextSource.boldTextSourceOrThrow(): BoldTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.BoldTextSource - -public inline fun TextSource.ifBoldTextSource(block: (BoldTextSource) -> T): T? = - boldTextSourceOrNull() ?.let(block) - -public inline fun TextSource.botCommandTextSourceOrNull(): BotCommandTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource - -public inline fun TextSource.botCommandTextSourceOrThrow(): BotCommandTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource - -public inline fun TextSource.ifBotCommandTextSource(block: (BotCommandTextSource) -> T): T? = - botCommandTextSourceOrNull() ?.let(block) - -public inline fun TextSource.cashTagTextSourceOrNull(): CashTagTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.CashTagTextSource - -public inline fun TextSource.cashTagTextSourceOrThrow(): CashTagTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.CashTagTextSource - -public inline fun TextSource.ifCashTagTextSource(block: (CashTagTextSource) -> T): T? = - cashTagTextSourceOrNull() ?.let(block) - -public inline fun TextSource.codeTextSourceOrNull(): CodeTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.CodeTextSource - -public inline fun TextSource.codeTextSourceOrThrow(): CodeTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.CodeTextSource - -public inline fun TextSource.ifCodeTextSource(block: (CodeTextSource) -> T): T? = - codeTextSourceOrNull() ?.let(block) - -public inline fun TextSource.eMailTextSourceOrNull(): EMailTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.EMailTextSource - -public inline fun TextSource.eMailTextSourceOrThrow(): EMailTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.EMailTextSource - -public inline fun TextSource.ifEMailTextSource(block: (EMailTextSource) -> T): T? = - eMailTextSourceOrNull() ?.let(block) - -public inline fun TextSource.hashTagTextSourceOrNull(): HashTagTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource - -public inline fun TextSource.hashTagTextSourceOrThrow(): HashTagTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.HashTagTextSource - -public inline fun TextSource.ifHashTagTextSource(block: (HashTagTextSource) -> T): T? = - hashTagTextSourceOrNull() ?.let(block) - -public inline fun TextSource.italicTextSourceOrNull(): ItalicTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.ItalicTextSource - -public inline fun TextSource.italicTextSourceOrThrow(): ItalicTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.ItalicTextSource - -public inline fun TextSource.ifItalicTextSource(block: (ItalicTextSource) -> T): T? = - italicTextSourceOrNull() ?.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 - -public inline fun TextSource.ifMentionTextSource(block: (MentionTextSource) -> T): T? = - mentionTextSourceOrNull() ?.let(block) - -public inline fun TextSource.phoneNumberTextSourceOrNull(): PhoneNumberTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.PhoneNumberTextSource - -public inline fun TextSource.phoneNumberTextSourceOrThrow(): PhoneNumberTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.PhoneNumberTextSource - -public inline fun TextSource.ifPhoneNumberTextSource(block: (PhoneNumberTextSource) -> T): T? = - phoneNumberTextSourceOrNull() ?.let(block) - -public inline fun TextSource.preTextSourceOrNull(): PreTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.PreTextSource - -public inline fun TextSource.preTextSourceOrThrow(): PreTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.PreTextSource - -public inline fun TextSource.ifPreTextSource(block: (PreTextSource) -> T): T? = - preTextSourceOrNull() ?.let(block) - -public inline fun TextSource.regularTextSourceOrNull(): RegularTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.RegularTextSource - -public inline fun TextSource.regularTextSourceOrThrow(): RegularTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.RegularTextSource - -public inline fun TextSource.ifRegularTextSource(block: (RegularTextSource) -> T): T? = - regularTextSourceOrNull() ?.let(block) - -public inline fun TextSource.spoilerTextSourceOrNull(): SpoilerTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.SpoilerTextSource - -public inline fun TextSource.spoilerTextSourceOrThrow(): SpoilerTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.SpoilerTextSource - -public inline fun TextSource.ifSpoilerTextSource(block: (SpoilerTextSource) -> T): T? = - spoilerTextSourceOrNull() ?.let(block) - -public inline fun TextSource.strikethroughTextSourceOrNull(): StrikethroughTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.StrikethroughTextSource - -public inline fun TextSource.strikethroughTextSourceOrThrow(): StrikethroughTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.StrikethroughTextSource - -public inline fun TextSource.ifStrikethroughTextSource(block: (StrikethroughTextSource) -> T): - T? = strikethroughTextSourceOrNull() ?.let(block) - -public inline fun TextSource.textLinkTextSourceOrNull(): TextLinkTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.TextLinkTextSource - -public inline fun TextSource.textLinkTextSourceOrThrow(): TextLinkTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.TextLinkTextSource - -public inline fun TextSource.ifTextLinkTextSource(block: (TextLinkTextSource) -> T): T? = - textLinkTextSourceOrNull() ?.let(block) - -public inline fun TextSource.textMentionTextSourceOrNull(): TextMentionTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.TextMentionTextSource - -public inline fun TextSource.textMentionTextSourceOrThrow(): TextMentionTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.TextMentionTextSource - -public inline fun TextSource.ifTextMentionTextSource(block: (TextMentionTextSource) -> T): T? = - textMentionTextSourceOrNull() ?.let(block) - -public inline fun TextSource.multilevelTextSourceOrNull(): MultilevelTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.MultilevelTextSource - -public inline fun TextSource.multilevelTextSourceOrThrow(): MultilevelTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.MultilevelTextSource - -public inline fun TextSource.ifMultilevelTextSource(block: (MultilevelTextSource) -> T): T? = - multilevelTextSourceOrNull() ?.let(block) - -public inline fun TextSource.uRLTextSourceOrNull(): URLTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.URLTextSource - -public inline fun TextSource.uRLTextSourceOrThrow(): URLTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.URLTextSource - -public inline fun TextSource.ifURLTextSource(block: (URLTextSource) -> T): T? = - uRLTextSourceOrNull() ?.let(block) - -public inline fun TextSource.underlineTextSourceOrNull(): UnderlineTextSource? = this as? - dev.inmo.tgbotapi.types.message.textsources.UnderlineTextSource - -public inline fun TextSource.underlineTextSourceOrThrow(): UnderlineTextSource = this as - dev.inmo.tgbotapi.types.message.textsources.UnderlineTextSource - -public inline fun TextSource.ifUnderlineTextSource(block: (UnderlineTextSource) -> T): T? = - underlineTextSourceOrNull() ?.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 - -public inline fun - PassportElementError.ifUnknownPassportElementError(block: (UnknownPassportElementError) -> T): - T? = unknownPassportElementErrorOrNull() ?.let(block) - -public inline fun PassportElementError.passportSingleElementErrorOrNull(): - PassportSingleElementError? = this as? - dev.inmo.tgbotapi.types.passport.PassportSingleElementError - -public inline fun PassportElementError.passportSingleElementErrorOrThrow(): - PassportSingleElementError = this as dev.inmo.tgbotapi.types.passport.PassportSingleElementError - -public inline fun - PassportElementError.ifPassportSingleElementError(block: (PassportSingleElementError) -> T): T? - = passportSingleElementErrorOrNull() ?.let(block) - -public inline fun PassportElementError.passportMultipleElementsErrorOrNull(): - PassportMultipleElementsError? = this as? - dev.inmo.tgbotapi.types.passport.PassportMultipleElementsError - -public inline fun PassportElementError.passportMultipleElementsErrorOrThrow(): - PassportMultipleElementsError = this as - dev.inmo.tgbotapi.types.passport.PassportMultipleElementsError - -public inline fun - PassportElementError.ifPassportMultipleElementsError(block: (PassportMultipleElementsError) -> T): - T? = passportMultipleElementsErrorOrNull() ?.let(block) - -public inline fun PassportElementError.passportElementFileErrorOrNull(): PassportElementFileError? = - this as? dev.inmo.tgbotapi.types.passport.PassportElementFileError - -public inline fun PassportElementError.passportElementFileErrorOrThrow(): PassportElementFileError = - this as dev.inmo.tgbotapi.types.passport.PassportElementFileError - -public inline fun - PassportElementError.ifPassportElementFileError(block: (PassportElementFileError) -> T): T? = - passportElementFileErrorOrNull() ?.let(block) - -public inline fun PassportElementError.passportElementFilesErrorOrNull(): PassportElementFilesError? - = this as? dev.inmo.tgbotapi.types.passport.PassportElementFilesError - -public inline fun PassportElementError.passportElementFilesErrorOrThrow(): PassportElementFilesError - = this as dev.inmo.tgbotapi.types.passport.PassportElementFilesError - -public inline fun - PassportElementError.ifPassportElementFilesError(block: (PassportElementFilesError) -> T): T? = - passportElementFilesErrorOrNull() ?.let(block) - -public inline fun PassportElementError.passportElementErrorDataFieldOrNull(): - PassportElementErrorDataField? = this as? - dev.inmo.tgbotapi.types.passport.PassportElementErrorDataField - -public inline fun PassportElementError.passportElementErrorDataFieldOrThrow(): - PassportElementErrorDataField = this as - dev.inmo.tgbotapi.types.passport.PassportElementErrorDataField - -public inline fun - PassportElementError.ifPassportElementErrorDataField(block: (PassportElementErrorDataField) -> T): - T? = passportElementErrorDataFieldOrNull() ?.let(block) - -public inline fun PassportElementError.passportElementErrorFrontSideOrNull(): - PassportElementErrorFrontSide? = this as? - dev.inmo.tgbotapi.types.passport.PassportElementErrorFrontSide - -public inline fun PassportElementError.passportElementErrorFrontSideOrThrow(): - PassportElementErrorFrontSide = this as - dev.inmo.tgbotapi.types.passport.PassportElementErrorFrontSide - -public inline fun - PassportElementError.ifPassportElementErrorFrontSide(block: (PassportElementErrorFrontSide) -> T): - T? = passportElementErrorFrontSideOrNull() ?.let(block) - -public inline fun PassportElementError.passportElementErrorReverseSideOrNull(): - PassportElementErrorReverseSide? = this as? - dev.inmo.tgbotapi.types.passport.PassportElementErrorReverseSide - -public inline fun PassportElementError.passportElementErrorReverseSideOrThrow(): - PassportElementErrorReverseSide = this as - dev.inmo.tgbotapi.types.passport.PassportElementErrorReverseSide - -public inline fun - PassportElementError.ifPassportElementErrorReverseSide(block: (PassportElementErrorReverseSide) -> T): - T? = passportElementErrorReverseSideOrNull() ?.let(block) - -public inline fun PassportElementError.passportElementErrorSelfieOrNull(): - PassportElementErrorSelfie? = this as? - dev.inmo.tgbotapi.types.passport.PassportElementErrorSelfie - -public inline fun PassportElementError.passportElementErrorSelfieOrThrow(): - PassportElementErrorSelfie = this as dev.inmo.tgbotapi.types.passport.PassportElementErrorSelfie - -public inline fun - PassportElementError.ifPassportElementErrorSelfie(block: (PassportElementErrorSelfie) -> T): T? - = passportElementErrorSelfieOrNull() ?.let(block) - -public inline fun PassportElementError.passportElementErrorFileOrNull(): PassportElementErrorFile? = - this as? dev.inmo.tgbotapi.types.passport.PassportElementErrorFile - -public inline fun PassportElementError.passportElementErrorFileOrThrow(): PassportElementErrorFile = - this as dev.inmo.tgbotapi.types.passport.PassportElementErrorFile - -public inline fun - PassportElementError.ifPassportElementErrorFile(block: (PassportElementErrorFile) -> T): T? = - passportElementErrorFileOrNull() ?.let(block) - -public inline fun PassportElementError.passportElementErrorFilesOrNull(): PassportElementErrorFiles? - = this as? dev.inmo.tgbotapi.types.passport.PassportElementErrorFiles - -public inline fun PassportElementError.passportElementErrorFilesOrThrow(): PassportElementErrorFiles - = this as dev.inmo.tgbotapi.types.passport.PassportElementErrorFiles - -public inline fun - PassportElementError.ifPassportElementErrorFiles(block: (PassportElementErrorFiles) -> T): T? = - passportElementErrorFilesOrNull() ?.let(block) - -public inline fun PassportElementError.passportElementErrorTranslationFileOrNull(): - PassportElementErrorTranslationFile? = this as? - dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFile - -public inline fun PassportElementError.passportElementErrorTranslationFileOrThrow(): - PassportElementErrorTranslationFile = this as - dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFile - -public inline fun - PassportElementError.ifPassportElementErrorTranslationFile(block: (PassportElementErrorTranslationFile) -> T): - T? = passportElementErrorTranslationFileOrNull() ?.let(block) - -public inline fun PassportElementError.passportElementErrorTranslationFilesOrNull(): - PassportElementErrorTranslationFiles? = this as? - dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFiles - -public inline fun PassportElementError.passportElementErrorTranslationFilesOrThrow(): - PassportElementErrorTranslationFiles = this as - dev.inmo.tgbotapi.types.passport.PassportElementErrorTranslationFiles - -public inline fun - PassportElementError.ifPassportElementErrorTranslationFiles(block: (PassportElementErrorTranslationFiles) -> T): - T? = passportElementErrorTranslationFilesOrNull() ?.let(block) - -public inline fun PassportElementError.passportElementErrorUnspecifiedOrNull(): - PassportElementErrorUnspecified? = this as? - dev.inmo.tgbotapi.types.passport.PassportElementErrorUnspecified - -public inline fun PassportElementError.passportElementErrorUnspecifiedOrThrow(): - PassportElementErrorUnspecified = this as - dev.inmo.tgbotapi.types.passport.PassportElementErrorUnspecified - -public inline fun - PassportElementError.ifPassportElementErrorUnspecified(block: (PassportElementErrorUnspecified) -> T): - T? = passportElementErrorUnspecifiedOrNull() ?.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 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.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.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.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.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.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.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.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 EncryptedPassportElement.emailOrNull(): Email? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.Email - -public inline fun EncryptedPassportElement.emailOrThrow(): Email = this as - dev.inmo.tgbotapi.types.passport.encrypted.Email - -public inline fun EncryptedPassportElement.ifEmail(block: (Email) -> T): T? = emailOrNull() - ?.let(block) - -public inline fun EncryptedPassportElement.encryptedAddressOrNull(): EncryptedAddress? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.EncryptedAddress - -public inline fun EncryptedPassportElement.encryptedAddressOrThrow(): EncryptedAddress = this as - dev.inmo.tgbotapi.types.passport.encrypted.EncryptedAddress - -public inline fun EncryptedPassportElement.ifEncryptedAddress(block: (EncryptedAddress) -> T): - T? = encryptedAddressOrNull() ?.let(block) - -public inline - fun EncryptedPassportElement.encryptedPassportElementWithTranslatableFilesCollectionOrNull(): - EncryptedPassportElementWithTranslatableFilesCollection? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableFilesCollection - -public inline - fun EncryptedPassportElement.encryptedPassportElementWithTranslatableFilesCollectionOrThrow(): - EncryptedPassportElementWithTranslatableFilesCollection = this as - dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableFilesCollection - -public inline fun - EncryptedPassportElement.ifEncryptedPassportElementWithTranslatableFilesCollection(block: (EncryptedPassportElementWithTranslatableFilesCollection) -> T): - T? = encryptedPassportElementWithTranslatableFilesCollectionOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.utilityBillOrNull(): UtilityBill? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.UtilityBill - -public inline fun EncryptedPassportElement.utilityBillOrThrow(): UtilityBill = this as - dev.inmo.tgbotapi.types.passport.encrypted.UtilityBill - -public inline fun EncryptedPassportElement.ifUtilityBill(block: (UtilityBill) -> T): T? = - utilityBillOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.bankStatementOrNull(): BankStatement? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.BankStatement - -public inline fun EncryptedPassportElement.bankStatementOrThrow(): BankStatement = this as - dev.inmo.tgbotapi.types.passport.encrypted.BankStatement - -public inline fun EncryptedPassportElement.ifBankStatement(block: (BankStatement) -> T): T? = - bankStatementOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.rentalAgreementOrNull(): RentalAgreement? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.RentalAgreement - -public inline fun EncryptedPassportElement.rentalAgreementOrThrow(): RentalAgreement = this as - dev.inmo.tgbotapi.types.passport.encrypted.RentalAgreement - -public inline fun EncryptedPassportElement.ifRentalAgreement(block: (RentalAgreement) -> T): T? - = rentalAgreementOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.passportRegistrationOrNull(): PassportRegistration? = - this as? dev.inmo.tgbotapi.types.passport.encrypted.PassportRegistration - -public inline fun EncryptedPassportElement.passportRegistrationOrThrow(): PassportRegistration = - this as dev.inmo.tgbotapi.types.passport.encrypted.PassportRegistration - -public inline fun - EncryptedPassportElement.ifPassportRegistration(block: (PassportRegistration) -> T): T? = - passportRegistrationOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.temporaryRegistrationOrNull(): TemporaryRegistration? = - this as? dev.inmo.tgbotapi.types.passport.encrypted.TemporaryRegistration - -public inline fun EncryptedPassportElement.temporaryRegistrationOrThrow(): TemporaryRegistration = - this as dev.inmo.tgbotapi.types.passport.encrypted.TemporaryRegistration - -public inline fun - EncryptedPassportElement.ifTemporaryRegistration(block: (TemporaryRegistration) -> T): T? = - temporaryRegistrationOrNull() ?.let(block) - -public inline - fun EncryptedPassportElement.encryptedPassportElementWithTranslatableIDDocumentOrNull(): - EncryptedPassportElementWithTranslatableIDDocument? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableIDDocument - -public inline - fun EncryptedPassportElement.encryptedPassportElementWithTranslatableIDDocumentOrThrow(): - EncryptedPassportElementWithTranslatableIDDocument = this as - dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableIDDocument - -public inline fun - EncryptedPassportElement.ifEncryptedPassportElementWithTranslatableIDDocument(block: (EncryptedPassportElementWithTranslatableIDDocument) -> T): - T? = encryptedPassportElementWithTranslatableIDDocumentOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.driverLicenseOrNull(): DriverLicense? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.DriverLicense - -public inline fun EncryptedPassportElement.driverLicenseOrThrow(): DriverLicense = this as - dev.inmo.tgbotapi.types.passport.encrypted.DriverLicense - -public inline fun EncryptedPassportElement.ifDriverLicense(block: (DriverLicense) -> T): T? = - driverLicenseOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.identityCardOrNull(): IdentityCard? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.IdentityCard - -public inline fun EncryptedPassportElement.identityCardOrThrow(): IdentityCard = this as - dev.inmo.tgbotapi.types.passport.encrypted.IdentityCard - -public inline fun EncryptedPassportElement.ifIdentityCard(block: (IdentityCard) -> T): T? = - identityCardOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.encryptedPersonalDetailsOrNull(): - EncryptedPersonalDetails? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPersonalDetails - -public inline fun EncryptedPassportElement.encryptedPersonalDetailsOrThrow(): - EncryptedPersonalDetails = this as - dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPersonalDetails - -public inline fun - EncryptedPassportElement.ifEncryptedPersonalDetails(block: (EncryptedPersonalDetails) -> T): T? - = encryptedPersonalDetailsOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.passportOrNull(): Passport? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.Passport - -public inline fun EncryptedPassportElement.passportOrThrow(): Passport = this as - dev.inmo.tgbotapi.types.passport.encrypted.Passport - -public inline fun EncryptedPassportElement.ifPassport(block: (Passport) -> T): T? = - passportOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.commonPassportOrNull(): CommonPassport? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.CommonPassport - -public inline fun EncryptedPassportElement.commonPassportOrThrow(): CommonPassport = this as - dev.inmo.tgbotapi.types.passport.encrypted.CommonPassport - -public inline fun EncryptedPassportElement.ifCommonPassport(block: (CommonPassport) -> T): T? = - commonPassportOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.internalPassportOrNull(): InternalPassport? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.InternalPassport - -public inline fun EncryptedPassportElement.internalPassportOrThrow(): InternalPassport = this as - dev.inmo.tgbotapi.types.passport.encrypted.InternalPassport - -public inline fun EncryptedPassportElement.ifInternalPassport(block: (InternalPassport) -> T): - T? = internalPassportOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.phoneNumberOrNull(): PhoneNumber? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.PhoneNumber - -public inline fun EncryptedPassportElement.phoneNumberOrThrow(): PhoneNumber = this as - dev.inmo.tgbotapi.types.passport.encrypted.PhoneNumber - -public inline fun EncryptedPassportElement.ifPhoneNumber(block: (PhoneNumber) -> T): T? = - phoneNumberOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.unknownEncryptedPassportElementOrNull(): - UnknownEncryptedPassportElement? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.UnknownEncryptedPassportElement - -public inline fun EncryptedPassportElement.unknownEncryptedPassportElementOrThrow(): - UnknownEncryptedPassportElement = this as - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.UnknownEncryptedPassportElement - -public inline fun - EncryptedPassportElement.ifUnknownEncryptedPassportElement(block: (UnknownEncryptedPassportElement) -> T): - T? = unknownEncryptedPassportElementOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.encryptedPassportElementTranslatableOrNull(): - EncryptedPassportElementTranslatable? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementTranslatable - -public inline fun EncryptedPassportElement.encryptedPassportElementTranslatableOrThrow(): - EncryptedPassportElementTranslatable = this as - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementTranslatable - -public inline fun - EncryptedPassportElement.ifEncryptedPassportElementTranslatable(block: (EncryptedPassportElementTranslatable) -> T): - T? = encryptedPassportElementTranslatableOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.encryptedPassportElementWithDataOrNull(): - EncryptedPassportElementWithData? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithData - -public inline fun EncryptedPassportElement.encryptedPassportElementWithDataOrThrow(): - EncryptedPassportElementWithData = this as - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithData - -public inline fun - EncryptedPassportElement.ifEncryptedPassportElementWithData(block: (EncryptedPassportElementWithData) -> T): - T? = encryptedPassportElementWithDataOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.encryptedPassportElementWithEmailOrNull(): - EncryptedPassportElementWithEmail? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithEmail - -public inline fun EncryptedPassportElement.encryptedPassportElementWithEmailOrThrow(): - EncryptedPassportElementWithEmail = this as - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithEmail - -public inline fun - EncryptedPassportElement.ifEncryptedPassportElementWithEmail(block: (EncryptedPassportElementWithEmail) -> T): - T? = encryptedPassportElementWithEmailOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.encryptedPassportElementWithFilesCollectionOrNull(): - EncryptedPassportElementWithFilesCollection? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFilesCollection - -public inline fun EncryptedPassportElement.encryptedPassportElementWithFilesCollectionOrThrow(): - EncryptedPassportElementWithFilesCollection = this as - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFilesCollection - -public inline fun - EncryptedPassportElement.ifEncryptedPassportElementWithFilesCollection(block: (EncryptedPassportElementWithFilesCollection) -> T): - T? = encryptedPassportElementWithFilesCollectionOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.encryptedPassportElementWithFrontSideOrNull(): - EncryptedPassportElementWithFrontSide? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFrontSide - -public inline fun EncryptedPassportElement.encryptedPassportElementWithFrontSideOrThrow(): - EncryptedPassportElementWithFrontSide = this as - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFrontSide - -public inline fun - EncryptedPassportElement.ifEncryptedPassportElementWithFrontSide(block: (EncryptedPassportElementWithFrontSide) -> T): - T? = encryptedPassportElementWithFrontSideOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.encryptedPassportElementWithPhoneNumberOrNull(): - EncryptedPassportElementWithPhoneNumber? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithPhoneNumber - -public inline fun EncryptedPassportElement.encryptedPassportElementWithPhoneNumberOrThrow(): - EncryptedPassportElementWithPhoneNumber = this as - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithPhoneNumber - -public inline fun - EncryptedPassportElement.ifEncryptedPassportElementWithPhoneNumber(block: (EncryptedPassportElementWithPhoneNumber) -> T): - T? = encryptedPassportElementWithPhoneNumberOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.encryptedPassportElementWithReverseSideOrNull(): - EncryptedPassportElementWithReverseSide? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithReverseSide - -public inline fun EncryptedPassportElement.encryptedPassportElementWithReverseSideOrThrow(): - EncryptedPassportElementWithReverseSide = this as - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithReverseSide - -public inline fun - EncryptedPassportElement.ifEncryptedPassportElementWithReverseSide(block: (EncryptedPassportElementWithReverseSide) -> T): - T? = encryptedPassportElementWithReverseSideOrNull() ?.let(block) - -public inline fun EncryptedPassportElement.encryptedPassportElementWithSelfieOrNull(): - EncryptedPassportElementWithSelfie? = this as? - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithSelfie - -public inline fun EncryptedPassportElement.encryptedPassportElementWithSelfieOrThrow(): - EncryptedPassportElementWithSelfie = this as - dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithSelfie - -public inline fun - EncryptedPassportElement.ifEncryptedPassportElementWithSelfie(block: (EncryptedPassportElementWithSelfie) -> T): - T? = encryptedPassportElementWithSelfieOrNull() ?.let(block) - -public inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrNull(): ExactScheduledCloseInfo? = - this as? dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo - -public inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrThrow(): ExactScheduledCloseInfo = - this as dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo - -public inline fun - ScheduledCloseInfo.ifExactScheduledCloseInfo(block: (ExactScheduledCloseInfo) -> T): T? = - exactScheduledCloseInfoOrNull() ?.let(block) - -public inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrNull(): - ApproximateScheduledCloseInfo? = this as? - dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo - -public inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrThrow(): - ApproximateScheduledCloseInfo = this as - dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo - -public inline fun - ScheduledCloseInfo.ifApproximateScheduledCloseInfo(block: (ApproximateScheduledCloseInfo) -> T): - T? = approximateScheduledCloseInfoOrNull() ?.let(block) - -public inline fun Poll.multipleAnswersPollOrNull(): MultipleAnswersPoll? = this as? - dev.inmo.tgbotapi.types.polls.MultipleAnswersPoll - -public inline fun Poll.multipleAnswersPollOrThrow(): MultipleAnswersPoll = this as - dev.inmo.tgbotapi.types.polls.MultipleAnswersPoll - -public inline fun Poll.ifMultipleAnswersPoll(block: (MultipleAnswersPoll) -> T): T? = - multipleAnswersPollOrNull() ?.let(block) - -public inline fun Poll.unknownPollTypeOrNull(): UnknownPollType? = this as? - dev.inmo.tgbotapi.types.polls.UnknownPollType - -public inline fun Poll.unknownPollTypeOrThrow(): UnknownPollType = this as - dev.inmo.tgbotapi.types.polls.UnknownPollType - -public inline fun Poll.ifUnknownPollType(block: (UnknownPollType) -> T): T? = - unknownPollTypeOrNull() ?.let(block) - -public inline fun Poll.regularPollOrNull(): RegularPoll? = this as? - dev.inmo.tgbotapi.types.polls.RegularPoll - -public inline fun Poll.regularPollOrThrow(): RegularPoll = this as - dev.inmo.tgbotapi.types.polls.RegularPoll - -public inline fun Poll.ifRegularPoll(block: (RegularPoll) -> T): T? = regularPollOrNull() - ?.let(block) - -public inline fun Poll.quizPollOrNull(): QuizPoll? = this as? dev.inmo.tgbotapi.types.polls.QuizPoll - -public inline fun Poll.quizPollOrThrow(): QuizPoll = this as dev.inmo.tgbotapi.types.polls.QuizPoll - -public inline fun Poll.ifQuizPoll(block: (QuizPoll) -> T): T? = quizPollOrNull() ?.let(block) - -public inline fun Update.callbackQueryUpdateOrNull(): CallbackQueryUpdate? = this as? - dev.inmo.tgbotapi.types.update.CallbackQueryUpdate - -public inline fun Update.callbackQueryUpdateOrThrow(): CallbackQueryUpdate = this as - dev.inmo.tgbotapi.types.update.CallbackQueryUpdate - -public inline fun Update.ifCallbackQueryUpdate(block: (CallbackQueryUpdate) -> T): T? = - callbackQueryUpdateOrNull() ?.let(block) - -public inline fun Update.channelPostUpdateOrNull(): ChannelPostUpdate? = this as? - dev.inmo.tgbotapi.types.update.ChannelPostUpdate - -public inline fun Update.channelPostUpdateOrThrow(): ChannelPostUpdate = this as - dev.inmo.tgbotapi.types.update.ChannelPostUpdate - -public inline fun Update.ifChannelPostUpdate(block: (ChannelPostUpdate) -> T): T? = - channelPostUpdateOrNull() ?.let(block) - -public inline fun Update.chatJoinRequestUpdateOrNull(): ChatJoinRequestUpdate? = this as? - dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate - -public inline fun Update.chatJoinRequestUpdateOrThrow(): ChatJoinRequestUpdate = this as - dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate - -public inline fun Update.ifChatJoinRequestUpdate(block: (ChatJoinRequestUpdate) -> T): T? = - chatJoinRequestUpdateOrNull() ?.let(block) - -public inline fun Update.chosenInlineResultUpdateOrNull(): ChosenInlineResultUpdate? = this as? - dev.inmo.tgbotapi.types.update.ChosenInlineResultUpdate - -public inline fun Update.chosenInlineResultUpdateOrThrow(): ChosenInlineResultUpdate = this as - dev.inmo.tgbotapi.types.update.ChosenInlineResultUpdate - -public inline fun Update.ifChosenInlineResultUpdate(block: (ChosenInlineResultUpdate) -> T): T? - = chosenInlineResultUpdateOrNull() ?.let(block) - -public inline fun Update.commonChatMemberUpdatedUpdateOrNull(): CommonChatMemberUpdatedUpdate? = - this as? dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate - -public inline fun Update.commonChatMemberUpdatedUpdateOrThrow(): CommonChatMemberUpdatedUpdate = - this as dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate - -public inline fun - Update.ifCommonChatMemberUpdatedUpdate(block: (CommonChatMemberUpdatedUpdate) -> T): T? = - commonChatMemberUpdatedUpdateOrNull() ?.let(block) - -public inline fun Update.editChannelPostUpdateOrNull(): EditChannelPostUpdate? = this as? - dev.inmo.tgbotapi.types.update.EditChannelPostUpdate - -public inline fun Update.editChannelPostUpdateOrThrow(): EditChannelPostUpdate = this as - dev.inmo.tgbotapi.types.update.EditChannelPostUpdate - -public inline fun Update.ifEditChannelPostUpdate(block: (EditChannelPostUpdate) -> T): T? = - editChannelPostUpdateOrNull() ?.let(block) - -public inline fun Update.editMessageUpdateOrNull(): EditMessageUpdate? = this as? - dev.inmo.tgbotapi.types.update.EditMessageUpdate - -public inline fun Update.editMessageUpdateOrThrow(): EditMessageUpdate = this as - dev.inmo.tgbotapi.types.update.EditMessageUpdate - -public inline fun Update.ifEditMessageUpdate(block: (EditMessageUpdate) -> T): T? = - editMessageUpdateOrNull() ?.let(block) - -public inline fun Update.inlineQueryUpdateOrNull(): InlineQueryUpdate? = this as? - dev.inmo.tgbotapi.types.update.InlineQueryUpdate - -public inline fun Update.inlineQueryUpdateOrThrow(): InlineQueryUpdate = this as - dev.inmo.tgbotapi.types.update.InlineQueryUpdate - -public inline fun Update.ifInlineQueryUpdate(block: (InlineQueryUpdate) -> T): T? = - inlineQueryUpdateOrNull() ?.let(block) - -public inline fun Update.messageUpdateOrNull(): MessageUpdate? = this as? - dev.inmo.tgbotapi.types.update.MessageUpdate - -public inline fun Update.messageUpdateOrThrow(): MessageUpdate = this as - dev.inmo.tgbotapi.types.update.MessageUpdate - -public inline fun Update.ifMessageUpdate(block: (MessageUpdate) -> T): T? = - messageUpdateOrNull() ?.let(block) - -public inline fun Update.myChatMemberUpdatedUpdateOrNull(): MyChatMemberUpdatedUpdate? = this as? - dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate - -public inline fun Update.myChatMemberUpdatedUpdateOrThrow(): MyChatMemberUpdatedUpdate = this as - dev.inmo.tgbotapi.types.update.MyChatMemberUpdatedUpdate - -public inline fun Update.ifMyChatMemberUpdatedUpdate(block: (MyChatMemberUpdatedUpdate) -> T): - T? = myChatMemberUpdatedUpdateOrNull() ?.let(block) - -public inline fun Update.pollAnswerUpdateOrNull(): PollAnswerUpdate? = this as? - dev.inmo.tgbotapi.types.update.PollAnswerUpdate - -public inline fun Update.pollAnswerUpdateOrThrow(): PollAnswerUpdate = this as - dev.inmo.tgbotapi.types.update.PollAnswerUpdate - -public inline fun Update.ifPollAnswerUpdate(block: (PollAnswerUpdate) -> T): T? = - pollAnswerUpdateOrNull() ?.let(block) - -public inline fun Update.pollUpdateOrNull(): PollUpdate? = this as? - dev.inmo.tgbotapi.types.update.PollUpdate - -public inline fun Update.pollUpdateOrThrow(): PollUpdate = this as - dev.inmo.tgbotapi.types.update.PollUpdate - -public inline fun Update.ifPollUpdate(block: (PollUpdate) -> T): T? = pollUpdateOrNull() - ?.let(block) - -public inline fun Update.preCheckoutQueryUpdateOrNull(): PreCheckoutQueryUpdate? = this as? - dev.inmo.tgbotapi.types.update.PreCheckoutQueryUpdate - -public inline fun Update.preCheckoutQueryUpdateOrThrow(): PreCheckoutQueryUpdate = this as - dev.inmo.tgbotapi.types.update.PreCheckoutQueryUpdate - -public inline fun Update.ifPreCheckoutQueryUpdate(block: (PreCheckoutQueryUpdate) -> T): T? = - preCheckoutQueryUpdateOrNull() ?.let(block) - -public inline fun Update.shippingQueryUpdateOrNull(): ShippingQueryUpdate? = this as? - dev.inmo.tgbotapi.types.update.ShippingQueryUpdate - -public inline fun Update.shippingQueryUpdateOrThrow(): ShippingQueryUpdate = this as - dev.inmo.tgbotapi.types.update.ShippingQueryUpdate - -public inline fun Update.ifShippingQueryUpdate(block: (ShippingQueryUpdate) -> T): T? = - shippingQueryUpdateOrNull() ?.let(block) - -public inline fun Update.baseEditMessageUpdateOrNull(): BaseEditMessageUpdate? = this as? - dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate - -public inline fun Update.baseEditMessageUpdateOrThrow(): BaseEditMessageUpdate = this as - dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate - -public inline fun Update.ifBaseEditMessageUpdate(block: (BaseEditMessageUpdate) -> T): T? = - baseEditMessageUpdateOrNull() ?.let(block) - -public inline fun Update.baseMessageUpdateOrNull(): BaseMessageUpdate? = this as? - dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate - -public inline fun Update.baseMessageUpdateOrThrow(): BaseMessageUpdate = this as - dev.inmo.tgbotapi.types.update.abstracts.BaseMessageUpdate - -public inline fun Update.ifBaseMessageUpdate(block: (BaseMessageUpdate) -> T): T? = - baseMessageUpdateOrNull() ?.let(block) - -public inline fun Update.baseSentMessageUpdateOrNull(): BaseSentMessageUpdate? = this as? - dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate - -public inline fun Update.baseSentMessageUpdateOrThrow(): BaseSentMessageUpdate = this as - dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate - -public inline fun Update.ifBaseSentMessageUpdate(block: (BaseSentMessageUpdate) -> T): T? = - baseSentMessageUpdateOrNull() ?.let(block) - -public inline fun Update.chatMemberUpdatedUpdateOrNull(): ChatMemberUpdatedUpdate? = this as? - dev.inmo.tgbotapi.types.update.abstracts.ChatMemberUpdatedUpdate - -public inline fun Update.chatMemberUpdatedUpdateOrThrow(): ChatMemberUpdatedUpdate = this as - dev.inmo.tgbotapi.types.update.abstracts.ChatMemberUpdatedUpdate - -public inline fun Update.ifChatMemberUpdatedUpdate(block: (ChatMemberUpdatedUpdate) -> T): T? = - chatMemberUpdatedUpdateOrNull() ?.let(block) - -public inline fun Update.unknownUpdateOrNull(): UnknownUpdate? = this as? - dev.inmo.tgbotapi.types.update.abstracts.UnknownUpdate - -public inline fun Update.unknownUpdateOrThrow(): UnknownUpdate = this as - dev.inmo.tgbotapi.types.update.abstracts.UnknownUpdate - -public inline fun Update.ifUnknownUpdate(block: (UnknownUpdate) -> T): T? = - unknownUpdateOrNull() ?.let(block) - -public inline fun Update.channelPostMediaGroupUpdateOrNull(): ChannelPostMediaGroupUpdate? = this - as? dev.inmo.tgbotapi.types.update.media_group.ChannelPostMediaGroupUpdate - -public inline fun Update.channelPostMediaGroupUpdateOrThrow(): ChannelPostMediaGroupUpdate = this as - dev.inmo.tgbotapi.types.update.media_group.ChannelPostMediaGroupUpdate - -public inline fun - Update.ifChannelPostMediaGroupUpdate(block: (ChannelPostMediaGroupUpdate) -> T): T? = - channelPostMediaGroupUpdateOrNull() ?.let(block) - -public inline fun Update.editChannelPostMediaGroupUpdateOrNull(): EditChannelPostMediaGroupUpdate? = - this as? dev.inmo.tgbotapi.types.update.media_group.EditChannelPostMediaGroupUpdate - -public inline fun Update.editChannelPostMediaGroupUpdateOrThrow(): EditChannelPostMediaGroupUpdate = - this as dev.inmo.tgbotapi.types.update.media_group.EditChannelPostMediaGroupUpdate - -public inline fun - Update.ifEditChannelPostMediaGroupUpdate(block: (EditChannelPostMediaGroupUpdate) -> T): T? = - editChannelPostMediaGroupUpdateOrNull() ?.let(block) - -public inline fun Update.editMessageMediaGroupUpdateOrNull(): EditMessageMediaGroupUpdate? = this - as? dev.inmo.tgbotapi.types.update.media_group.EditMessageMediaGroupUpdate - -public inline fun Update.editMessageMediaGroupUpdateOrThrow(): EditMessageMediaGroupUpdate = this as - dev.inmo.tgbotapi.types.update.media_group.EditMessageMediaGroupUpdate - -public inline fun - Update.ifEditMessageMediaGroupUpdate(block: (EditMessageMediaGroupUpdate) -> T): T? = - editMessageMediaGroupUpdateOrNull() ?.let(block) - -public inline fun Update.mediaGroupUpdateOrNull(): MediaGroupUpdate? = this as? - dev.inmo.tgbotapi.types.update.media_group.MediaGroupUpdate - -public inline fun Update.mediaGroupUpdateOrThrow(): MediaGroupUpdate = this as - dev.inmo.tgbotapi.types.update.media_group.MediaGroupUpdate - -public inline fun Update.ifMediaGroupUpdate(block: (MediaGroupUpdate) -> T): T? = - mediaGroupUpdateOrNull() ?.let(block) - -public inline fun Update.sentMediaGroupUpdateOrNull(): SentMediaGroupUpdate? = this as? - dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate - -public inline fun Update.sentMediaGroupUpdateOrThrow(): SentMediaGroupUpdate = this as - dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate - -public inline fun Update.ifSentMediaGroupUpdate(block: (SentMediaGroupUpdate) -> T): T? = - sentMediaGroupUpdateOrNull() ?.let(block) - -public inline fun Update.editMediaGroupUpdateOrNull(): EditMediaGroupUpdate? = this as? - dev.inmo.tgbotapi.types.update.media_group.EditMediaGroupUpdate - -public inline fun Update.editMediaGroupUpdateOrThrow(): EditMediaGroupUpdate = this as - dev.inmo.tgbotapi.types.update.media_group.EditMediaGroupUpdate - -public inline fun Update.ifEditMediaGroupUpdate(block: (EditMediaGroupUpdate) -> T): T? = - editMediaGroupUpdateOrNull() ?.let(block) - -public inline fun Update.messageMediaGroupUpdateOrNull(): MessageMediaGroupUpdate? = this as? - dev.inmo.tgbotapi.types.update.media_group.MessageMediaGroupUpdate - -public inline fun Update.messageMediaGroupUpdateOrThrow(): MessageMediaGroupUpdate = this as - dev.inmo.tgbotapi.types.update.media_group.MessageMediaGroupUpdate - -public inline fun Update.ifMessageMediaGroupUpdate(block: (MessageMediaGroupUpdate) -> T): T? = - messageMediaGroupUpdateOrNull() ?.let(block) From 6a06775bc42983cee91588b5bf515b768526237a Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 5 Aug 2022 18:57:50 +0600 Subject: [PATCH 14/17] add file annotations generation to the class casts --- .../src/main/kotlin/TelegramBotAPISymbolProcessor.kt | 12 ++++++++++++ .../inmo/tgbotapi/extensions/utils/ClassCastsNew.kt | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/tgbotapi.ksp/processor/src/main/kotlin/TelegramBotAPISymbolProcessor.kt b/tgbotapi.ksp/processor/src/main/kotlin/TelegramBotAPISymbolProcessor.kt index 9583317566..7fdf0f635c 100644 --- a/tgbotapi.ksp/processor/src/main/kotlin/TelegramBotAPISymbolProcessor.kt +++ b/tgbotapi.ksp/processor/src/main/kotlin/TelegramBotAPISymbolProcessor.kt @@ -4,6 +4,7 @@ import com.google.devtools.ksp.getAllSuperTypes import com.google.devtools.ksp.processing.* import com.google.devtools.ksp.symbol.KSAnnotated import com.google.devtools.ksp.symbol.KSClassDeclaration +import com.squareup.kotlinpoet.AnnotationSpec import com.squareup.kotlinpoet.FileSpec import com.squareup.kotlinpoet.ksp.writeTo import dev.inmo.tgbotapi.ksp.lib.ClassCastsIncluded @@ -43,6 +44,17 @@ class TelegramBotAPISymbolProcessor( targetPackage, outputFile ).apply { + addAnnotation( + AnnotationSpec.builder(Suppress::class).apply { + addMember("\"unused\"") + addMember("\"RemoveRedundantQualifierName\"") + addMember("\"RedundantVisibilityModifier\"") + addMember("\"NOTHING_TO_INLINE\"") + addMember("\"UNCHECKED_CAST\"") + addMember("\"OPT_IN_USAGE\"") + useSiteTarget(AnnotationSpec.UseSiteTarget.FILE) + }.build() + ) classes.forEach { fill( it, 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 9547763e56..c7c17929cb 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 @@ -1,3 +1,12 @@ +@file:Suppress( + "unused", + "RemoveRedundantQualifierName", + "RedundantVisibilityModifier", + "NOTHING_TO_INLINE", + "UNCHECKED_CAST", + "OPT_IN_USAGE", +) + package dev.inmo.tgbotapi.extensions.utils import dev.inmo.tgbotapi.abstracts.CommonSendInvoiceData @@ -410,6 +419,7 @@ import dev.inmo.tgbotapi.types.update.media_group.EditMessageMediaGroupUpdate import dev.inmo.tgbotapi.types.update.media_group.MediaGroupUpdate import dev.inmo.tgbotapi.types.update.media_group.MessageMediaGroupUpdate import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate +import kotlin.Suppress public inline fun CommonSendInvoiceData.createInvoiceLinkOrNull(): CreateInvoiceLink? = this as? dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink From ec487081959f2db6411ba412c339ff1760c157f9 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 5 Aug 2022 21:27:45 +0600 Subject: [PATCH 15/17] start to fill changelog --- CHANGELOG.md | 17 +++++++++++++---- tgbotapi.ksp/lib/build.gradle | 1 - 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3595948b27..9531424bdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,21 @@ ## 3.0.0 +* `Versions`: + * `Kotlin`: `1.6.21` -> `1.7.10` + * `Serialization`: `1.3.3` -> `1.4.0-RC` + * `Korlibs`: `2.7.0` -> `3.0.0` + * `UUID`: `0.4.1` -> `0.5.0` + * `MicroUtils`: `0.11.13` -> `0.12.0` +* `Core`: + * Interface `ReplyMakrup` has been renamed to `WithReplyMarkup` to correspond its purpose +* `API`: + * Add new `Flow`-based live locations API +* `Utils`: + * **BREAKING CHANGES** Now all new classcasts (like `Chat.ifPrivateChat` etc.) have been rewritten to be generated with `ksp` and `kotlin poet` + ## 2.2.2 -* `Core`: - * Interface `ReplyMakrup` has been renamed to `WithReplyMarkup` to correspond its purpose -* `API`: - * New API (`handleLiveLocation`) for live location streaming using `Flow` * `Utils`: * `buildEntities` now is inline * `Behaviour Builder`: diff --git a/tgbotapi.ksp/lib/build.gradle b/tgbotapi.ksp/lib/build.gradle index 05a6c36bde..3048b631e0 100644 --- a/tgbotapi.ksp/lib/build.gradle +++ b/tgbotapi.ksp/lib/build.gradle @@ -5,4 +5,3 @@ plugins { project.description = "Class Casts generator KSP library to include into your library" apply from: "$mppProjectWithSerializationPresetPath" -apply from: "$publishGradlePath" From 3823b03453b92bf4bd20bc26976c0f36b7681971 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 5 Aug 2022 21:43:15 +0600 Subject: [PATCH 16/17] fixes --- CHANGELOG.md | 13 +++++++++++++ .../tgbotapi/utils/internal/ClassCastsIncluded.kt | 3 --- 2 files changed, 13 insertions(+), 3 deletions(-) delete mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/ClassCastsIncluded.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 9531424bdc..08eae08ea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 3.0.0 +**ALL OLD DEPRECATIONS HAVE BEEN REMOVED** + +**`copyMessage` HAVE CHANGED THEIR SIGNATURE BY SWAPPING FROM AND TO CHAT IDS** + * `Versions`: * `Kotlin`: `1.6.21` -> `1.7.10` * `Serialization`: `1.3.3` -> `1.4.0-RC` @@ -10,8 +14,17 @@ * `MicroUtils`: `0.11.13` -> `0.12.0` * `Core`: * Interface `ReplyMakrup` has been renamed to `WithReplyMarkup` to correspond its purpose + * Data class `LeftChatMember` has been renamed to `LeftChatMemberEvent` to avoid type ambiguite with the other `LeftChatMember` + * `ForwardInfo` hierarchy has been fully reworked: + * `AnonymousForwardInfo` -> `ForwardInfo.ByAnonymous` + * `UserForwardInfo` -> `ForwardInfo.ByUser` + * `ForwardFromPublicChatInfo` -> `ForwardInfo.PublicChat` + * `ForwardFromChannelInfo` -> `ForwardInfo.PublicChat.FromChannel` + * `ForwardFromSupergroupInfo` -> `ForwardInfo.PublicChat.FromSupergroup` + * `ForwardInfo.PublicChat.SentByChannel` ___has been created___ * `API`: * Add new `Flow`-based live locations API + * Add `sendLocation` for sending live locations * `Utils`: * **BREAKING CHANGES** Now all new classcasts (like `Chat.ifPrivateChat` etc.) have been rewritten to be generated with `ksp` and `kotlin poet` diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/ClassCastsIncluded.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/ClassCastsIncluded.kt deleted file mode 100644 index cc46caee80..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/ClassCastsIncluded.kt +++ /dev/null @@ -1,3 +0,0 @@ -package dev.inmo.tgbotapi.utils.internal - -import dev.inmo.tgbotapi.utils.RiskFeature From 44838a2088286923f680e7079782aa0db6b0089b Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 5 Aug 2022 21:44:36 +0600 Subject: [PATCH 17/17] optimize imports in behaviour builder common --- .../behaviour_builder/BehaviourBuilders.kt | 1 - .../extensions/behaviour_builder/TelegramBot.kt | 2 +- .../expectations/WaitCallbackQuery.kt | 2 -- .../expectations/WaitChatJoinRequest.kt | 2 -- .../expectations/WaitChatMemberUpdated.kt | 2 -- .../behaviour_builder/expectations/WaitContent.kt | 9 --------- .../expectations/WaitContentMessage.kt | 8 +------- .../expectations/WaitEditedContent.kt | 14 ++------------ .../expectations/WaitEditedContentMessage.kt | 7 ------- .../expectations/WaitEventAction.kt | 3 --- .../expectations/WaitEventActionMessages.kt | 5 +---- .../expectations/WaitInlineQuery.kt | 2 -- .../expectations/WaitMediaGroup.kt | 6 ------ .../expectations/WaitMediaGroupMessages.kt | 5 ----- .../expectations/WaitPassportData.kt | 2 -- .../expectations/WaitPollAnswers.kt | 4 ---- .../expectations/WaitPollUpdates.kt | 2 -- .../expectations/WaitPreCheckoutQuery.kt | 4 ---- .../filters/MessageFilterByChat.kt | 4 ++-- .../triggers_handling/CallbackQueryTriggers.kt | 3 ++- .../triggers_handling/CommandHandling.kt | 1 - .../triggers_handling/ContentTriggers.kt | 5 +---- .../triggers_handling/EditedContentTriggers.kt | 6 ------ .../triggers_handling/MainTrigger.kt | 2 +- .../behaviour_builder/utils/LiveLocation.kt | 1 - .../utils/marker_factories/QueryMarkerFactories.kt | 2 +- 26 files changed, 12 insertions(+), 92 deletions(-) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuilders.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuilders.kt index 0210ab3de7..8a8e0f91e6 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuilders.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuilders.kt @@ -6,7 +6,6 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.longPolling import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter -import dev.inmo.tgbotapi.utils.PreviewFeature import kotlinx.coroutines.* /** diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBot.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBot.kt index b49e812220..19b06325c4 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBot.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBot.kt @@ -1,9 +1,9 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder import dev.inmo.micro_utils.coroutines.ExceptionHandler +import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.ktor.KtorRequestsExecutorBuilder import dev.inmo.tgbotapi.bot.ktor.telegramBot -import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQuery.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQuery.kt index 21f7a5b278..7be3ea5ee1 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQuery.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitCallbackQuery.kt @@ -3,14 +3,12 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.utils.callbackQueryUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.queries.callback.* import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.toList typealias CallbackQueryMapper = suspend T.() -> T? diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChatJoinRequest.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChatJoinRequest.kt index a7ccf06d3a..9f1dd58b85 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChatJoinRequest.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChatJoinRequest.kt @@ -1,14 +1,12 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.utils.chatJoinRequestUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.chat.ChatJoinRequest import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.toList typealias ChatJoinRequestsMapper = suspend ChatJoinRequest.() -> ChatJoinRequest? diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChatMemberUpdated.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChatMemberUpdated.kt index 4f75e36f59..e7b205e56d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChatMemberUpdated.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitChatMemberUpdated.kt @@ -1,7 +1,6 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated import dev.inmo.tgbotapi.types.update.CommonChatMemberUpdatedUpdate @@ -10,7 +9,6 @@ import dev.inmo.tgbotapi.types.update.abstracts.ChatMemberUpdatedUpdate import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.toList typealias ChatMemberUpdatedMapper = suspend T.() -> T? diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContent.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContent.kt index 01f9ce1acd..91bce4c17e 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContent.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContent.kt @@ -3,18 +3,9 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.withContent import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage import dev.inmo.tgbotapi.types.message.content.* -import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.MediaGroupContent -import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.InvoiceContent -import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate -import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContentMessage.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContentMessage.kt index 2f67610c3f..9620795bf2 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContentMessage.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContentMessage.kt @@ -4,18 +4,12 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.micro_utils.coroutines.safelyWithoutExceptions import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.utils.withContent import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage import dev.inmo.tgbotapi.types.message.content.* -import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.MediaGroupContent -import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.InvoiceContent -import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate +import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContent.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContent.kt index 0a48994147..a552348dd8 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContent.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContent.kt @@ -3,22 +3,12 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.commonMessageOrNull -import dev.inmo.tgbotapi.extensions.utils.withContent import dev.inmo.tgbotapi.requests.abstracts.Request -import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage -import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage import dev.inmo.tgbotapi.types.message.content.* -import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.MediaGroupContent -import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.InvoiceContent -import dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage -import kotlinx.coroutines.flow.* +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.map @RiskFeature(lowLevelRiskFeatureMessage) suspend inline fun BehaviourContext.waitEditedContent( diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentMessage.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentMessage.kt index 74961d206e..c5204f68ec 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentMessage.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitEditedContentMessage.kt @@ -3,23 +3,16 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.utils.commonMessageOrNull import dev.inmo.tgbotapi.extensions.utils.withContent import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage import dev.inmo.tgbotapi.types.message.content.* -import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.MediaGroupContent -import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.InvoiceContent import dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.toList @RiskFeature(lowLevelRiskFeatureMessage) suspend inline fun BehaviourContext.waitEditedContentMessage( 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 20087fdf40..4b7fc377dc 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 @@ -3,19 +3,16 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.ChatEvents.* import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.ChatEvents.voice.* -import dev.inmo.tgbotapi.types.message.PrivateEventMessage import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.toList typealias EventMessageToEventMapper = suspend ChatEventMessage.() -> T? 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 4d76053c72..f5db11ad3b 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 @@ -3,19 +3,16 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.requests.abstracts.Request -import dev.inmo.tgbotapi.types.message.ChannelEventMessage import dev.inmo.tgbotapi.types.message.ChatEvents.* import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.ChatEvents.voice.* -import dev.inmo.tgbotapi.types.message.PrivateEventMessage import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage import dev.inmo.tgbotapi.types.message.payments.SuccessfulPaymentEvent import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage -import kotlinx.coroutines.flow.* +import kotlinx.coroutines.flow.Flow @RiskFeature(lowLevelRiskFeatureMessage) suspend inline fun BehaviourContext.waitEventsMessages( diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitInlineQuery.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitInlineQuery.kt index 8db88e0239..59bb45108c 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitInlineQuery.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitInlineQuery.kt @@ -1,14 +1,12 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.utils.inlineQueryUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.InlineQueries.query.* import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.toList typealias InlineQueryMapper = suspend T.() -> T? diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroup.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroup.kt index 2be7987192..37260e9340 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroup.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroup.kt @@ -2,15 +2,9 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter -import dev.inmo.tgbotapi.extensions.utils.sentMediaGroupUpdateOrNull -import dev.inmo.tgbotapi.extensions.utils.withContent import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage import dev.inmo.tgbotapi.types.message.content.* -import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.MediaGroupContent -import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroupMessages.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroupMessages.kt index 5c1f9ad4d1..f75f8767b7 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroupMessages.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroupMessages.kt @@ -1,16 +1,11 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.utils.sentMediaGroupUpdateOrNull import dev.inmo.tgbotapi.extensions.utils.withContent import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage import dev.inmo.tgbotapi.types.message.content.* -import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.MediaGroupContent -import dev.inmo.tgbotapi.types.message.content.VisualMediaGroupContent import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPassportData.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPassportData.kt index 4ec369a844..e428bbee5d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPassportData.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPassportData.kt @@ -1,7 +1,6 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.utils.messageUpdateOrNull import dev.inmo.tgbotapi.extensions.utils.passportMessageOrNull import dev.inmo.tgbotapi.requests.abstracts.Request @@ -11,7 +10,6 @@ import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportEle import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.toList typealias PassportMessageMapper = suspend PassportMessage.() -> PassportData diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollAnswers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollAnswers.kt index 24e9d674f3..a04232acfe 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollAnswers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollAnswers.kt @@ -1,14 +1,10 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.utils.pollAnswerUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.polls.PollAnswer -import dev.inmo.tgbotapi.utils.RiskFeature -import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.toList typealias PollAnswerMapper = suspend PollAnswer.() -> PollAnswer? diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollUpdates.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollUpdates.kt index 4288fa9939..23ef770caa 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollUpdates.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPollUpdates.kt @@ -1,14 +1,12 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.utils.pollUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.polls.* import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.toList typealias PollMapper = suspend T.() -> T? diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPreCheckoutQuery.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPreCheckoutQuery.kt index f0283f3368..c3a12896c0 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPreCheckoutQuery.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitPreCheckoutQuery.kt @@ -1,14 +1,10 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.utils.preCheckoutQueryUpdateOrNull import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery -import dev.inmo.tgbotapi.utils.RiskFeature -import dev.inmo.tgbotapi.utils.lowLevelRiskFeatureMessage import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.toList typealias PreCheckoutQueryMapper = suspend PreCheckoutQuery.() -> PreCheckoutQuery? diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/filters/MessageFilterByChat.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/filters/MessageFilterByChat.kt index 90574ebd5e..79f983b9f8 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/filters/MessageFilterByChat.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/filters/MessageFilterByChat.kt @@ -2,13 +2,13 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.filters import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver import dev.inmo.tgbotapi.extensions.utils.extensions.sourceChat -import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery +import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery import dev.inmo.tgbotapi.types.chat.ChatJoinRequest import dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated -import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery import dev.inmo.tgbotapi.types.payments.ShippingQuery +import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery import dev.inmo.tgbotapi.types.update.abstracts.Update /** diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt index 2c2ab5f1a4..c2ca912858 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt @@ -6,9 +6,10 @@ import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions import dev.inmo.micro_utils.coroutines.runCatchingSafely import dev.inmo.tgbotapi.extensions.behaviour_builder.* import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CallbackQueryFilterByUser -import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.* +import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserCallbackQueryMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory +import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times import dev.inmo.tgbotapi.extensions.utils.callbackQueryUpdateOrNull import dev.inmo.tgbotapi.types.queries.callback.* import dev.inmo.tgbotapi.types.update.abstracts.Update diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt index 4f5417178e..f59aa80629 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt @@ -12,7 +12,6 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.Mar import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times import dev.inmo.tgbotapi.extensions.utils.botCommandTextSourceOrNull import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithParams -import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage import dev.inmo.tgbotapi.types.message.content.TextContent import dev.inmo.tgbotapi.types.message.content.TextMessage import dev.inmo.tgbotapi.types.update.abstracts.Update diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt index 1b004b05a0..e9a19d4d7d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt @@ -12,12 +12,9 @@ import dev.inmo.tgbotapi.extensions.utils.whenCommonMessage import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage import dev.inmo.tgbotapi.types.message.content.* -import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.InvoiceContent -import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate import dev.inmo.tgbotapi.types.update.abstracts.Update +import dev.inmo.tgbotapi.types.update.media_group.SentMediaGroupUpdate typealias CommonMessageFilter = SimpleFilter> diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt index 4199ee5ca8..e339c6f66f 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt @@ -25,12 +25,6 @@ import dev.inmo.tgbotapi.extensions.utils.withContent import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage import dev.inmo.tgbotapi.types.message.content.* -import dev.inmo.tgbotapi.types.message.content.AudioMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.InvoiceContent -import dev.inmo.tgbotapi.types.message.content.MediaCollectionContent -import dev.inmo.tgbotapi.types.message.content.MediaContent -import dev.inmo.tgbotapi.types.message.content.MessageContent import dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate import dev.inmo.tgbotapi.types.update.abstracts.Update diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt index 108465b116..31f52a2e73 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt @@ -1,6 +1,6 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling -import dev.inmo.micro_utils.coroutines.* +import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptionsAsync import dev.inmo.tgbotapi.extensions.behaviour_builder.* import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.expectFlow import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/utils/LiveLocation.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/utils/LiveLocation.kt index 5d7cfcc624..45a626be00 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/utils/LiveLocation.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/utils/LiveLocation.kt @@ -2,7 +2,6 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.utils import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTypeReceiver -import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitEditedLocation import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitEditedLocationMessage import dev.inmo.tgbotapi.types.location.* import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/QueryMarkerFactories.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/QueryMarkerFactories.kt index a5d25816cd..f22d54379f 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/QueryMarkerFactories.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/QueryMarkerFactories.kt @@ -1,9 +1,9 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories -import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery import dev.inmo.tgbotapi.types.chat.ChatJoinRequest import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery import dev.inmo.tgbotapi.types.payments.ShippingQuery +import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery object ByUserCallbackQueryMarkerFactory : MarkerFactory { override suspend fun invoke(data: CallbackQuery) = data.user