From 8ba13ea5fcec582dbc3751652a677859c4ff1367 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 19 Jun 2026 16:27:54 +0600 Subject: [PATCH 01/27] start 35.0.0 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a35aa4cc8a..ea76dc27e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # TelegramBotAPI changelog +## 35.0.0 + ## 34.0.0 **THIS UPDATE CONTAINS SUPPORT OF [TELEGRAM BOTS API 10.0](https://core.telegram.org/bots/api-changelog#may-8-2026)** diff --git a/gradle.properties b/gradle.properties index f9dd71a887..4398aad2ef 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=34.0.0 +library_version=35.0.0 From 628e877064f1330483ee3c86725f223c4cd8cdee Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 19 Jun 2026 16:53:59 +0600 Subject: [PATCH 02/27] Add Bot API 10.1 Polls support (Link, InputMediaLink) Adds the Link type implementing PollMedia (the url attached to a poll option), parses the new `link` field in PollMedia, and adds TelegramMediaLink (InputMediaLink) usable as InputPollOptionMedia. Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 7 + tgbotapi.core/api/tgbotapi.core.api | 79 +- .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 1 + .../kotlin/dev/inmo/tgbotapi/types/Link.kt | 16 + .../types/media/InputPollOptionMedia.kt | 1 + .../inmo/tgbotapi/types/media/PollMedia.kt | 6 + .../tgbotapi/types/media/TelegramMediaLink.kt | 26 + tgbotapi.utils/api/tgbotapi.utils.api | 6 + .../extensions/utils/ClassCastsNew.kt | 5132 +++++++++-------- 9 files changed, 2705 insertions(+), 2569 deletions(-) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Link.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/TelegramMediaLink.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index ea76dc27e4..4d51604f3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## 35.0.0 +**THIS UPDATE CONTAINS SUPPORT OF [TELEGRAM BOTS API 10.1](https://core.telegram.org/bots/api-changelog#june-11-2026)** + +* `Core`: + * (`Polls`) Added `Link` type (`dev.inmo.tgbotapi.types.Link`) implementing `PollMedia`, carrying the `url` of a link attached to a poll option + * (`Polls`) Added `link` field parsing to `PollMedia` deserialization/serialization + * (`Polls`) Added `TelegramMediaLink` (`InputMediaLink`) implementing `InputPollOptionMedia`, usable as a poll option media + ## 34.0.0 **THIS UPDATE CONTAINS SUPPORT OF [TELEGRAM BOTS API 10.0](https://core.telegram.org/bots/api-changelog#may-8-2026)** diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 2d57239186..53efbf6cce 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -11224,6 +11224,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field limitField Ljava/lang/String; public static final field limitedGiftsField Ljava/lang/String; public static final field linkColorField Ljava/lang/String; + public static final field linkField Ljava/lang/String; public static final field linkPreviewOptionsField Ljava/lang/String; public static final field linkedChatIdField Ljava/lang/String; public static final field livePeriodField Ljava/lang/String; @@ -13752,6 +13753,33 @@ public final class dev/inmo/tgbotapi/types/Level$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/types/Link : dev/inmo/tgbotapi/types/media/PollMedia { + public static final field Companion Ldev/inmo/tgbotapi/types/Link$Companion; + public fun (Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/Link; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/Link;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/Link; + public fun equals (Ljava/lang/Object;)Z + public final fun getUrl ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/Link$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/Link$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/Link; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/Link;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/Link$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public abstract interface class dev/inmo/tgbotapi/types/LinkPreviewOptions { public static final field Companion Ldev/inmo/tgbotapi/types/LinkPreviewOptions$Companion; public abstract fun getPreferLargeMedia ()Z @@ -24384,23 +24412,25 @@ public final class dev/inmo/tgbotapi/types/media/PollMedia$Serializer : kotlinx/ public final class dev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate { public static final field Companion Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate$Companion; - public synthetic fun (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ldev/inmo/tgbotapi/types/Link;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ldev/inmo/tgbotapi/types/Link;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/files/AnimationFile; + public final fun component10 ()Ldev/inmo/tgbotapi/types/venue/Venue; public final fun component2 ()Ldev/inmo/tgbotapi/types/files/AudioFile; public final fun component3 ()Ldev/inmo/tgbotapi/types/files/DocumentFile; - public final fun component4 ()Ldev/inmo/tgbotapi/types/files/LivePhotoFile; - public final fun component5-oW4O2Ik ()Ljava/util/List; - public final fun component6 ()Ldev/inmo/tgbotapi/types/files/Sticker; - public final fun component7 ()Ldev/inmo/tgbotapi/types/files/VideoFile; - public final fun component8 ()Ldev/inmo/tgbotapi/types/location/StaticLocation; - public final fun component9 ()Ldev/inmo/tgbotapi/types/venue/Venue; - public final fun copy-B73X2Os (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;)Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate; - public static synthetic fun copy-B73X2Os$default (Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate;Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate; + public final fun component4 ()Ldev/inmo/tgbotapi/types/Link; + public final fun component5 ()Ldev/inmo/tgbotapi/types/files/LivePhotoFile; + public final fun component6-oW4O2Ik ()Ljava/util/List; + public final fun component7 ()Ldev/inmo/tgbotapi/types/files/Sticker; + public final fun component8 ()Ldev/inmo/tgbotapi/types/files/VideoFile; + public final fun component9 ()Ldev/inmo/tgbotapi/types/location/StaticLocation; + public final fun copy-psFI_B0 (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ldev/inmo/tgbotapi/types/Link;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;)Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate; + public static synthetic fun copy-psFI_B0$default (Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate;Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ldev/inmo/tgbotapi/types/Link;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate; public fun equals (Ljava/lang/Object;)Z public final fun getAnimation ()Ldev/inmo/tgbotapi/types/files/AnimationFile; public final fun getAudio ()Ldev/inmo/tgbotapi/types/files/AudioFile; public final fun getDocument ()Ldev/inmo/tgbotapi/types/files/DocumentFile; + public final fun getLink ()Ldev/inmo/tgbotapi/types/Link; public final fun getLivePhoto ()Ldev/inmo/tgbotapi/types/files/LivePhotoFile; public final fun getLocation ()Ldev/inmo/tgbotapi/types/location/StaticLocation; public final fun getPhoto-oW4O2Ik ()Ljava/util/List; @@ -24607,6 +24637,35 @@ public final class dev/inmo/tgbotapi/types/media/TelegramMediaDocumentKt { public static synthetic fun toTelegramMediaDocument$default (Ldev/inmo/tgbotapi/types/files/DocumentFile;Ljava/util/List;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaDocument; } +public final class dev/inmo/tgbotapi/types/media/TelegramMediaLink : dev/inmo/tgbotapi/types/media/InputPollOptionMedia { + public static final field Companion Ldev/inmo/tgbotapi/types/media/TelegramMediaLink$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/media/TelegramMediaLink; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/media/TelegramMediaLink;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaLink; + public fun equals (Ljava/lang/Object;)Z + public fun getType ()Ljava/lang/String; + public final fun getUrl ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/media/TelegramMediaLink$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/media/TelegramMediaLink$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/media/TelegramMediaLink; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/media/TelegramMediaLink;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/media/TelegramMediaLink$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto : dev/inmo/tgbotapi/types/media/InputPollMedia, dev/inmo/tgbotapi/types/media/InputPollOptionMedia, dev/inmo/tgbotapi/types/media/TelegramFreeMedia, dev/inmo/tgbotapi/types/media/VisualMediaGroupMemberTelegramMedia { public static final field Companion Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto$Companion; public static final field TYPE Ljava/lang/String; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 859984e9dd..b338f45c2f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -556,6 +556,7 @@ const val stickerField = "sticker" const val oldStickerField = "old_sticker" const val keywordsField = "keywords" const val urlField = "url" +const val linkField = "link" const val addressField = "address" const val actionField = "action" const val positionField = "position" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Link.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Link.kt new file mode 100644 index 0000000000..9187e096cb --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Link.kt @@ -0,0 +1,16 @@ +package dev.inmo.tgbotapi.types + +import dev.inmo.tgbotapi.types.media.PollMedia +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +/** + * Represents an HTTP link. + * + * @see Link + */ +@Serializable +data class Link( + @SerialName(urlField) + val url: String +) : PollMedia diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/InputPollOptionMedia.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/InputPollOptionMedia.kt index 42279618dc..861654e3ca 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/InputPollOptionMedia.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/InputPollOptionMedia.kt @@ -27,6 +27,7 @@ object InputPollOptionMediaSerializer : KSerializer { override fun serialize(encoder: Encoder, value: InputPollOptionMedia) { when (value) { is TelegramMediaAnimation -> TelegramMediaAnimation.serializer().serialize(encoder, value) + is TelegramMediaLink -> TelegramMediaLink.serializer().serialize(encoder, value) is TelegramMediaLivePhoto -> TelegramMediaLivePhoto.serializer().serialize(encoder, value) is TelegramMediaLocation -> TelegramMediaLocation.serializer().serialize(encoder, value) is TelegramMediaPhoto -> TelegramMediaPhoto.serializer().serialize(encoder, value) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/PollMedia.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/PollMedia.kt index 2c9af7f97f..e80bc2428d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/PollMedia.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/PollMedia.kt @@ -10,6 +10,8 @@ import dev.inmo.tgbotapi.types.files.LivePhotoFile import dev.inmo.tgbotapi.types.files.PhotoFile import dev.inmo.tgbotapi.types.files.Sticker import dev.inmo.tgbotapi.types.files.VideoFile +import dev.inmo.tgbotapi.types.Link +import dev.inmo.tgbotapi.types.linkField import dev.inmo.tgbotapi.types.livePhotoField import dev.inmo.tgbotapi.types.location.StaticLocation import dev.inmo.tgbotapi.types.locationField @@ -36,6 +38,8 @@ interface PollMedia : BaseTelegramMediaFile { val audio: AudioFile? = null, @SerialName(documentField) val document: DocumentFile? = null, + @SerialName(linkField) + val link: Link? = null, @SerialName(livePhotoField) val livePhoto: LivePhotoFile? = null, @SerialName(photoField) @@ -61,6 +65,7 @@ interface PollMedia : BaseTelegramMediaFile { surrogate.animation != null -> surrogate.animation surrogate.audio != null -> surrogate.audio surrogate.document != null -> surrogate.document + surrogate.link != null -> surrogate.link surrogate.livePhoto != null -> surrogate.livePhoto surrogate.photo != null -> surrogate.photo surrogate.sticker != null -> surrogate.sticker @@ -76,6 +81,7 @@ interface PollMedia : BaseTelegramMediaFile { animation = value as? AnimationFile, audio = value as? AudioFile, document = value as? DocumentFile, + link = value as? Link, livePhoto = value as? LivePhotoFile, photo = value as? PhotoFile, sticker = value as? Sticker, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/TelegramMediaLink.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/TelegramMediaLink.kt new file mode 100644 index 0000000000..cb71452196 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/media/TelegramMediaLink.kt @@ -0,0 +1,26 @@ +package dev.inmo.tgbotapi.types.media + +import dev.inmo.tgbotapi.types.typeField +import dev.inmo.tgbotapi.types.urlField +import kotlinx.serialization.EncodeDefault +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +/** + * Represents an HTTP link to be sent. Can be used as [InputPollOptionMedia]. + * + * @see InputMediaLink + */ +@Serializable +data class TelegramMediaLink( + @SerialName(urlField) + val url: String, +) : InputPollOptionMedia { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "link" + } +} diff --git a/tgbotapi.utils/api/tgbotapi.utils.api b/tgbotapi.utils/api/tgbotapi.utils.api index 7c0e91d4c4..f6a5c407e5 100644 --- a/tgbotapi.utils/api/tgbotapi.utils.api +++ b/tgbotapi.utils/api/tgbotapi.utils.api @@ -1918,6 +1918,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifLeftChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifLeftChatMemberEvent (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifLeftChatMemberEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifLink (Ldev/inmo/tgbotapi/types/media/BaseTelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifLiveLocation (Ldev/inmo/tgbotapi/types/location/Location;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifLiveLocationContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifLivePhotoContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -2142,6 +2143,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifTelegramMediaDocument (Ldev/inmo/tgbotapi/types/media/InputPollMedia;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifTelegramMediaDocument (Ldev/inmo/tgbotapi/types/media/TelegramMedia;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifTelegramMediaFile (Ldev/inmo/tgbotapi/types/media/BaseTelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifTelegramMediaLink (Ldev/inmo/tgbotapi/types/media/InputPollOptionMedia;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifTelegramMediaLivePhoto (Ldev/inmo/tgbotapi/types/media/InputPollMedia;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifTelegramMediaLivePhoto (Ldev/inmo/tgbotapi/types/media/InputPollOptionMedia;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifTelegramMediaLivePhoto (Ldev/inmo/tgbotapi/types/media/TelegramMedia;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -2364,6 +2366,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun leftChatMemberEventOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMemberEvent; public static final fun leftChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/LeftChatMember; public static final fun leftChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/LeftChatMember; + public static final fun linkOrNull (Ldev/inmo/tgbotapi/types/media/BaseTelegramMediaFile;)Ldev/inmo/tgbotapi/types/Link; + public static final fun linkOrThrow (Ldev/inmo/tgbotapi/types/media/BaseTelegramMediaFile;)Ldev/inmo/tgbotapi/types/Link; public static final fun liveLocationContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/LiveLocationContent; public static final fun liveLocationContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/LiveLocationContent; public static final fun liveLocationOrNull (Ldev/inmo/tgbotapi/types/location/Location;)Ldev/inmo/tgbotapi/types/location/LiveLocation; @@ -2812,6 +2816,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun telegramMediaDocumentOrThrow (Ldev/inmo/tgbotapi/types/media/TelegramMedia;)Ldev/inmo/tgbotapi/types/media/TelegramMediaDocument; public static final fun telegramMediaFileOrNull (Ldev/inmo/tgbotapi/types/media/BaseTelegramMediaFile;)Ldev/inmo/tgbotapi/types/files/TelegramMediaFile; public static final fun telegramMediaFileOrThrow (Ldev/inmo/tgbotapi/types/media/BaseTelegramMediaFile;)Ldev/inmo/tgbotapi/types/files/TelegramMediaFile; + public static final fun telegramMediaLinkOrNull (Ldev/inmo/tgbotapi/types/media/InputPollOptionMedia;)Ldev/inmo/tgbotapi/types/media/TelegramMediaLink; + public static final fun telegramMediaLinkOrThrow (Ldev/inmo/tgbotapi/types/media/InputPollOptionMedia;)Ldev/inmo/tgbotapi/types/media/TelegramMediaLink; public static final fun telegramMediaLivePhotoOrNull (Ldev/inmo/tgbotapi/types/media/InputPollMedia;)Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto; public static final fun telegramMediaLivePhotoOrNull (Ldev/inmo/tgbotapi/types/media/InputPollOptionMedia;)Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto; public static final fun telegramMediaLivePhotoOrNull (Ldev/inmo/tgbotapi/types/media/TelegramMedia;)Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto; 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 7468a9e171..d6cb71dfef 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 @@ -95,6 +95,7 @@ import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessa import dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery import dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery +import dev.inmo.tgbotapi.types.Link import dev.inmo.tgbotapi.types.PaidMessagePriceChanged import dev.inmo.tgbotapi.types.PrimaryInviteLink import dev.inmo.tgbotapi.types.ReplyInfo @@ -267,6 +268,7 @@ 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.TelegramMediaLink import dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto import dev.inmo.tgbotapi.types.media.TelegramMediaLocation import dev.inmo.tgbotapi.types.media.TelegramMediaPhoto @@ -580,6 +582,102 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.types.venue.Venue import kotlin.Suppress +public inline fun BotException.commonBotExceptionOrNull(): CommonBotException? = this as? dev.inmo.tgbotapi.bot.exceptions.CommonBotException + +public inline fun BotException.commonBotExceptionOrThrow(): CommonBotException = this as dev.inmo.tgbotapi.bot.exceptions.CommonBotException + +public inline fun BotException.ifCommonBotException(block: (CommonBotException) -> T): T? = commonBotExceptionOrNull() ?.let(block) + +public inline fun BotException.apiExceptionOrNull(): ApiException? = this as? dev.inmo.tgbotapi.bot.exceptions.ApiException + +public inline fun BotException.apiExceptionOrThrow(): ApiException = this as dev.inmo.tgbotapi.bot.exceptions.ApiException + +public inline fun BotException.ifApiException(block: (ApiException) -> T): T? = apiExceptionOrNull() ?.let(block) + +public inline fun BotException.requestExceptionOrNull(): RequestException? = this as? dev.inmo.tgbotapi.bot.exceptions.RequestException + +public inline fun BotException.requestExceptionOrThrow(): RequestException = this as dev.inmo.tgbotapi.bot.exceptions.RequestException + +public inline fun BotException.ifRequestException(block: (RequestException) -> T): T? = requestExceptionOrNull() ?.let(block) + +public inline fun BotException.commonRequestExceptionOrNull(): CommonRequestException? = this as? dev.inmo.tgbotapi.bot.exceptions.CommonRequestException + +public inline fun BotException.commonRequestExceptionOrThrow(): CommonRequestException = this as dev.inmo.tgbotapi.bot.exceptions.CommonRequestException + +public inline fun BotException.ifCommonRequestException(block: (CommonRequestException) -> T): T? = commonRequestExceptionOrNull() ?.let(block) + +public inline fun BotException.unauthorizedExceptionOrNull(): UnauthorizedException? = this as? dev.inmo.tgbotapi.bot.exceptions.UnauthorizedException + +public inline fun BotException.unauthorizedExceptionOrThrow(): UnauthorizedException = this as dev.inmo.tgbotapi.bot.exceptions.UnauthorizedException + +public inline fun BotException.ifUnauthorizedException(block: (UnauthorizedException) -> T): T? = unauthorizedExceptionOrNull() ?.let(block) + +public inline fun BotException.replyMessageNotFoundExceptionOrNull(): ReplyMessageNotFoundException? = this as? dev.inmo.tgbotapi.bot.exceptions.ReplyMessageNotFoundException + +public inline fun BotException.replyMessageNotFoundExceptionOrThrow(): ReplyMessageNotFoundException = this as dev.inmo.tgbotapi.bot.exceptions.ReplyMessageNotFoundException + +public inline fun BotException.ifReplyMessageNotFoundException(block: (ReplyMessageNotFoundException) -> T): T? = replyMessageNotFoundExceptionOrNull() ?.let(block) + +public inline fun BotException.messageIsNotModifiedExceptionOrNull(): MessageIsNotModifiedException? = this as? dev.inmo.tgbotapi.bot.exceptions.MessageIsNotModifiedException + +public inline fun BotException.messageIsNotModifiedExceptionOrThrow(): MessageIsNotModifiedException = this as dev.inmo.tgbotapi.bot.exceptions.MessageIsNotModifiedException + +public inline fun BotException.ifMessageIsNotModifiedException(block: (MessageIsNotModifiedException) -> T): T? = messageIsNotModifiedExceptionOrNull() ?.let(block) + +public inline fun BotException.messageToEditNotFoundExceptionOrNull(): MessageToEditNotFoundException? = this as? dev.inmo.tgbotapi.bot.exceptions.MessageToEditNotFoundException + +public inline fun BotException.messageToEditNotFoundExceptionOrThrow(): MessageToEditNotFoundException = this as dev.inmo.tgbotapi.bot.exceptions.MessageToEditNotFoundException + +public inline fun BotException.ifMessageToEditNotFoundException(block: (MessageToEditNotFoundException) -> T): T? = messageToEditNotFoundExceptionOrNull() ?.let(block) + +public inline fun BotException.invalidPhotoDimensionsExceptionOrNull(): InvalidPhotoDimensionsException? = this as? dev.inmo.tgbotapi.bot.exceptions.InvalidPhotoDimensionsException + +public inline fun BotException.invalidPhotoDimensionsExceptionOrThrow(): InvalidPhotoDimensionsException = this as dev.inmo.tgbotapi.bot.exceptions.InvalidPhotoDimensionsException + +public inline fun BotException.ifInvalidPhotoDimensionsException(block: (InvalidPhotoDimensionsException) -> T): T? = invalidPhotoDimensionsExceptionOrNull() ?.let(block) + +public inline fun BotException.wrongFileIdentifierExceptionOrNull(): WrongFileIdentifierException? = this as? dev.inmo.tgbotapi.bot.exceptions.WrongFileIdentifierException + +public inline fun BotException.wrongFileIdentifierExceptionOrThrow(): WrongFileIdentifierException = this as dev.inmo.tgbotapi.bot.exceptions.WrongFileIdentifierException + +public inline fun BotException.ifWrongFileIdentifierException(block: (WrongFileIdentifierException) -> T): T? = wrongFileIdentifierExceptionOrNull() ?.let(block) + +public inline fun BotException.tooMuchRequestsExceptionOrNull(): TooMuchRequestsException? = this as? dev.inmo.tgbotapi.bot.exceptions.TooMuchRequestsException + +public inline fun BotException.tooMuchRequestsExceptionOrThrow(): TooMuchRequestsException = this as dev.inmo.tgbotapi.bot.exceptions.TooMuchRequestsException + +public inline fun BotException.ifTooMuchRequestsException(block: (TooMuchRequestsException) -> T): T? = tooMuchRequestsExceptionOrNull() ?.let(block) + +public inline fun BotException.getUpdatesConflictOrNull(): GetUpdatesConflict? = this as? dev.inmo.tgbotapi.bot.exceptions.GetUpdatesConflict + +public inline fun BotException.getUpdatesConflictOrThrow(): GetUpdatesConflict = this as dev.inmo.tgbotapi.bot.exceptions.GetUpdatesConflict + +public inline fun BotException.ifGetUpdatesConflict(block: (GetUpdatesConflict) -> T): T? = getUpdatesConflictOrNull() ?.let(block) + +public inline fun BotException.commonBotExceptionDefaultOrNull(): CommonBotException.Default? = this as? dev.inmo.tgbotapi.bot.exceptions.CommonBotException.Default + +public inline fun BotException.commonBotExceptionDefaultOrThrow(): CommonBotException.Default = this as dev.inmo.tgbotapi.bot.exceptions.CommonBotException.Default + +public inline fun BotException.ifCommonBotExceptionDefault(block: (CommonBotException.Default) -> T): T? = commonBotExceptionDefaultOrNull() ?.let(block) + +public inline fun InlineQueryResultsButton.webAppOrNull(): InlineQueryResultsButton.WebApp? = this as? dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.WebApp + +public inline fun InlineQueryResultsButton.webAppOrThrow(): InlineQueryResultsButton.WebApp = this as dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.WebApp + +public inline fun InlineQueryResultsButton.ifWebApp(block: (InlineQueryResultsButton.WebApp) -> T): T? = webAppOrNull() ?.let(block) + +public inline fun InlineQueryResultsButton.startOrNull(): InlineQueryResultsButton.Start? = this as? dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.Start + +public inline fun InlineQueryResultsButton.startOrThrow(): InlineQueryResultsButton.Start = this as dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.Start + +public inline fun InlineQueryResultsButton.ifStart(block: (InlineQueryResultsButton.Start) -> T): T? = startOrNull() ?.let(block) + +public inline fun InlineQueryResultsButton.unknownOrNull(): InlineQueryResultsButton.Unknown? = this as? dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.Unknown + +public inline fun InlineQueryResultsButton.unknownOrThrow(): InlineQueryResultsButton.Unknown = this as dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.Unknown + +public inline fun InlineQueryResultsButton.ifUnknown(block: (InlineQueryResultsButton.Unknown) -> T): T? = unknownOrNull() ?.let(block) + public inline fun InputSticker.maskOrNull(): InputSticker.Mask? = this as? dev.inmo.tgbotapi.requests.stickers.InputSticker.Mask public inline fun InputSticker.maskOrThrow(): InputSticker.Mask = this as dev.inmo.tgbotapi.requests.stickers.InputSticker.Mask @@ -604,23 +702,545 @@ public inline fun InputSticker.withKeywordsCustomEmojiOrThrow(): InputSticker.Wi public inline fun InputSticker.ifWithKeywordsCustomEmoji(block: (InputSticker.WithKeywords.CustomEmoji) -> T): T? = withKeywordsCustomEmojiOrNull() ?.let(block) -public inline fun InlineQueryResultsButton.webAppOrNull(): InlineQueryResultsButton.WebApp? = this as? dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.WebApp +public inline fun InputPollMedia.telegramMediaPhotoOrNull(): TelegramMediaPhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaPhoto -public inline fun InlineQueryResultsButton.webAppOrThrow(): InlineQueryResultsButton.WebApp = this as dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.WebApp +public inline fun InputPollMedia.telegramMediaPhotoOrThrow(): TelegramMediaPhoto = this as dev.inmo.tgbotapi.types.media.TelegramMediaPhoto -public inline fun InlineQueryResultsButton.ifWebApp(block: (InlineQueryResultsButton.WebApp) -> T): T? = webAppOrNull() ?.let(block) +public inline fun InputPollMedia.ifTelegramMediaPhoto(block: (TelegramMediaPhoto) -> T): T? = telegramMediaPhotoOrNull() ?.let(block) -public inline fun InlineQueryResultsButton.startOrNull(): InlineQueryResultsButton.Start? = this as? dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.Start +public inline fun InputPollMedia.telegramMediaDocumentOrNull(): TelegramMediaDocument? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaDocument -public inline fun InlineQueryResultsButton.startOrThrow(): InlineQueryResultsButton.Start = this as dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.Start +public inline fun InputPollMedia.telegramMediaDocumentOrThrow(): TelegramMediaDocument = this as dev.inmo.tgbotapi.types.media.TelegramMediaDocument -public inline fun InlineQueryResultsButton.ifStart(block: (InlineQueryResultsButton.Start) -> T): T? = startOrNull() ?.let(block) +public inline fun InputPollMedia.ifTelegramMediaDocument(block: (TelegramMediaDocument) -> T): T? = telegramMediaDocumentOrNull() ?.let(block) -public inline fun InlineQueryResultsButton.unknownOrNull(): InlineQueryResultsButton.Unknown? = this as? dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.Unknown +public inline fun InputPollMedia.telegramMediaVenueOrNull(): TelegramMediaVenue? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaVenue -public inline fun InlineQueryResultsButton.unknownOrThrow(): InlineQueryResultsButton.Unknown = this as dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.Unknown +public inline fun InputPollMedia.telegramMediaVenueOrThrow(): TelegramMediaVenue = this as dev.inmo.tgbotapi.types.media.TelegramMediaVenue -public inline fun InlineQueryResultsButton.ifUnknown(block: (InlineQueryResultsButton.Unknown) -> T): T? = unknownOrNull() ?.let(block) +public inline fun InputPollMedia.ifTelegramMediaVenue(block: (TelegramMediaVenue) -> T): T? = telegramMediaVenueOrNull() ?.let(block) + +public inline fun InputPollMedia.telegramMediaLocationOrNull(): TelegramMediaLocation? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaLocation + +public inline fun InputPollMedia.telegramMediaLocationOrThrow(): TelegramMediaLocation = this as dev.inmo.tgbotapi.types.media.TelegramMediaLocation + +public inline fun InputPollMedia.ifTelegramMediaLocation(block: (TelegramMediaLocation) -> T): T? = telegramMediaLocationOrNull() ?.let(block) + +public inline fun InputPollMedia.telegramMediaAudioOrNull(): TelegramMediaAudio? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaAudio + +public inline fun InputPollMedia.telegramMediaAudioOrThrow(): TelegramMediaAudio = this as dev.inmo.tgbotapi.types.media.TelegramMediaAudio + +public inline fun InputPollMedia.ifTelegramMediaAudio(block: (TelegramMediaAudio) -> T): T? = telegramMediaAudioOrNull() ?.let(block) + +public inline fun InputPollMedia.telegramMediaLivePhotoOrNull(): TelegramMediaLivePhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto + +public inline fun InputPollMedia.telegramMediaLivePhotoOrThrow(): TelegramMediaLivePhoto = this as dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto + +public inline fun InputPollMedia.ifTelegramMediaLivePhoto(block: (TelegramMediaLivePhoto) -> T): T? = telegramMediaLivePhotoOrNull() ?.let(block) + +public inline fun InputPollMedia.telegramMediaAnimationOrNull(): TelegramMediaAnimation? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaAnimation + +public inline fun InputPollMedia.telegramMediaAnimationOrThrow(): TelegramMediaAnimation = this as dev.inmo.tgbotapi.types.media.TelegramMediaAnimation + +public inline fun InputPollMedia.ifTelegramMediaAnimation(block: (TelegramMediaAnimation) -> T): T? = telegramMediaAnimationOrNull() ?.let(block) + +public inline fun InputPollMedia.telegramMediaVideoOrNull(): TelegramMediaVideo? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaVideo + +public inline fun InputPollMedia.telegramMediaVideoOrThrow(): TelegramMediaVideo = this as dev.inmo.tgbotapi.types.media.TelegramMediaVideo + +public inline fun InputPollMedia.ifTelegramMediaVideo(block: (TelegramMediaVideo) -> T): T? = telegramMediaVideoOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramPaidMediaOrNull(): TelegramPaidMedia? = this as? dev.inmo.tgbotapi.types.media.TelegramPaidMedia + +public inline fun TelegramMedia.telegramPaidMediaOrThrow(): TelegramPaidMedia = this as dev.inmo.tgbotapi.types.media.TelegramPaidMedia + +public inline fun TelegramMedia.ifTelegramPaidMedia(block: (TelegramPaidMedia) -> T): T? = telegramPaidMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.visualTelegramPaidMediaOrNull(): VisualTelegramPaidMedia? = this as? dev.inmo.tgbotapi.types.media.VisualTelegramPaidMedia + +public inline fun TelegramMedia.visualTelegramPaidMediaOrThrow(): VisualTelegramPaidMedia = this as dev.inmo.tgbotapi.types.media.VisualTelegramPaidMedia + +public inline fun TelegramMedia.ifVisualTelegramPaidMedia(block: (VisualTelegramPaidMedia) -> T): T? = visualTelegramPaidMediaOrNull() ?.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.telegramPaidMediaVideoOrNull(): TelegramPaidMediaVideo? = this as? dev.inmo.tgbotapi.types.media.TelegramPaidMediaVideo + +public inline fun TelegramMedia.telegramPaidMediaVideoOrThrow(): TelegramPaidMediaVideo = this as dev.inmo.tgbotapi.types.media.TelegramPaidMediaVideo + +public inline fun TelegramMedia.ifTelegramPaidMediaVideo(block: (TelegramPaidMediaVideo) -> T): T? = telegramPaidMediaVideoOrNull() ?.let(block) + +public inline fun TelegramMedia.spoilerableTelegramMediaOrNull(): SpoilerableTelegramMedia? = this as? dev.inmo.tgbotapi.types.media.SpoilerableTelegramMedia + +public inline fun TelegramMedia.spoilerableTelegramMediaOrThrow(): SpoilerableTelegramMedia = this as dev.inmo.tgbotapi.types.media.SpoilerableTelegramMedia + +public inline fun TelegramMedia.ifSpoilerableTelegramMedia(block: (SpoilerableTelegramMedia) -> T): T? = spoilerableTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramPaidMediaPhotoOrNull(): TelegramPaidMediaPhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramPaidMediaPhoto + +public inline fun TelegramMedia.telegramPaidMediaPhotoOrThrow(): TelegramPaidMediaPhoto = this as dev.inmo.tgbotapi.types.media.TelegramPaidMediaPhoto + +public inline fun TelegramMedia.ifTelegramPaidMediaPhoto(block: (TelegramPaidMediaPhoto) -> T): T? = telegramPaidMediaPhotoOrNull() ?.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.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.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.telegramFreeMediaOrNull(): TelegramFreeMedia? = this as? dev.inmo.tgbotapi.types.media.TelegramFreeMedia + +public inline fun TelegramMedia.telegramFreeMediaOrThrow(): TelegramFreeMedia = this as dev.inmo.tgbotapi.types.media.TelegramFreeMedia + +public inline fun TelegramMedia.ifTelegramFreeMedia(block: (TelegramFreeMedia) -> T): T? = telegramFreeMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramMediaStickerOrNull(): TelegramMediaSticker? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaSticker + +public inline fun TelegramMedia.telegramMediaStickerOrThrow(): TelegramMediaSticker = this as dev.inmo.tgbotapi.types.media.TelegramMediaSticker + +public inline fun TelegramMedia.ifTelegramMediaSticker(block: (TelegramMediaSticker) -> T): T? = telegramMediaStickerOrNull() ?.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.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.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 TelegramMedia.telegramPaidMediaLivePhotoOrNull(): TelegramPaidMediaLivePhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramPaidMediaLivePhoto + +public inline fun TelegramMedia.telegramPaidMediaLivePhotoOrThrow(): TelegramPaidMediaLivePhoto = this as dev.inmo.tgbotapi.types.media.TelegramPaidMediaLivePhoto + +public inline fun TelegramMedia.ifTelegramPaidMediaLivePhoto(block: (TelegramPaidMediaLivePhoto) -> T): T? = telegramPaidMediaLivePhotoOrNull() ?.let(block) + +public inline fun TelegramMedia.telegramMediaLivePhotoOrNull(): TelegramMediaLivePhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto + +public inline fun TelegramMedia.telegramMediaLivePhotoOrThrow(): TelegramMediaLivePhoto = this as dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto + +public inline fun TelegramMedia.ifTelegramMediaLivePhoto(block: (TelegramMediaLivePhoto) -> T): T? = telegramMediaLivePhotoOrNull() ?.let(block) + +public inline fun TelegramMedia.withCustomStartTelegramMediaOrNull(): WithCustomStartTelegramMedia? = this as? dev.inmo.tgbotapi.types.media.WithCustomStartTelegramMedia + +public inline fun TelegramMedia.withCustomStartTelegramMediaOrThrow(): WithCustomStartTelegramMedia = this as dev.inmo.tgbotapi.types.media.WithCustomStartTelegramMedia + +public inline fun TelegramMedia.ifWithCustomStartTelegramMedia(block: (WithCustomStartTelegramMedia) -> T): T? = withCustomStartTelegramMediaOrNull() ?.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.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.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.withCustomizableCaptionTelegramMediaOrNull(): WithCustomizableCaptionTelegramMedia? = this as? dev.inmo.tgbotapi.types.media.WithCustomizableCaptionTelegramMedia + +public inline fun TelegramMedia.withCustomizableCaptionTelegramMediaOrThrow(): WithCustomizableCaptionTelegramMedia = this as dev.inmo.tgbotapi.types.media.WithCustomizableCaptionTelegramMedia + +public inline fun TelegramMedia.ifWithCustomizableCaptionTelegramMedia(block: (WithCustomizableCaptionTelegramMedia) -> T): T? = withCustomizableCaptionTelegramMediaOrNull() ?.let(block) + +public inline fun TelegramMedia.coveredTelegramMediaOrNull(): CoveredTelegramMedia? = this as? dev.inmo.tgbotapi.types.media.CoveredTelegramMedia + +public inline fun TelegramMedia.coveredTelegramMediaOrThrow(): CoveredTelegramMedia = this as dev.inmo.tgbotapi.types.media.CoveredTelegramMedia + +public inline fun TelegramMedia.ifCoveredTelegramMedia(block: (CoveredTelegramMedia) -> T): T? = coveredTelegramMediaOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.venueOrNull(): Venue? = this as? dev.inmo.tgbotapi.types.venue.Venue + +public inline fun BaseTelegramMediaFile.venueOrThrow(): Venue = this as dev.inmo.tgbotapi.types.venue.Venue + +public inline fun BaseTelegramMediaFile.ifVenue(block: (Venue) -> T): T? = venueOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.pollMediaOrNull(): PollMedia? = this as? dev.inmo.tgbotapi.types.media.PollMedia + +public inline fun BaseTelegramMediaFile.pollMediaOrThrow(): PollMedia = this as dev.inmo.tgbotapi.types.media.PollMedia + +public inline fun BaseTelegramMediaFile.ifPollMedia(block: (PollMedia) -> T): T? = pollMediaOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.livePhotoFileOrNull(): LivePhotoFile? = this as? dev.inmo.tgbotapi.types.files.LivePhotoFile + +public inline fun BaseTelegramMediaFile.livePhotoFileOrThrow(): LivePhotoFile = this as dev.inmo.tgbotapi.types.files.LivePhotoFile + +public inline fun BaseTelegramMediaFile.ifLivePhotoFile(block: (LivePhotoFile) -> T): T? = livePhotoFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.usefulAsPaidMediaFileOrNull(): UsefulAsPaidMediaFile? = this as? dev.inmo.tgbotapi.types.files.UsefulAsPaidMediaFile + +public inline fun BaseTelegramMediaFile.usefulAsPaidMediaFileOrThrow(): UsefulAsPaidMediaFile = this as dev.inmo.tgbotapi.types.files.UsefulAsPaidMediaFile + +public inline fun BaseTelegramMediaFile.ifUsefulAsPaidMediaFile(block: (UsefulAsPaidMediaFile) -> T): T? = usefulAsPaidMediaFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.passportFileOrNull(): PassportFile? = this as? dev.inmo.tgbotapi.types.files.PassportFile + +public inline fun BaseTelegramMediaFile.passportFileOrThrow(): PassportFile = this as dev.inmo.tgbotapi.types.files.PassportFile + +public inline fun BaseTelegramMediaFile.ifPassportFile(block: (PassportFile) -> T): T? = passportFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.videoQualityOrNull(): VideoQuality? = this as? dev.inmo.tgbotapi.types.files.VideoQuality + +public inline fun BaseTelegramMediaFile.videoQualityOrThrow(): VideoQuality = this as dev.inmo.tgbotapi.types.files.VideoQuality + +public inline fun BaseTelegramMediaFile.ifVideoQuality(block: (VideoQuality) -> T): T? = videoQualityOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.pathedFileOrNull(): PathedFile? = this as? dev.inmo.tgbotapi.types.files.PathedFile + +public inline fun BaseTelegramMediaFile.pathedFileOrThrow(): PathedFile = this as dev.inmo.tgbotapi.types.files.PathedFile + +public inline fun BaseTelegramMediaFile.ifPathedFile(block: (PathedFile) -> T): T? = pathedFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.mediaContentVariantOrNull(): MediaContentVariant? = this as? dev.inmo.tgbotapi.types.files.MediaContentVariant + +public inline fun BaseTelegramMediaFile.mediaContentVariantOrThrow(): MediaContentVariant = this as dev.inmo.tgbotapi.types.files.MediaContentVariant + +public inline fun BaseTelegramMediaFile.ifMediaContentVariant(block: (MediaContentVariant) -> T): T? = mediaContentVariantOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.photoFileOrNull(): PhotoFile? = this as? dev.inmo.tgbotapi.types.files.PhotoFile + +public inline fun BaseTelegramMediaFile.photoFileOrThrow(): PhotoFile = this as dev.inmo.tgbotapi.types.files.PhotoFile + +public inline fun BaseTelegramMediaFile.ifPhotoFile(block: (PhotoFile) -> T): T? = photoFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.photoSizeOrNull(): PhotoSize? = this as? dev.inmo.tgbotapi.types.files.PhotoSize + +public inline fun BaseTelegramMediaFile.photoSizeOrThrow(): PhotoSize = this as dev.inmo.tgbotapi.types.files.PhotoSize + +public inline fun BaseTelegramMediaFile.ifPhotoSize(block: (PhotoSize) -> T): T? = photoSizeOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.documentFileOrNull(): DocumentFile? = this as? dev.inmo.tgbotapi.types.files.DocumentFile + +public inline fun BaseTelegramMediaFile.documentFileOrThrow(): DocumentFile = this as dev.inmo.tgbotapi.types.files.DocumentFile + +public inline fun BaseTelegramMediaFile.ifDocumentFile(block: (DocumentFile) -> T): T? = documentFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.audioFileOrNull(): AudioFile? = this as? dev.inmo.tgbotapi.types.files.AudioFile + +public inline fun BaseTelegramMediaFile.audioFileOrThrow(): AudioFile = this as dev.inmo.tgbotapi.types.files.AudioFile + +public inline fun BaseTelegramMediaFile.ifAudioFile(block: (AudioFile) -> T): T? = audioFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.voiceFileOrNull(): VoiceFile? = this as? dev.inmo.tgbotapi.types.files.VoiceFile + +public inline fun BaseTelegramMediaFile.voiceFileOrThrow(): VoiceFile = this as dev.inmo.tgbotapi.types.files.VoiceFile + +public inline fun BaseTelegramMediaFile.ifVoiceFile(block: (VoiceFile) -> T): T? = voiceFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.stickerOrNull(): Sticker? = this as? dev.inmo.tgbotapi.types.files.Sticker + +public inline fun BaseTelegramMediaFile.stickerOrThrow(): Sticker = this as dev.inmo.tgbotapi.types.files.Sticker + +public inline fun BaseTelegramMediaFile.ifSticker(block: (Sticker) -> T): T? = stickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.videoStickerOrNull(): VideoSticker? = this as? dev.inmo.tgbotapi.types.files.VideoSticker + +public inline fun BaseTelegramMediaFile.videoStickerOrThrow(): VideoSticker = this as dev.inmo.tgbotapi.types.files.VideoSticker + +public inline fun BaseTelegramMediaFile.ifVideoSticker(block: (VideoSticker) -> T): T? = videoStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.animatedStickerOrNull(): AnimatedSticker? = this as? dev.inmo.tgbotapi.types.files.AnimatedSticker + +public inline fun BaseTelegramMediaFile.animatedStickerOrThrow(): AnimatedSticker = this as dev.inmo.tgbotapi.types.files.AnimatedSticker + +public inline fun BaseTelegramMediaFile.ifAnimatedSticker(block: (AnimatedSticker) -> T): T? = animatedStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.regularStickerOrNull(): RegularSticker? = this as? dev.inmo.tgbotapi.types.files.RegularSticker + +public inline fun BaseTelegramMediaFile.regularStickerOrThrow(): RegularSticker = this as dev.inmo.tgbotapi.types.files.RegularSticker + +public inline fun BaseTelegramMediaFile.ifRegularSticker(block: (RegularSticker) -> T): T? = regularStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.regularSimpleStickerOrNull(): RegularSimpleSticker? = this as? dev.inmo.tgbotapi.types.files.RegularSimpleSticker + +public inline fun BaseTelegramMediaFile.regularSimpleStickerOrThrow(): RegularSimpleSticker = this as dev.inmo.tgbotapi.types.files.RegularSimpleSticker + +public inline fun BaseTelegramMediaFile.ifRegularSimpleSticker(block: (RegularSimpleSticker) -> T): T? = regularSimpleStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.regularAnimatedStickerOrNull(): RegularAnimatedSticker? = this as? dev.inmo.tgbotapi.types.files.RegularAnimatedSticker + +public inline fun BaseTelegramMediaFile.regularAnimatedStickerOrThrow(): RegularAnimatedSticker = this as dev.inmo.tgbotapi.types.files.RegularAnimatedSticker + +public inline fun BaseTelegramMediaFile.ifRegularAnimatedSticker(block: (RegularAnimatedSticker) -> T): T? = regularAnimatedStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.regularVideoStickerOrNull(): RegularVideoSticker? = this as? dev.inmo.tgbotapi.types.files.RegularVideoSticker + +public inline fun BaseTelegramMediaFile.regularVideoStickerOrThrow(): RegularVideoSticker = this as dev.inmo.tgbotapi.types.files.RegularVideoSticker + +public inline fun BaseTelegramMediaFile.ifRegularVideoSticker(block: (RegularVideoSticker) -> T): T? = regularVideoStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.maskStickerOrNull(): MaskSticker? = this as? dev.inmo.tgbotapi.types.files.MaskSticker + +public inline fun BaseTelegramMediaFile.maskStickerOrThrow(): MaskSticker = this as dev.inmo.tgbotapi.types.files.MaskSticker + +public inline fun BaseTelegramMediaFile.ifMaskSticker(block: (MaskSticker) -> T): T? = maskStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.maskSimpleStickerOrNull(): MaskSimpleSticker? = this as? dev.inmo.tgbotapi.types.files.MaskSimpleSticker + +public inline fun BaseTelegramMediaFile.maskSimpleStickerOrThrow(): MaskSimpleSticker = this as dev.inmo.tgbotapi.types.files.MaskSimpleSticker + +public inline fun BaseTelegramMediaFile.ifMaskSimpleSticker(block: (MaskSimpleSticker) -> T): T? = maskSimpleStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.maskAnimatedStickerOrNull(): MaskAnimatedSticker? = this as? dev.inmo.tgbotapi.types.files.MaskAnimatedSticker + +public inline fun BaseTelegramMediaFile.maskAnimatedStickerOrThrow(): MaskAnimatedSticker = this as dev.inmo.tgbotapi.types.files.MaskAnimatedSticker + +public inline fun BaseTelegramMediaFile.ifMaskAnimatedSticker(block: (MaskAnimatedSticker) -> T): T? = maskAnimatedStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.maskVideoStickerOrNull(): MaskVideoSticker? = this as? dev.inmo.tgbotapi.types.files.MaskVideoSticker + +public inline fun BaseTelegramMediaFile.maskVideoStickerOrThrow(): MaskVideoSticker = this as dev.inmo.tgbotapi.types.files.MaskVideoSticker + +public inline fun BaseTelegramMediaFile.ifMaskVideoSticker(block: (MaskVideoSticker) -> T): T? = maskVideoStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.customEmojiStickerOrNull(): CustomEmojiSticker? = this as? dev.inmo.tgbotapi.types.files.CustomEmojiSticker + +public inline fun BaseTelegramMediaFile.customEmojiStickerOrThrow(): CustomEmojiSticker = this as dev.inmo.tgbotapi.types.files.CustomEmojiSticker + +public inline fun BaseTelegramMediaFile.ifCustomEmojiSticker(block: (CustomEmojiSticker) -> T): T? = customEmojiStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.customEmojiSimpleStickerOrNull(): CustomEmojiSimpleSticker? = this as? dev.inmo.tgbotapi.types.files.CustomEmojiSimpleSticker + +public inline fun BaseTelegramMediaFile.customEmojiSimpleStickerOrThrow(): CustomEmojiSimpleSticker = this as dev.inmo.tgbotapi.types.files.CustomEmojiSimpleSticker + +public inline fun BaseTelegramMediaFile.ifCustomEmojiSimpleSticker(block: (CustomEmojiSimpleSticker) -> T): T? = customEmojiSimpleStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.customEmojiAnimatedStickerOrNull(): CustomEmojiAnimatedSticker? = this as? dev.inmo.tgbotapi.types.files.CustomEmojiAnimatedSticker + +public inline fun BaseTelegramMediaFile.customEmojiAnimatedStickerOrThrow(): CustomEmojiAnimatedSticker = this as dev.inmo.tgbotapi.types.files.CustomEmojiAnimatedSticker + +public inline fun BaseTelegramMediaFile.ifCustomEmojiAnimatedSticker(block: (CustomEmojiAnimatedSticker) -> T): T? = customEmojiAnimatedStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.customEmojiVideoStickerOrNull(): CustomEmojiVideoSticker? = this as? dev.inmo.tgbotapi.types.files.CustomEmojiVideoSticker + +public inline fun BaseTelegramMediaFile.customEmojiVideoStickerOrThrow(): CustomEmojiVideoSticker = this as dev.inmo.tgbotapi.types.files.CustomEmojiVideoSticker + +public inline fun BaseTelegramMediaFile.ifCustomEmojiVideoSticker(block: (CustomEmojiVideoSticker) -> T): T? = customEmojiVideoStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.unknownStickerOrNull(): UnknownSticker? = this as? dev.inmo.tgbotapi.types.files.UnknownSticker + +public inline fun BaseTelegramMediaFile.unknownStickerOrThrow(): UnknownSticker = this as dev.inmo.tgbotapi.types.files.UnknownSticker + +public inline fun BaseTelegramMediaFile.ifUnknownSticker(block: (UnknownSticker) -> T): T? = unknownStickerOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.mimedMediaFileOrNull(): MimedMediaFile? = this as? dev.inmo.tgbotapi.types.files.MimedMediaFile + +public inline fun BaseTelegramMediaFile.mimedMediaFileOrThrow(): MimedMediaFile = this as dev.inmo.tgbotapi.types.files.MimedMediaFile + +public inline fun BaseTelegramMediaFile.ifMimedMediaFile(block: (MimedMediaFile) -> T): T? = mimedMediaFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.sizedMediaFileOrNull(): SizedMediaFile? = this as? dev.inmo.tgbotapi.types.files.SizedMediaFile + +public inline fun BaseTelegramMediaFile.sizedMediaFileOrThrow(): SizedMediaFile = this as dev.inmo.tgbotapi.types.files.SizedMediaFile + +public inline fun BaseTelegramMediaFile.ifSizedMediaFile(block: (SizedMediaFile) -> T): T? = sizedMediaFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.coveredMediaFileOrNull(): CoveredMediaFile? = this as? dev.inmo.tgbotapi.types.files.CoveredMediaFile + +public inline fun BaseTelegramMediaFile.coveredMediaFileOrThrow(): CoveredMediaFile = this as dev.inmo.tgbotapi.types.files.CoveredMediaFile + +public inline fun BaseTelegramMediaFile.ifCoveredMediaFile(block: (CoveredMediaFile) -> T): T? = coveredMediaFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.videoNoteFileOrNull(): VideoNoteFile? = this as? dev.inmo.tgbotapi.types.files.VideoNoteFile + +public inline fun BaseTelegramMediaFile.videoNoteFileOrThrow(): VideoNoteFile = this as dev.inmo.tgbotapi.types.files.VideoNoteFile + +public inline fun BaseTelegramMediaFile.ifVideoNoteFile(block: (VideoNoteFile) -> T): T? = videoNoteFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.thumbedMediaFileOrNull(): ThumbedMediaFile? = this as? dev.inmo.tgbotapi.types.files.ThumbedMediaFile + +public inline fun BaseTelegramMediaFile.thumbedMediaFileOrThrow(): ThumbedMediaFile = this as dev.inmo.tgbotapi.types.files.ThumbedMediaFile + +public inline fun BaseTelegramMediaFile.ifThumbedMediaFile(block: (ThumbedMediaFile) -> T): T? = thumbedMediaFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.animationFileOrNull(): AnimationFile? = this as? dev.inmo.tgbotapi.types.files.AnimationFile + +public inline fun BaseTelegramMediaFile.animationFileOrThrow(): AnimationFile = this as dev.inmo.tgbotapi.types.files.AnimationFile + +public inline fun BaseTelegramMediaFile.ifAnimationFile(block: (AnimationFile) -> T): T? = animationFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.telegramMediaFileOrNull(): TelegramMediaFile? = this as? dev.inmo.tgbotapi.types.files.TelegramMediaFile + +public inline fun BaseTelegramMediaFile.telegramMediaFileOrThrow(): TelegramMediaFile = this as dev.inmo.tgbotapi.types.files.TelegramMediaFile + +public inline fun BaseTelegramMediaFile.ifTelegramMediaFile(block: (TelegramMediaFile) -> T): T? = telegramMediaFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.videoFileOrNull(): VideoFile? = this as? dev.inmo.tgbotapi.types.files.VideoFile + +public inline fun BaseTelegramMediaFile.videoFileOrThrow(): VideoFile = this as dev.inmo.tgbotapi.types.files.VideoFile + +public inline fun BaseTelegramMediaFile.ifVideoFile(block: (VideoFile) -> T): T? = videoFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.playableMediaFileOrNull(): PlayableMediaFile? = this as? dev.inmo.tgbotapi.types.files.PlayableMediaFile + +public inline fun BaseTelegramMediaFile.playableMediaFileOrThrow(): PlayableMediaFile = this as dev.inmo.tgbotapi.types.files.PlayableMediaFile + +public inline fun BaseTelegramMediaFile.ifPlayableMediaFile(block: (PlayableMediaFile) -> T): T? = playableMediaFileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.fileOrNull(): File? = this as? dev.inmo.tgbotapi.types.files.File + +public inline fun BaseTelegramMediaFile.fileOrThrow(): File = this as dev.inmo.tgbotapi.types.files.File + +public inline fun BaseTelegramMediaFile.ifFile(block: (File) -> T): T? = fileOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.staticLocationOrNull(): StaticLocation? = this as? dev.inmo.tgbotapi.types.location.StaticLocation + +public inline fun BaseTelegramMediaFile.staticLocationOrThrow(): StaticLocation = this as dev.inmo.tgbotapi.types.location.StaticLocation + +public inline fun BaseTelegramMediaFile.ifStaticLocation(block: (StaticLocation) -> T): T? = staticLocationOrNull() ?.let(block) + +public inline fun BaseTelegramMediaFile.linkOrNull(): Link? = this as? dev.inmo.tgbotapi.types.Link + +public inline fun BaseTelegramMediaFile.linkOrThrow(): Link = this as dev.inmo.tgbotapi.types.Link + +public inline fun BaseTelegramMediaFile.ifLink(block: (Link) -> T): T? = linkOrNull() ?.let(block) + +public inline fun InputPollOptionMedia.telegramMediaLinkOrNull(): TelegramMediaLink? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaLink + +public inline fun InputPollOptionMedia.telegramMediaLinkOrThrow(): TelegramMediaLink = this as dev.inmo.tgbotapi.types.media.TelegramMediaLink + +public inline fun InputPollOptionMedia.ifTelegramMediaLink(block: (TelegramMediaLink) -> T): T? = telegramMediaLinkOrNull() ?.let(block) + +public inline fun InputPollOptionMedia.telegramMediaPhotoOrNull(): TelegramMediaPhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaPhoto + +public inline fun InputPollOptionMedia.telegramMediaPhotoOrThrow(): TelegramMediaPhoto = this as dev.inmo.tgbotapi.types.media.TelegramMediaPhoto + +public inline fun InputPollOptionMedia.ifTelegramMediaPhoto(block: (TelegramMediaPhoto) -> T): T? = telegramMediaPhotoOrNull() ?.let(block) + +public inline fun InputPollOptionMedia.telegramMediaStickerOrNull(): TelegramMediaSticker? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaSticker + +public inline fun InputPollOptionMedia.telegramMediaStickerOrThrow(): TelegramMediaSticker = this as dev.inmo.tgbotapi.types.media.TelegramMediaSticker + +public inline fun InputPollOptionMedia.ifTelegramMediaSticker(block: (TelegramMediaSticker) -> T): T? = telegramMediaStickerOrNull() ?.let(block) + +public inline fun InputPollOptionMedia.telegramMediaVenueOrNull(): TelegramMediaVenue? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaVenue + +public inline fun InputPollOptionMedia.telegramMediaVenueOrThrow(): TelegramMediaVenue = this as dev.inmo.tgbotapi.types.media.TelegramMediaVenue + +public inline fun InputPollOptionMedia.ifTelegramMediaVenue(block: (TelegramMediaVenue) -> T): T? = telegramMediaVenueOrNull() ?.let(block) + +public inline fun InputPollOptionMedia.telegramMediaLocationOrNull(): TelegramMediaLocation? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaLocation + +public inline fun InputPollOptionMedia.telegramMediaLocationOrThrow(): TelegramMediaLocation = this as dev.inmo.tgbotapi.types.media.TelegramMediaLocation + +public inline fun InputPollOptionMedia.ifTelegramMediaLocation(block: (TelegramMediaLocation) -> T): T? = telegramMediaLocationOrNull() ?.let(block) + +public inline fun InputPollOptionMedia.telegramMediaLivePhotoOrNull(): TelegramMediaLivePhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto + +public inline fun InputPollOptionMedia.telegramMediaLivePhotoOrThrow(): TelegramMediaLivePhoto = this as dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto + +public inline fun InputPollOptionMedia.ifTelegramMediaLivePhoto(block: (TelegramMediaLivePhoto) -> T): T? = telegramMediaLivePhotoOrNull() ?.let(block) + +public inline fun InputPollOptionMedia.telegramMediaAnimationOrNull(): TelegramMediaAnimation? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaAnimation + +public inline fun InputPollOptionMedia.telegramMediaAnimationOrThrow(): TelegramMediaAnimation = this as dev.inmo.tgbotapi.types.media.TelegramMediaAnimation + +public inline fun InputPollOptionMedia.ifTelegramMediaAnimation(block: (TelegramMediaAnimation) -> T): T? = telegramMediaAnimationOrNull() ?.let(block) + +public inline fun InputPollOptionMedia.telegramMediaVideoOrNull(): TelegramMediaVideo? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaVideo + +public inline fun InputPollOptionMedia.telegramMediaVideoOrThrow(): TelegramMediaVideo = this as dev.inmo.tgbotapi.types.media.TelegramMediaVideo + +public inline fun InputPollOptionMedia.ifTelegramMediaVideo(block: (TelegramMediaVideo) -> T): T? = telegramMediaVideoOrNull() ?.let(block) + +public inline fun RequestResponse.chatSharedRequestOrNull(): ChatSharedRequest? = this as? dev.inmo.tgbotapi.types.request.ChatSharedRequest + +public inline fun RequestResponse.chatSharedRequestOrThrow(): ChatSharedRequest = this as dev.inmo.tgbotapi.types.request.ChatSharedRequest + +public inline fun RequestResponse.ifChatSharedRequest(block: (ChatSharedRequest) -> T): T? = chatSharedRequestOrNull() ?.let(block) + +public inline fun RequestResponse.chatSharedOrNull(): ChatShared? = this as? dev.inmo.tgbotapi.types.request.ChatShared + +public inline fun RequestResponse.chatSharedOrThrow(): ChatShared = this as dev.inmo.tgbotapi.types.request.ChatShared + +public inline fun RequestResponse.ifChatShared(block: (ChatShared) -> T): T? = chatSharedOrNull() ?.let(block) + +public inline fun RequestResponse.usersSharedOrNull(): UsersShared? = this as? dev.inmo.tgbotapi.types.request.UsersShared + +public inline fun RequestResponse.usersSharedOrThrow(): UsersShared = this as dev.inmo.tgbotapi.types.request.UsersShared + +public inline fun RequestResponse.ifUsersShared(block: (UsersShared) -> T): T? = usersSharedOrNull() ?.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.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 BackgroundType.movableOrNull(): BackgroundType.Movable? = this as? dev.inmo.tgbotapi.types.BackgroundType.Movable @@ -676,396 +1296,6 @@ public inline fun BackgroundType.unknownOrThrow(): BackgroundType.Unknown = this public inline fun BackgroundType.ifUnknown(block: (BackgroundType.Unknown) -> T): T? = unknownOrNull() ?.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.switchInlineQueryChosenChatInlineKeyboardButtonOrNull(): SwitchInlineQueryChosenChatInlineKeyboardButton? = this as? dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryChosenChatInlineKeyboardButton - -public inline fun InlineKeyboardButton.switchInlineQueryChosenChatInlineKeyboardButtonOrThrow(): SwitchInlineQueryChosenChatInlineKeyboardButton = this as dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryChosenChatInlineKeyboardButton - -public inline fun InlineKeyboardButton.ifSwitchInlineQueryChosenChatInlineKeyboardButton(block: (SwitchInlineQueryChosenChatInlineKeyboardButton) -> T): T? = switchInlineQueryChosenChatInlineKeyboardButtonOrNull() ?.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.copyTextButtonOrNull(): CopyTextButton? = this as? dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CopyTextButton - -public inline fun InlineKeyboardButton.copyTextButtonOrThrow(): CopyTextButton = this as dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CopyTextButton - -public inline fun InlineKeyboardButton.ifCopyTextButton(block: (CopyTextButton) -> T): T? = copyTextButtonOrNull() ?.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 KeyboardButtonRequestUsers.anyOrNull(): KeyboardButtonRequestUsers.Any? = this as? dev.inmo.tgbotapi.types.buttons.KeyboardButtonRequestUsers.Any - -public inline fun KeyboardButtonRequestUsers.anyOrThrow(): KeyboardButtonRequestUsers.Any = this as dev.inmo.tgbotapi.types.buttons.KeyboardButtonRequestUsers.Any - -public inline fun KeyboardButtonRequestUsers.ifAny(block: (KeyboardButtonRequestUsers.Any) -> T): T? = anyOrNull() ?.let(block) - -public inline fun KeyboardButtonRequestUsers.commonOrNull(): KeyboardButtonRequestUsers.Common? = this as? dev.inmo.tgbotapi.types.buttons.KeyboardButtonRequestUsers.Common - -public inline fun KeyboardButtonRequestUsers.commonOrThrow(): KeyboardButtonRequestUsers.Common = this as dev.inmo.tgbotapi.types.buttons.KeyboardButtonRequestUsers.Common - -public inline fun KeyboardButtonRequestUsers.ifCommon(block: (KeyboardButtonRequestUsers.Common) -> T): T? = commonOrNull() ?.let(block) - -public inline fun KeyboardButtonRequestUsers.botOrNull(): KeyboardButtonRequestUsers.Bot? = this as? dev.inmo.tgbotapi.types.buttons.KeyboardButtonRequestUsers.Bot - -public inline fun KeyboardButtonRequestUsers.botOrThrow(): KeyboardButtonRequestUsers.Bot = this as dev.inmo.tgbotapi.types.buttons.KeyboardButtonRequestUsers.Bot - -public inline fun KeyboardButtonRequestUsers.ifBot(block: (KeyboardButtonRequestUsers.Bot) -> T): T? = botOrNull() ?.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 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.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.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 Reaction.emojiOrNull(): Reaction.Emoji? = this as? dev.inmo.tgbotapi.types.reactions.Reaction.Emoji - -public inline fun Reaction.emojiOrThrow(): Reaction.Emoji = this as dev.inmo.tgbotapi.types.reactions.Reaction.Emoji - -public inline fun Reaction.ifEmoji(block: (Reaction.Emoji) -> T): T? = emojiOrNull() ?.let(block) - -public inline fun Reaction.customEmojiOrNull(): Reaction.CustomEmoji? = this as? dev.inmo.tgbotapi.types.reactions.Reaction.CustomEmoji - -public inline fun Reaction.customEmojiOrThrow(): Reaction.CustomEmoji = this as dev.inmo.tgbotapi.types.reactions.Reaction.CustomEmoji - -public inline fun Reaction.ifCustomEmoji(block: (Reaction.CustomEmoji) -> T): T? = customEmojiOrNull() ?.let(block) - -public inline fun Reaction.paidOrNull(): Reaction.Paid? = this as? dev.inmo.tgbotapi.types.reactions.Reaction.Paid - -public inline fun Reaction.paidOrThrow(): Reaction.Paid = this as dev.inmo.tgbotapi.types.reactions.Reaction.Paid - -public inline fun Reaction.ifPaid(block: (Reaction.Paid) -> T): T? = paidOrNull() ?.let(block) - -public inline fun Reaction.unknownOrNull(): Reaction.Unknown? = this as? dev.inmo.tgbotapi.types.reactions.Reaction.Unknown - -public inline fun Reaction.unknownOrThrow(): Reaction.Unknown = this as dev.inmo.tgbotapi.types.reactions.Reaction.Unknown - -public inline fun Reaction.ifUnknown(block: (Reaction.Unknown) -> T): T? = unknownOrNull() ?.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.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.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.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.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.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.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.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.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 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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.withCustomizableCaptionInlineQueryResultOrNull(): WithCustomizableCaptionInlineQueryResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithCustomizableCaptionInlineQueryResult - -public inline fun InlineQueryResult.withCustomizableCaptionInlineQueryResultOrThrow(): WithCustomizableCaptionInlineQueryResult = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithCustomizableCaptionInlineQueryResult - -public inline fun InlineQueryResult.ifWithCustomizableCaptionInlineQueryResult(block: (WithCustomizableCaptionInlineQueryResult) -> T): T? = withCustomizableCaptionInlineQueryResultOrNull() ?.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.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.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.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.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.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.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 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.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.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 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.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 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 @@ -1102,6 +1332,282 @@ public inline fun ForwardInfo.fromSupergroupOrThrow(): ForwardInfo.PublicChat.Fr public inline fun ForwardInfo.ifFromSupergroup(block: (ForwardInfo.PublicChat.FromSupergroup) -> T): T? = fromSupergroupOrNull() ?.let(block) +public inline fun 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.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.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.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.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.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 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.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.textedContentOrNull(): TextedContent? = this as? dev.inmo.tgbotapi.types.message.content.TextedContent + +public inline fun ResendableContent.textedContentOrThrow(): TextedContent = this as dev.inmo.tgbotapi.types.message.content.TextedContent + +public inline fun ResendableContent.ifTextedContent(block: (TextedContent) -> T): T? = textedContentOrNull() ?.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.spoilerableMediaContentOrNull(): SpoilerableMediaContent? = this as? dev.inmo.tgbotapi.types.message.content.SpoilerableMediaContent + +public inline fun ResendableContent.spoilerableMediaContentOrThrow(): SpoilerableMediaContent = this as dev.inmo.tgbotapi.types.message.content.SpoilerableMediaContent + +public inline fun ResendableContent.ifSpoilerableMediaContent(block: (SpoilerableMediaContent) -> T): T? = spoilerableMediaContentOrNull() ?.let(block) + +public inline fun ResendableContent.withCustomizedCaptionMediaContentOrNull(): WithCustomizedCaptionMediaContent? = this as? dev.inmo.tgbotapi.types.message.content.WithCustomizedCaptionMediaContent + +public inline fun ResendableContent.withCustomizedCaptionMediaContentOrThrow(): WithCustomizedCaptionMediaContent = this as dev.inmo.tgbotapi.types.message.content.WithCustomizedCaptionMediaContent + +public inline fun ResendableContent.ifWithCustomizedCaptionMediaContent(block: (WithCustomizedCaptionMediaContent) -> T): T? = withCustomizedCaptionMediaContentOrNull() ?.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.storyContentOrNull(): StoryContent? = this as? dev.inmo.tgbotapi.types.message.content.StoryContent + +public inline fun ResendableContent.storyContentOrThrow(): StoryContent = this as dev.inmo.tgbotapi.types.message.content.StoryContent + +public inline fun ResendableContent.ifStoryContent(block: (StoryContent) -> T): T? = storyContentOrNull() ?.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.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.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.checklistContentOrNull(): ChecklistContent? = this as? dev.inmo.tgbotapi.types.message.content.ChecklistContent + +public inline fun ResendableContent.checklistContentOrThrow(): ChecklistContent = this as dev.inmo.tgbotapi.types.message.content.ChecklistContent + +public inline fun ResendableContent.ifChecklistContent(block: (ChecklistContent) -> T): T? = checklistContentOrNull() ?.let(block) + +public inline fun ResendableContent.livePhotoContentOrNull(): LivePhotoContent? = this as? dev.inmo.tgbotapi.types.message.content.LivePhotoContent + +public inline fun ResendableContent.livePhotoContentOrThrow(): LivePhotoContent = this as dev.inmo.tgbotapi.types.message.content.LivePhotoContent + +public inline fun ResendableContent.ifLivePhotoContent(block: (LivePhotoContent) -> T): T? = livePhotoContentOrNull() ?.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.giveawayContentOrNull(): GiveawayContent? = this as? dev.inmo.tgbotapi.types.message.content.GiveawayContent + +public inline fun ResendableContent.giveawayContentOrThrow(): GiveawayContent = this as dev.inmo.tgbotapi.types.message.content.GiveawayContent + +public inline fun ResendableContent.ifGiveawayContent(block: (GiveawayContent) -> T): T? = giveawayContentOrNull() ?.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.paidMediaInfoContentOrNull(): PaidMediaInfoContent? = this as? dev.inmo.tgbotapi.types.message.content.PaidMediaInfoContent + +public inline fun ResendableContent.paidMediaInfoContentOrThrow(): PaidMediaInfoContent = this as dev.inmo.tgbotapi.types.message.content.PaidMediaInfoContent + +public inline fun ResendableContent.ifPaidMediaInfoContent(block: (PaidMediaInfoContent) -> T): T? = paidMediaInfoContentOrNull() ?.let(block) + +public inline fun ResendableContent.giveawayPublicResultsContentOrNull(): GiveawayPublicResultsContent? = this as? dev.inmo.tgbotapi.types.message.content.GiveawayPublicResultsContent + +public inline fun ResendableContent.giveawayPublicResultsContentOrThrow(): GiveawayPublicResultsContent = this as dev.inmo.tgbotapi.types.message.content.GiveawayPublicResultsContent + +public inline fun ResendableContent.ifGiveawayPublicResultsContent(block: (GiveawayPublicResultsContent) -> T): T? = giveawayPublicResultsContentOrNull() ?.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.audioMediaGroupPartContentOrNull(): AudioMediaGroupPartContent? = this as? dev.inmo.tgbotapi.types.message.content.AudioMediaGroupPartContent + +public inline fun ResendableContent.audioMediaGroupPartContentOrThrow(): AudioMediaGroupPartContent = this as dev.inmo.tgbotapi.types.message.content.AudioMediaGroupPartContent + +public inline fun ResendableContent.ifAudioMediaGroupPartContent(block: (AudioMediaGroupPartContent) -> T): T? = audioMediaGroupPartContentOrNull() ?.let(block) + +public inline fun ResendableContent.documentMediaGroupPartContentOrNull(): DocumentMediaGroupPartContent? = this as? dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupPartContent + +public inline fun ResendableContent.documentMediaGroupPartContentOrThrow(): DocumentMediaGroupPartContent = this as dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupPartContent + +public inline fun ResendableContent.ifDocumentMediaGroupPartContent(block: (DocumentMediaGroupPartContent) -> T): T? = documentMediaGroupPartContentOrNull() ?.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.mediaGroupCollectionContentOrNull(): MediaGroupCollectionContent? = this as? dev.inmo.tgbotapi.types.message.content.MediaGroupCollectionContent + +public inline fun ResendableContent.mediaGroupCollectionContentOrThrow(): MediaGroupCollectionContent = this as dev.inmo.tgbotapi.types.message.content.MediaGroupCollectionContent + +public inline fun ResendableContent.ifMediaGroupCollectionContent(block: (MediaGroupCollectionContent) -> T): T? = mediaGroupCollectionContentOrNull() ?.let(block) + +public inline fun ResendableContent.mediaGroupPartContentOrNull(): MediaGroupPartContent? = this as? dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent + +public inline fun ResendableContent.mediaGroupPartContentOrThrow(): MediaGroupPartContent = this as dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent + +public inline fun ResendableContent.ifMediaGroupPartContent(block: (MediaGroupPartContent) -> T): T? = mediaGroupPartContentOrNull() ?.let(block) + +public inline fun ResendableContent.visualMediaGroupPartContentOrNull(): VisualMediaGroupPartContent? = this as? dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent + +public inline fun ResendableContent.visualMediaGroupPartContentOrThrow(): VisualMediaGroupPartContent = this as dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent + +public inline fun ResendableContent.ifVisualMediaGroupPartContent(block: (VisualMediaGroupPartContent) -> T): T? = visualMediaGroupPartContentOrNull() ?.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.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.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 ChatEvent.chatSharedRequestOrNull(): ChatSharedRequest? = this as? dev.inmo.tgbotapi.types.request.ChatSharedRequest + +public inline fun ChatEvent.chatSharedRequestOrThrow(): ChatSharedRequest = this as dev.inmo.tgbotapi.types.request.ChatSharedRequest + +public inline fun ChatEvent.ifChatSharedRequest(block: (ChatSharedRequest) -> T): T? = chatSharedRequestOrNull() ?.let(block) + +public inline fun ChatEvent.chatSharedOrNull(): ChatShared? = this as? dev.inmo.tgbotapi.types.request.ChatShared + +public inline fun ChatEvent.chatSharedOrThrow(): ChatShared = this as dev.inmo.tgbotapi.types.request.ChatShared + +public inline fun ChatEvent.ifChatShared(block: (ChatShared) -> T): T? = chatSharedOrNull() ?.let(block) + +public inline fun ChatEvent.usersSharedOrNull(): UsersShared? = this as? dev.inmo.tgbotapi.types.request.UsersShared + +public inline fun ChatEvent.usersSharedOrThrow(): UsersShared = this as dev.inmo.tgbotapi.types.request.UsersShared + +public inline fun ChatEvent.ifUsersShared(block: (UsersShared) -> T): T? = usersSharedOrNull() ?.let(block) + +public inline fun ChatEvent.giveawayCreatedOrNull(): GiveawayCreated? = this as? dev.inmo.tgbotapi.types.giveaway.GiveawayCreated + +public inline fun ChatEvent.giveawayCreatedOrThrow(): GiveawayCreated = this as dev.inmo.tgbotapi.types.giveaway.GiveawayCreated + +public inline fun ChatEvent.ifGiveawayCreated(block: (GiveawayCreated) -> T): T? = giveawayCreatedOrNull() ?.let(block) + +public inline fun ChatEvent.giveawayCreatedStarsOrNull(): GiveawayCreated.Stars? = this as? dev.inmo.tgbotapi.types.giveaway.GiveawayCreated.Stars + +public inline fun ChatEvent.giveawayCreatedStarsOrThrow(): GiveawayCreated.Stars = this as dev.inmo.tgbotapi.types.giveaway.GiveawayCreated.Stars + +public inline fun ChatEvent.ifGiveawayCreatedStars(block: (GiveawayCreated.Stars) -> T): T? = giveawayCreatedStarsOrNull() ?.let(block) + +public inline fun ChatEvent.giveawayCreatedCompanionOrNull(): GiveawayCreated.Companion? = this as? dev.inmo.tgbotapi.types.giveaway.GiveawayCreated.Companion + +public inline fun ChatEvent.giveawayCreatedCompanionOrThrow(): GiveawayCreated.Companion = this as dev.inmo.tgbotapi.types.giveaway.GiveawayCreated.Companion + +public inline fun ChatEvent.ifGiveawayCreatedCompanion(block: (GiveawayCreated.Companion) -> T): T? = giveawayCreatedCompanionOrNull() ?.let(block) + +public inline fun ChatEvent.giveawayPrivateResultsOrNull(): GiveawayPrivateResults? = this as? dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults + +public inline fun ChatEvent.giveawayPrivateResultsOrThrow(): GiveawayPrivateResults = this as dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults + +public inline fun ChatEvent.ifGiveawayPrivateResults(block: (GiveawayPrivateResults) -> T): T? = giveawayPrivateResultsOrNull() ?.let(block) + +public inline fun ChatEvent.pollOptionAddedOrNull(): PollOptionAdded? = this as? dev.inmo.tgbotapi.types.polls.PollOptionAdded + +public inline fun ChatEvent.pollOptionAddedOrThrow(): PollOptionAdded = this as dev.inmo.tgbotapi.types.polls.PollOptionAdded + +public inline fun ChatEvent.ifPollOptionAdded(block: (PollOptionAdded) -> T): T? = pollOptionAddedOrNull() ?.let(block) + +public inline fun ChatEvent.pollOptionDeletedOrNull(): PollOptionDeleted? = this as? dev.inmo.tgbotapi.types.polls.PollOptionDeleted + +public inline fun ChatEvent.pollOptionDeletedOrThrow(): PollOptionDeleted = this as dev.inmo.tgbotapi.types.polls.PollOptionDeleted + +public inline fun ChatEvent.ifPollOptionDeleted(block: (PollOptionDeleted) -> T): T? = pollOptionDeletedOrNull() ?.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 @@ -1114,29 +1620,77 @@ public inline fun ChatEvent.refundedPaymentEventOrThrow(): RefundedPaymentEvent public inline fun ChatEvent.ifRefundedPaymentEvent(block: (RefundedPaymentEvent) -> T): T? = refundedPaymentEventOrNull() ?.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.chatOwnerLeftOrNull(): ChatOwnerLeft? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.ChatOwnerLeft public inline fun ChatEvent.chatOwnerLeftOrThrow(): ChatOwnerLeft = this as dev.inmo.tgbotapi.types.message.ChatEvents.ChatOwnerLeft public inline fun ChatEvent.ifChatOwnerLeft(block: (ChatOwnerLeft) -> T): T? = chatOwnerLeftOrNull() ?.let(block) +public inline fun ChatEvent.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.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.newChatMembersOrNull(): NewChatMembers? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.NewChatMembers +public inline fun ChatEvent.leftChatMemberEventOrNull(): LeftChatMemberEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent -public inline fun ChatEvent.newChatMembersOrThrow(): NewChatMembers = this as dev.inmo.tgbotapi.types.message.ChatEvents.NewChatMembers +public inline fun ChatEvent.leftChatMemberEventOrThrow(): LeftChatMemberEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent -public inline fun ChatEvent.ifNewChatMembers(block: (NewChatMembers) -> T): T? = newChatMembersOrNull() ?.let(block) +public inline fun ChatEvent.ifLeftChatMemberEvent(block: (LeftChatMemberEvent) -> T): T? = leftChatMemberEventOrNull() ?.let(block) -public inline fun ChatEvent.generalForumTopicUnhiddenOrNull(): GeneralForumTopicUnhidden? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden +public inline fun ChatEvent.videoChatEndedOrNull(): VideoChatEnded? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatEnded -public inline fun ChatEvent.generalForumTopicUnhiddenOrThrow(): GeneralForumTopicUnhidden = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden +public inline fun ChatEvent.videoChatEndedOrThrow(): VideoChatEnded = this as dev.inmo.tgbotapi.types.message.ChatEvents.voice.VideoChatEnded -public inline fun ChatEvent.ifGeneralForumTopicUnhidden(block: (GeneralForumTopicUnhidden) -> T): T? = generalForumTopicUnhiddenOrNull() ?.let(block) +public inline fun ChatEvent.ifVideoChatEnded(block: (VideoChatEnded) -> T): T? = videoChatEndedOrNull() ?.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.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.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.forumTopicEditedOrNull(): ForumTopicEdited? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicEdited + +public inline fun ChatEvent.forumTopicEditedOrThrow(): ForumTopicEdited = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicEdited + +public inline fun ChatEvent.ifForumTopicEdited(block: (ForumTopicEdited) -> T): T? = forumTopicEditedOrNull() ?.let(block) + +public inline fun ChatEvent.forumTopicClosedOrNull(): ForumTopicClosed? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed + +public inline fun ChatEvent.forumTopicClosedOrThrow(): ForumTopicClosed = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed + +public inline fun ChatEvent.ifForumTopicClosed(block: (ForumTopicClosed) -> T): T? = forumTopicClosedOrNull() ?.let(block) public inline fun ChatEvent.forumTopicCreatedOrNull(): ForumTopicCreated? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicCreated @@ -1144,12 +1698,24 @@ public inline fun ChatEvent.forumTopicCreatedOrThrow(): ForumTopicCreated = this public inline fun ChatEvent.ifForumTopicCreated(block: (ForumTopicCreated) -> T): T? = forumTopicCreatedOrNull() ?.let(block) +public inline fun ChatEvent.generalForumTopicUnhiddenOrNull(): GeneralForumTopicUnhidden? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden + +public inline fun ChatEvent.generalForumTopicUnhiddenOrThrow(): GeneralForumTopicUnhidden = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicUnhidden + +public inline fun ChatEvent.ifGeneralForumTopicUnhidden(block: (GeneralForumTopicUnhidden) -> T): T? = generalForumTopicUnhiddenOrNull() ?.let(block) + public inline fun ChatEvent.forumTopicReopenedOrNull(): ForumTopicReopened? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened public inline fun ChatEvent.forumTopicReopenedOrThrow(): ForumTopicReopened = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicReopened public inline fun ChatEvent.ifForumTopicReopened(block: (ForumTopicReopened) -> T): T? = forumTopicReopenedOrNull() ?.let(block) +public inline fun ChatEvent.generalForumTopicHiddenOrNull(): GeneralForumTopicHidden? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden + +public inline fun ChatEvent.generalForumTopicHiddenOrThrow(): GeneralForumTopicHidden = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden + +public inline fun ChatEvent.ifGeneralForumTopicHidden(block: (GeneralForumTopicHidden) -> T): T? = generalForumTopicHiddenOrNull() ?.let(block) + public inline fun ChatEvent.writeAccessAllowedOrNull(): WriteAccessAllowed? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed public inline fun ChatEvent.writeAccessAllowedOrThrow(): WriteAccessAllowed = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.WriteAccessAllowed @@ -1180,23 +1746,11 @@ public inline fun ChatEvent.writeAccessAllowedFromAttachmentMenuOrThrow(): Write public inline fun ChatEvent.ifWriteAccessAllowedFromAttachmentMenu(block: (WriteAccessAllowed.FromAttachmentMenu) -> T): T? = writeAccessAllowedFromAttachmentMenuOrNull() ?.let(block) -public inline fun ChatEvent.forumTopicClosedOrNull(): ForumTopicClosed? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed +public inline fun ChatEvent.newChatMembersOrNull(): NewChatMembers? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.NewChatMembers -public inline fun ChatEvent.forumTopicClosedOrThrow(): ForumTopicClosed = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicClosed +public inline fun ChatEvent.newChatMembersOrThrow(): NewChatMembers = this as dev.inmo.tgbotapi.types.message.ChatEvents.NewChatMembers -public inline fun ChatEvent.ifForumTopicClosed(block: (ForumTopicClosed) -> T): T? = forumTopicClosedOrNull() ?.let(block) - -public inline fun ChatEvent.generalForumTopicHiddenOrNull(): GeneralForumTopicHidden? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden - -public inline fun ChatEvent.generalForumTopicHiddenOrThrow(): GeneralForumTopicHidden = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.GeneralForumTopicHidden - -public inline fun ChatEvent.ifGeneralForumTopicHidden(block: (GeneralForumTopicHidden) -> T): T? = generalForumTopicHiddenOrNull() ?.let(block) - -public inline fun ChatEvent.forumTopicEditedOrNull(): ForumTopicEdited? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicEdited - -public inline fun ChatEvent.forumTopicEditedOrThrow(): ForumTopicEdited = this as dev.inmo.tgbotapi.types.message.ChatEvents.forum.ForumTopicEdited - -public inline fun ChatEvent.ifForumTopicEdited(block: (ForumTopicEdited) -> T): T? = forumTopicEditedOrNull() ?.let(block) +public inline fun ChatEvent.ifNewChatMembers(block: (NewChatMembers) -> T): T? = newChatMembersOrNull() ?.let(block) public inline fun ChatEvent.chatBoostAddedOrNull(): ChatBoostAdded? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.ChatBoostAdded @@ -1204,167 +1758,11 @@ public inline fun ChatEvent.chatBoostAddedOrThrow(): ChatBoostAdded = this as de public inline fun ChatEvent.ifChatBoostAdded(block: (ChatBoostAdded) -> T): T? = chatBoostAddedOrNull() ?.let(block) -public inline fun ChatEvent.newChatPhotoOrNull(): NewChatPhoto? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.NewChatPhoto +public inline fun ChatEvent.suggestedPostApprovalFailedOrNull(): SuggestedPostApprovalFailed? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed -public inline fun ChatEvent.newChatPhotoOrThrow(): NewChatPhoto = this as dev.inmo.tgbotapi.types.message.ChatEvents.NewChatPhoto +public inline fun ChatEvent.suggestedPostApprovalFailedOrThrow(): SuggestedPostApprovalFailed = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed -public inline fun ChatEvent.ifNewChatPhoto(block: (NewChatPhoto) -> T): T? = newChatPhotoOrNull() ?.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.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.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.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.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.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.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.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.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.chatOwnerChangedOrNull(): ChatOwnerChanged? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.ChatOwnerChanged - -public inline fun ChatEvent.chatOwnerChangedOrThrow(): ChatOwnerChanged = this as dev.inmo.tgbotapi.types.message.ChatEvents.ChatOwnerChanged - -public inline fun ChatEvent.ifChatOwnerChanged(block: (ChatOwnerChanged) -> T): T? = chatOwnerChangedOrNull() ?.let(block) - -public inline fun ChatEvent.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.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.privateForumEventOrNull(): PrivateForumEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateForumEvent - -public inline fun ChatEvent.privateForumEventOrThrow(): PrivateForumEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateForumEvent - -public inline fun ChatEvent.ifPrivateForumEvent(block: (PrivateForumEvent) -> T): T? = privateForumEventOrNull() ?.let(block) - -public inline fun ChatEvent.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.forumEventOrNull(): ForumEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ForumEvent - -public inline fun ChatEvent.forumEventOrThrow(): ForumEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ForumEvent - -public inline fun ChatEvent.ifForumEvent(block: (ForumEvent) -> T): T? = forumEventOrNull() ?.let(block) - -public inline fun ChatEvent.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.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.channelDirectMessagesEventOrNull(): ChannelDirectMessagesEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent - -public inline fun ChatEvent.channelDirectMessagesEventOrThrow(): ChannelDirectMessagesEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent - -public inline fun ChatEvent.ifChannelDirectMessagesEvent(block: (ChannelDirectMessagesEvent) -> T): T? = channelDirectMessagesEventOrNull() ?.let(block) - -public inline fun ChatEvent.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.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.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.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.suggestedPostDeclinedOrNull(): SuggestedPostDeclined? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined - -public inline fun ChatEvent.suggestedPostDeclinedOrThrow(): SuggestedPostDeclined = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined - -public inline fun ChatEvent.ifSuggestedPostDeclined(block: (SuggestedPostDeclined) -> T): T? = suggestedPostDeclinedOrNull() ?.let(block) - -public inline fun ChatEvent.suggestedPostApprovedOrNull(): SuggestedPostApproved? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved - -public inline fun ChatEvent.suggestedPostApprovedOrThrow(): SuggestedPostApproved = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved - -public inline fun ChatEvent.ifSuggestedPostApproved(block: (SuggestedPostApproved) -> T): T? = suggestedPostApprovedOrNull() ?.let(block) - -public inline fun ChatEvent.suggestedPostRefundedOrNull(): SuggestedPostRefunded? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded - -public inline fun ChatEvent.suggestedPostRefundedOrThrow(): SuggestedPostRefunded = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded - -public inline fun ChatEvent.ifSuggestedPostRefunded(block: (SuggestedPostRefunded) -> T): T? = suggestedPostRefundedOrNull() ?.let(block) +public inline fun ChatEvent.ifSuggestedPostApprovalFailed(block: (SuggestedPostApprovalFailed) -> T): T? = suggestedPostApprovalFailedOrNull() ?.let(block) public inline fun ChatEvent.suggestedPostPaidOrNull(): SuggestedPostPaid? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostPaid @@ -1390,23 +1788,29 @@ public inline fun ChatEvent.suggestedPostPaidOtherOrThrow(): SuggestedPostPaid.O public inline fun ChatEvent.ifSuggestedPostPaidOther(block: (SuggestedPostPaid.Other) -> T): T? = suggestedPostPaidOtherOrNull() ?.let(block) -public inline fun ChatEvent.suggestedPostApprovalFailedOrNull(): SuggestedPostApprovalFailed? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed +public inline fun ChatEvent.suggestedPostDeclinedOrNull(): SuggestedPostDeclined? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined -public inline fun ChatEvent.suggestedPostApprovalFailedOrThrow(): SuggestedPostApprovalFailed = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApprovalFailed +public inline fun ChatEvent.suggestedPostDeclinedOrThrow(): SuggestedPostDeclined = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostDeclined -public inline fun ChatEvent.ifSuggestedPostApprovalFailed(block: (SuggestedPostApprovalFailed) -> T): T? = suggestedPostApprovalFailedOrNull() ?.let(block) +public inline fun ChatEvent.ifSuggestedPostDeclined(block: (SuggestedPostDeclined) -> T): T? = suggestedPostDeclinedOrNull() ?.let(block) -public inline fun ChatEvent.deleteChatPhotoOrNull(): DeleteChatPhoto? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.DeleteChatPhoto +public inline fun ChatEvent.suggestedPostApprovedOrNull(): SuggestedPostApproved? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved -public inline fun ChatEvent.deleteChatPhotoOrThrow(): DeleteChatPhoto = this as dev.inmo.tgbotapi.types.message.ChatEvents.DeleteChatPhoto +public inline fun ChatEvent.suggestedPostApprovedOrThrow(): SuggestedPostApproved = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostApproved -public inline fun ChatEvent.ifDeleteChatPhoto(block: (DeleteChatPhoto) -> T): T? = deleteChatPhotoOrNull() ?.let(block) +public inline fun ChatEvent.ifSuggestedPostApproved(block: (SuggestedPostApproved) -> T): T? = suggestedPostApprovedOrNull() ?.let(block) -public inline fun ChatEvent.messageAutoDeleteTimerChangedOrNull(): MessageAutoDeleteTimerChanged? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.MessageAutoDeleteTimerChanged +public inline fun ChatEvent.suggestedPostRefundedOrNull(): SuggestedPostRefunded? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded -public inline fun ChatEvent.messageAutoDeleteTimerChangedOrThrow(): MessageAutoDeleteTimerChanged = this as dev.inmo.tgbotapi.types.message.ChatEvents.MessageAutoDeleteTimerChanged +public inline fun ChatEvent.suggestedPostRefundedOrThrow(): SuggestedPostRefunded = this as dev.inmo.tgbotapi.types.message.ChatEvents.suggested.SuggestedPostRefunded -public inline fun ChatEvent.ifMessageAutoDeleteTimerChanged(block: (MessageAutoDeleteTimerChanged) -> T): T? = messageAutoDeleteTimerChangedOrNull() ?.let(block) +public inline fun ChatEvent.ifSuggestedPostRefunded(block: (SuggestedPostRefunded) -> T): T? = suggestedPostRefundedOrNull() ?.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.channelChatCreatedOrNull(): ChannelChatCreated? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.ChannelChatCreated @@ -1414,65 +1818,137 @@ public inline fun ChatEvent.channelChatCreatedOrThrow(): ChannelChatCreated = th public inline fun ChatEvent.ifChannelChatCreated(block: (ChannelChatCreated) -> T): T? = channelChatCreatedOrNull() ?.let(block) -public inline fun ChatEvent.pollOptionDeletedOrNull(): PollOptionDeleted? = this as? dev.inmo.tgbotapi.types.polls.PollOptionDeleted +public inline fun ChatEvent.newChatPhotoOrNull(): NewChatPhoto? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.NewChatPhoto -public inline fun ChatEvent.pollOptionDeletedOrThrow(): PollOptionDeleted = this as dev.inmo.tgbotapi.types.polls.PollOptionDeleted +public inline fun ChatEvent.newChatPhotoOrThrow(): NewChatPhoto = this as dev.inmo.tgbotapi.types.message.ChatEvents.NewChatPhoto -public inline fun ChatEvent.ifPollOptionDeleted(block: (PollOptionDeleted) -> T): T? = pollOptionDeletedOrNull() ?.let(block) +public inline fun ChatEvent.ifNewChatPhoto(block: (NewChatPhoto) -> T): T? = newChatPhotoOrNull() ?.let(block) -public inline fun ChatEvent.pollOptionAddedOrNull(): PollOptionAdded? = this as? dev.inmo.tgbotapi.types.polls.PollOptionAdded +public inline fun ChatEvent.webAppDataOrNull(): WebAppData? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.WebAppData -public inline fun ChatEvent.pollOptionAddedOrThrow(): PollOptionAdded = this as dev.inmo.tgbotapi.types.polls.PollOptionAdded +public inline fun ChatEvent.webAppDataOrThrow(): WebAppData = this as dev.inmo.tgbotapi.types.message.ChatEvents.WebAppData -public inline fun ChatEvent.ifPollOptionAdded(block: (PollOptionAdded) -> T): T? = pollOptionAddedOrNull() ?.let(block) +public inline fun ChatEvent.ifWebAppData(block: (WebAppData) -> T): T? = webAppDataOrNull() ?.let(block) -public inline fun ChatEvent.giveawayCreatedOrNull(): GiveawayCreated? = this as? dev.inmo.tgbotapi.types.giveaway.GiveawayCreated +public inline fun ChatEvent.videoChatEventOrNull(): VideoChatEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.VideoChatEvent -public inline fun ChatEvent.giveawayCreatedOrThrow(): GiveawayCreated = this as dev.inmo.tgbotapi.types.giveaway.GiveawayCreated +public inline fun ChatEvent.videoChatEventOrThrow(): VideoChatEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.VideoChatEvent -public inline fun ChatEvent.ifGiveawayCreated(block: (GiveawayCreated) -> T): T? = giveawayCreatedOrNull() ?.let(block) +public inline fun ChatEvent.ifVideoChatEvent(block: (VideoChatEvent) -> T): T? = videoChatEventOrNull() ?.let(block) -public inline fun ChatEvent.giveawayCreatedStarsOrNull(): GiveawayCreated.Stars? = this as? dev.inmo.tgbotapi.types.giveaway.GiveawayCreated.Stars +public inline fun ChatEvent.groupEventOrNull(): GroupEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.GroupEvent -public inline fun ChatEvent.giveawayCreatedStarsOrThrow(): GiveawayCreated.Stars = this as dev.inmo.tgbotapi.types.giveaway.GiveawayCreated.Stars +public inline fun ChatEvent.groupEventOrThrow(): GroupEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.GroupEvent -public inline fun ChatEvent.ifGiveawayCreatedStars(block: (GiveawayCreated.Stars) -> T): T? = giveawayCreatedStarsOrNull() ?.let(block) +public inline fun ChatEvent.ifGroupEvent(block: (GroupEvent) -> T): T? = groupEventOrNull() ?.let(block) -public inline fun ChatEvent.giveawayCreatedCompanionOrNull(): GiveawayCreated.Companion? = this as? dev.inmo.tgbotapi.types.giveaway.GiveawayCreated.Companion +public inline fun ChatEvent.forumEventOrNull(): ForumEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ForumEvent -public inline fun ChatEvent.giveawayCreatedCompanionOrThrow(): GiveawayCreated.Companion = this as dev.inmo.tgbotapi.types.giveaway.GiveawayCreated.Companion +public inline fun ChatEvent.forumEventOrThrow(): ForumEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ForumEvent -public inline fun ChatEvent.ifGiveawayCreatedCompanion(block: (GiveawayCreated.Companion) -> T): T? = giveawayCreatedCompanionOrNull() ?.let(block) +public inline fun ChatEvent.ifForumEvent(block: (ForumEvent) -> T): T? = forumEventOrNull() ?.let(block) -public inline fun ChatEvent.giveawayPrivateResultsOrNull(): GiveawayPrivateResults? = this as? dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults +public inline fun ChatEvent.privateEventOrNull(): PrivateEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateEvent -public inline fun ChatEvent.giveawayPrivateResultsOrThrow(): GiveawayPrivateResults = this as dev.inmo.tgbotapi.types.giveaway.GiveawayPrivateResults +public inline fun ChatEvent.privateEventOrThrow(): PrivateEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateEvent -public inline fun ChatEvent.ifGiveawayPrivateResults(block: (GiveawayPrivateResults) -> T): T? = giveawayPrivateResultsOrNull() ?.let(block) +public inline fun ChatEvent.ifPrivateEvent(block: (PrivateEvent) -> T): T? = privateEventOrNull() ?.let(block) -public inline fun ChatEvent.managedBotCreatedOrNull(): ManagedBotCreated? = this as? dev.inmo.tgbotapi.types.managed_bots.ManagedBotCreated +public inline fun ChatEvent.privateForumEventOrNull(): PrivateForumEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateForumEvent -public inline fun ChatEvent.managedBotCreatedOrThrow(): ManagedBotCreated = this as dev.inmo.tgbotapi.types.managed_bots.ManagedBotCreated +public inline fun ChatEvent.privateForumEventOrThrow(): PrivateForumEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateForumEvent -public inline fun ChatEvent.ifManagedBotCreated(block: (ManagedBotCreated) -> T): T? = managedBotCreatedOrNull() ?.let(block) +public inline fun ChatEvent.ifPrivateForumEvent(block: (PrivateForumEvent) -> T): T? = privateForumEventOrNull() ?.let(block) -public inline fun ChatEvent.usersSharedOrNull(): UsersShared? = this as? dev.inmo.tgbotapi.types.request.UsersShared +public inline fun ChatEvent.channelEventOrNull(): ChannelEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelEvent -public inline fun ChatEvent.usersSharedOrThrow(): UsersShared = this as dev.inmo.tgbotapi.types.request.UsersShared +public inline fun ChatEvent.channelEventOrThrow(): ChannelEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelEvent -public inline fun ChatEvent.ifUsersShared(block: (UsersShared) -> T): T? = usersSharedOrNull() ?.let(block) +public inline fun ChatEvent.ifChannelEvent(block: (ChannelEvent) -> T): T? = channelEventOrNull() ?.let(block) -public inline fun ChatEvent.chatSharedOrNull(): ChatShared? = this as? dev.inmo.tgbotapi.types.request.ChatShared +public inline fun ChatEvent.publicChatEventOrNull(): PublicChatEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PublicChatEvent -public inline fun ChatEvent.chatSharedOrThrow(): ChatShared = this as dev.inmo.tgbotapi.types.request.ChatShared +public inline fun ChatEvent.publicChatEventOrThrow(): PublicChatEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PublicChatEvent -public inline fun ChatEvent.ifChatShared(block: (ChatShared) -> T): T? = chatSharedOrNull() ?.let(block) +public inline fun ChatEvent.ifPublicChatEvent(block: (PublicChatEvent) -> T): T? = publicChatEventOrNull() ?.let(block) -public inline fun ChatEvent.chatSharedRequestOrNull(): ChatSharedRequest? = this as? dev.inmo.tgbotapi.types.request.ChatSharedRequest +public inline fun ChatEvent.commonEventOrNull(): CommonEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent -public inline fun ChatEvent.chatSharedRequestOrThrow(): ChatSharedRequest = this as dev.inmo.tgbotapi.types.request.ChatSharedRequest +public inline fun ChatEvent.commonEventOrThrow(): CommonEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.CommonEvent -public inline fun ChatEvent.ifChatSharedRequest(block: (ChatSharedRequest) -> T): T? = chatSharedRequestOrNull() ?.let(block) +public inline fun ChatEvent.ifCommonEvent(block: (CommonEvent) -> T): T? = commonEventOrNull() ?.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.channelDirectMessagesEventOrNull(): ChannelDirectMessagesEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent + +public inline fun ChatEvent.channelDirectMessagesEventOrThrow(): ChannelDirectMessagesEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelDirectMessagesEvent + +public inline fun ChatEvent.ifChannelDirectMessagesEvent(block: (ChannelDirectMessagesEvent) -> T): T? = channelDirectMessagesEventOrNull() ?.let(block) + +public inline fun ChatEvent.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.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.chatOwnerChangedOrNull(): ChatOwnerChanged? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.ChatOwnerChanged + +public inline fun ChatEvent.chatOwnerChangedOrThrow(): ChatOwnerChanged = this as dev.inmo.tgbotapi.types.message.ChatEvents.ChatOwnerChanged + +public inline fun ChatEvent.ifChatOwnerChanged(block: (ChatOwnerChanged) -> T): T? = chatOwnerChangedOrNull() ?.let(block) + +public inline fun ChatEvent.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.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.directMessagesConfigurationChangedOrNull(): DirectMessagesConfigurationChanged? = this as? dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged + +public inline fun ChatEvent.directMessagesConfigurationChangedOrThrow(): DirectMessagesConfigurationChanged = this as dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged + +public inline fun ChatEvent.ifDirectMessagesConfigurationChanged(block: (DirectMessagesConfigurationChanged) -> T): T? = directMessagesConfigurationChangedOrNull() ?.let(block) + +public inline fun ChatEvent.directMessagesConfigurationChangedDisabledOrNull(): DirectMessagesConfigurationChanged.Disabled? = this as? dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Disabled + +public inline fun ChatEvent.directMessagesConfigurationChangedDisabledOrThrow(): DirectMessagesConfigurationChanged.Disabled = this as dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Disabled + +public inline fun ChatEvent.ifDirectMessagesConfigurationChangedDisabled(block: (DirectMessagesConfigurationChanged.Disabled) -> T): T? = directMessagesConfigurationChangedDisabledOrNull() ?.let(block) + +public inline fun ChatEvent.directMessagesConfigurationChangedFreeOrNull(): DirectMessagesConfigurationChanged.Free? = this as? dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Free + +public inline fun ChatEvent.directMessagesConfigurationChangedFreeOrThrow(): DirectMessagesConfigurationChanged.Free = this as dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Free + +public inline fun ChatEvent.ifDirectMessagesConfigurationChangedFree(block: (DirectMessagesConfigurationChanged.Free) -> T): T? = directMessagesConfigurationChangedFreeOrNull() ?.let(block) + +public inline fun ChatEvent.directMessagesConfigurationChangedPaidOrNull(): DirectMessagesConfigurationChanged.Paid? = this as? dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Paid + +public inline fun ChatEvent.directMessagesConfigurationChangedPaidOrThrow(): DirectMessagesConfigurationChanged.Paid = this as dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Paid + +public inline fun ChatEvent.ifDirectMessagesConfigurationChangedPaid(block: (DirectMessagesConfigurationChanged.Paid) -> T): T? = directMessagesConfigurationChangedPaidOrNull() ?.let(block) + +public inline fun ChatEvent.paidMessagePriceChangedOrNull(): PaidMessagePriceChanged? = this as? dev.inmo.tgbotapi.types.PaidMessagePriceChanged + +public inline fun ChatEvent.paidMessagePriceChangedOrThrow(): PaidMessagePriceChanged = this as dev.inmo.tgbotapi.types.PaidMessagePriceChanged + +public inline fun ChatEvent.ifPaidMessagePriceChanged(block: (PaidMessagePriceChanged) -> T): T? = paidMessagePriceChangedOrNull() ?.let(block) public inline fun ChatEvent.giftSentOrReceivedEventOrNull(): GiftSentOrReceivedEvent? = this as? dev.inmo.tgbotapi.types.gifts.GiftSentOrReceivedEvent @@ -1522,35 +1998,11 @@ public inline fun ChatEvent.giftSentOrReceivedEventUniqueGiftReceivedInBusinessA public inline fun ChatEvent.ifGiftSentOrReceivedEventUniqueGiftReceivedInBusinessAccount(block: (GiftSentOrReceivedEvent.UniqueGift.ReceivedInBusinessAccount) -> T): T? = giftSentOrReceivedEventUniqueGiftReceivedInBusinessAccountOrNull() ?.let(block) -public inline fun ChatEvent.chatBackgroundOrNull(): ChatBackground? = this as? dev.inmo.tgbotapi.types.chat.ChatBackground +public inline fun ChatEvent.checklistTasksAddedOrNull(): ChecklistTasksAdded? = this as? dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded -public inline fun ChatEvent.chatBackgroundOrThrow(): ChatBackground = this as dev.inmo.tgbotapi.types.chat.ChatBackground +public inline fun ChatEvent.checklistTasksAddedOrThrow(): ChecklistTasksAdded = this as dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded -public inline fun ChatEvent.ifChatBackground(block: (ChatBackground) -> T): T? = chatBackgroundOrNull() ?.let(block) - -public inline fun ChatEvent.directMessagesConfigurationChangedOrNull(): DirectMessagesConfigurationChanged? = this as? dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged - -public inline fun ChatEvent.directMessagesConfigurationChangedOrThrow(): DirectMessagesConfigurationChanged = this as dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged - -public inline fun ChatEvent.ifDirectMessagesConfigurationChanged(block: (DirectMessagesConfigurationChanged) -> T): T? = directMessagesConfigurationChangedOrNull() ?.let(block) - -public inline fun ChatEvent.directMessagesConfigurationChangedDisabledOrNull(): DirectMessagesConfigurationChanged.Disabled? = this as? dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Disabled - -public inline fun ChatEvent.directMessagesConfigurationChangedDisabledOrThrow(): DirectMessagesConfigurationChanged.Disabled = this as dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Disabled - -public inline fun ChatEvent.ifDirectMessagesConfigurationChangedDisabled(block: (DirectMessagesConfigurationChanged.Disabled) -> T): T? = directMessagesConfigurationChangedDisabledOrNull() ?.let(block) - -public inline fun ChatEvent.directMessagesConfigurationChangedFreeOrNull(): DirectMessagesConfigurationChanged.Free? = this as? dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Free - -public inline fun ChatEvent.directMessagesConfigurationChangedFreeOrThrow(): DirectMessagesConfigurationChanged.Free = this as dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Free - -public inline fun ChatEvent.ifDirectMessagesConfigurationChangedFree(block: (DirectMessagesConfigurationChanged.Free) -> T): T? = directMessagesConfigurationChangedFreeOrNull() ?.let(block) - -public inline fun ChatEvent.directMessagesConfigurationChangedPaidOrNull(): DirectMessagesConfigurationChanged.Paid? = this as? dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Paid - -public inline fun ChatEvent.directMessagesConfigurationChangedPaidOrThrow(): DirectMessagesConfigurationChanged.Paid = this as dev.inmo.tgbotapi.types.DirectMessagesConfigurationChanged.Paid - -public inline fun ChatEvent.ifDirectMessagesConfigurationChangedPaid(block: (DirectMessagesConfigurationChanged.Paid) -> T): T? = directMessagesConfigurationChangedPaidOrNull() ?.let(block) +public inline fun ChatEvent.ifChecklistTasksAdded(block: (ChecklistTasksAdded) -> T): T? = checklistTasksAddedOrNull() ?.let(block) public inline fun ChatEvent.checklistTasksDoneOrNull(): ChecklistTasksDone? = this as? dev.inmo.tgbotapi.types.checklists.ChecklistTasksDone @@ -1558,17 +2010,155 @@ public inline fun ChatEvent.checklistTasksDoneOrThrow(): ChecklistTasksDone = th public inline fun ChatEvent.ifChecklistTasksDone(block: (ChecklistTasksDone) -> T): T? = checklistTasksDoneOrNull() ?.let(block) -public inline fun ChatEvent.checklistTasksAddedOrNull(): ChecklistTasksAdded? = this as? dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded +public inline fun ChatEvent.managedBotCreatedOrNull(): ManagedBotCreated? = this as? dev.inmo.tgbotapi.types.managed_bots.ManagedBotCreated -public inline fun ChatEvent.checklistTasksAddedOrThrow(): ChecklistTasksAdded = this as dev.inmo.tgbotapi.types.checklists.ChecklistTasksAdded +public inline fun ChatEvent.managedBotCreatedOrThrow(): ManagedBotCreated = this as dev.inmo.tgbotapi.types.managed_bots.ManagedBotCreated -public inline fun ChatEvent.ifChecklistTasksAdded(block: (ChecklistTasksAdded) -> T): T? = checklistTasksAddedOrNull() ?.let(block) +public inline fun ChatEvent.ifManagedBotCreated(block: (ManagedBotCreated) -> T): T? = managedBotCreatedOrNull() ?.let(block) -public inline fun ChatEvent.paidMessagePriceChangedOrNull(): PaidMessagePriceChanged? = this as? dev.inmo.tgbotapi.types.PaidMessagePriceChanged +public inline fun ChatEvent.chatBackgroundOrNull(): ChatBackground? = this as? dev.inmo.tgbotapi.types.chat.ChatBackground -public inline fun ChatEvent.paidMessagePriceChangedOrThrow(): PaidMessagePriceChanged = this as dev.inmo.tgbotapi.types.PaidMessagePriceChanged +public inline fun ChatEvent.chatBackgroundOrThrow(): ChatBackground = this as dev.inmo.tgbotapi.types.chat.ChatBackground -public inline fun ChatEvent.ifPaidMessagePriceChanged(block: (PaidMessagePriceChanged) -> T): T? = paidMessagePriceChangedOrNull() ?.let(block) +public inline fun ChatEvent.ifChatBackground(block: (ChatBackground) -> T): T? = chatBackgroundOrNull() ?.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.expandableBlockquoteTextSourceOrNull(): ExpandableBlockquoteTextSource? = this as? dev.inmo.tgbotapi.types.message.textsources.ExpandableBlockquoteTextSource + +public inline fun TextSource.expandableBlockquoteTextSourceOrThrow(): ExpandableBlockquoteTextSource = this as dev.inmo.tgbotapi.types.message.textsources.ExpandableBlockquoteTextSource + +public inline fun TextSource.ifExpandableBlockquoteTextSource(block: (ExpandableBlockquoteTextSource) -> T): T? = expandableBlockquoteTextSourceOrNull() ?.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.dateTimeTextSourceOrNull(): DateTimeTextSource? = this as? dev.inmo.tgbotapi.types.message.textsources.DateTimeTextSource + +public inline fun TextSource.dateTimeTextSourceOrThrow(): DateTimeTextSource = this as dev.inmo.tgbotapi.types.message.textsources.DateTimeTextSource + +public inline fun TextSource.ifDateTimeTextSource(block: (DateTimeTextSource) -> T): T? = dateTimeTextSourceOrNull() ?.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.blockquoteTextSourceOrNull(): BlockquoteTextSource? = this as? dev.inmo.tgbotapi.types.message.textsources.BlockquoteTextSource + +public inline fun TextSource.blockquoteTextSourceOrThrow(): BlockquoteTextSource = this as dev.inmo.tgbotapi.types.message.textsources.BlockquoteTextSource + +public inline fun TextSource.ifBlockquoteTextSource(block: (BlockquoteTextSource) -> T): T? = blockquoteTextSourceOrNull() ?.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.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.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.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 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.customEmojiTextSourceOrNull(): CustomEmojiTextSource? = this as? dev.inmo.tgbotapi.types.message.textsources.CustomEmojiTextSource + +public inline fun TextSource.customEmojiTextSourceOrThrow(): CustomEmojiTextSource = this as dev.inmo.tgbotapi.types.message.textsources.CustomEmojiTextSource + +public inline fun TextSource.ifCustomEmojiTextSource(block: (CustomEmojiTextSource) -> T): T? = customEmojiTextSourceOrNull() ?.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.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.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.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.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.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.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.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.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 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.channelEventMessageOrNull(): ChannelEventMessage? = this as? dev.inmo.tgbotapi.types.message.ChannelEventMessage @@ -1576,53 +2166,59 @@ public inline fun Message.channelEventMessageOrThrow(): ChannelEventMessage Message.ifChannelEventMessage(block: (ChannelEventMessage) -> T): T? = channelEventMessageOrNull() ?.let(block) -public inline fun Message.privateForumEventMessageOrNull(): PrivateForumEventMessage? = this as? dev.inmo.tgbotapi.types.message.PrivateForumEventMessage +public inline fun Message.commonChannelDirectMessagesEventMessageOrNull(): CommonChannelDirectMessagesEventMessage? = this as? dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage -public inline fun Message.privateForumEventMessageOrThrow(): PrivateForumEventMessage = this as dev.inmo.tgbotapi.types.message.PrivateForumEventMessage +public inline fun Message.commonChannelDirectMessagesEventMessageOrThrow(): CommonChannelDirectMessagesEventMessage = this as dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage -public inline fun Message.ifPrivateForumEventMessage(block: (PrivateForumEventMessage) -> T): T? = privateForumEventMessageOrNull() ?.let(block) +public inline fun Message.ifCommonChannelDirectMessagesEventMessage(block: (CommonChannelDirectMessagesEventMessage) -> T): T? = commonChannelDirectMessagesEventMessageOrNull() ?.let(block) -public inline fun Message.commonSupergroupEventMessageOrNull(): CommonSupergroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage +public inline fun Message.passportMessageOrNull(): PassportMessage? = this as? dev.inmo.tgbotapi.types.message.PassportMessage -public inline fun Message.commonSupergroupEventMessageOrThrow(): CommonSupergroupEventMessage = this as dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage +public inline fun Message.passportMessageOrThrow(): PassportMessage = this as dev.inmo.tgbotapi.types.message.PassportMessage -public inline fun Message.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T): T? = commonSupergroupEventMessageOrNull() ?.let(block) +public inline fun Message.ifPassportMessage(block: (PassportMessage) -> T): T? = passportMessageOrNull() ?.let(block) -public inline fun Message.businessContentMessageOrNull(): BusinessContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage +public inline fun Message.chatEventMessageOrNull(): ChatEventMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage -public inline fun Message.businessContentMessageOrThrow(): BusinessContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage +public inline fun Message.chatEventMessageOrThrow(): ChatEventMessage = this as dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage -public inline fun Message.ifBusinessContentMessage(block: (BusinessContentMessage) -> T): T? = businessContentMessageOrNull() ?.let(block) +public inline fun Message.ifChatEventMessage(block: (ChatEventMessage) -> T): T? = chatEventMessageOrNull() ?.let(block) -public inline fun Message.commonContentMessageOrNull(): CommonContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.CommonContentMessage +public inline fun Message.channelContentMessageOrNull(): ChannelContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage -public inline fun Message.commonContentMessageOrThrow(): CommonContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.CommonContentMessage +public inline fun Message.channelContentMessageOrThrow(): ChannelContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage -public inline fun Message.ifCommonContentMessage(block: (CommonContentMessage) -> T): T? = commonContentMessageOrNull() ?.let(block) +public inline fun Message.ifChannelContentMessage(block: (ChannelContentMessage) -> T): T? = channelContentMessageOrNull() ?.let(block) -public inline fun Message.optionallyFromUserMessageOrNull(): OptionallyFromUserMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage +public inline fun Message.chatContentMessageOrNull(): ChatContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage -public inline fun Message.optionallyFromUserMessageOrThrow(): OptionallyFromUserMessage = this as dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage +public inline fun Message.chatContentMessageOrThrow(): ChatContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage -public inline fun Message.ifOptionallyFromUserMessage(block: (OptionallyFromUserMessage) -> T): T? = optionallyFromUserMessageOrNull() ?.let(block) +public inline fun Message.ifChatContentMessage(block: (ChatContentMessage) -> T): T? = chatContentMessageOrNull() ?.let(block) -public inline fun Message.fromUserMessageOrNull(): FromUserMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage +public inline fun Message.possiblyTopicMessageOrNull(): PossiblyTopicMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PossiblyTopicMessage -public inline fun Message.fromUserMessageOrThrow(): FromUserMessage = this as dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage +public inline fun Message.possiblyTopicMessageOrThrow(): PossiblyTopicMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PossiblyTopicMessage -public inline fun Message.ifFromUserMessage(block: (FromUserMessage) -> T): T? = fromUserMessageOrNull() ?.let(block) +public inline fun Message.ifPossiblyTopicMessage(block: (PossiblyTopicMessage) -> T): T? = possiblyTopicMessageOrNull() ?.let(block) -public inline fun Message.fromUserChatMessageOrNull(): FromUserChatMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.FromUserChatMessage +public inline fun Message.channelDirectMessagesEventMessageOrNull(): ChannelDirectMessagesEventMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage -public inline fun Message.fromUserChatMessageOrThrow(): FromUserChatMessage = this as dev.inmo.tgbotapi.types.message.abstracts.FromUserChatMessage +public inline fun Message.channelDirectMessagesEventMessageOrThrow(): ChannelDirectMessagesEventMessage = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage -public inline fun Message.ifFromUserChatMessage(block: (FromUserChatMessage) -> T): T? = fromUserChatMessageOrNull() ?.let(block) +public inline fun Message.ifChannelDirectMessagesEventMessage(block: (ChannelDirectMessagesEventMessage) -> T): T? = channelDirectMessagesEventMessageOrNull() ?.let(block) -public inline fun Message.requestGuestContentMessageOrNull(): RequestGuestContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.RequestGuestContentMessage +public inline fun Message.privateContentMessageOrNull(): PrivateContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage -public inline fun Message.requestGuestContentMessageOrThrow(): RequestGuestContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.RequestGuestContentMessage +public inline fun Message.privateContentMessageOrThrow(): PrivateContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage -public inline fun Message.ifRequestGuestContentMessage(block: (RequestGuestContentMessage) -> T): T? = requestGuestContentMessageOrNull() ?.let(block) +public inline fun Message.ifPrivateContentMessage(block: (PrivateContentMessage) -> T): T? = privateContentMessageOrNull() ?.let(block) + +public inline fun Message.possiblyPaidMessageOrNull(): PossiblyPaidMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaidMessage + +public inline fun Message.possiblyPaidMessageOrThrow(): PossiblyPaidMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaidMessage + +public inline fun Message.ifPossiblyPaidMessage(block: (PossiblyPaidMessage) -> T): T? = possiblyPaidMessageOrNull() ?.let(block) public inline fun Message.accessibleMessageOrNull(): AccessibleMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage @@ -1654,71 +2250,47 @@ public inline fun Message.unknownMessageTypeOrThrow(): UnknownMessageType = this public inline fun Message.ifUnknownMessageType(block: (UnknownMessageType) -> T): T? = unknownMessageTypeOrNull() ?.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 Message.chatContentMessageOrNull(): ChatContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage - -public inline fun Message.chatContentMessageOrThrow(): ChatContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage - -public inline fun Message.ifChatContentMessage(block: (ChatContentMessage) -> T): T? = chatContentMessageOrNull() ?.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.possiblyTopicMessageOrNull(): PossiblyTopicMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PossiblyTopicMessage - -public inline fun Message.possiblyTopicMessageOrThrow(): PossiblyTopicMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PossiblyTopicMessage - -public inline fun Message.ifPossiblyTopicMessage(block: (PossiblyTopicMessage) -> T): T? = possiblyTopicMessageOrNull() ?.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.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.possiblyMediaGroupMessageOrNull(): PossiblyMediaGroupMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PossiblyMediaGroupMessage - -public inline fun Message.possiblyMediaGroupMessageOrThrow(): PossiblyMediaGroupMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PossiblyMediaGroupMessage - -public inline fun Message.ifPossiblyMediaGroupMessage(block: (PossiblyMediaGroupMessage) -> T): T? = possiblyMediaGroupMessageOrNull() ?.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.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.privateForumContentMessageOrNull(): PrivateForumContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PrivateForumContentMessage + +public inline fun Message.privateForumContentMessageOrThrow(): PrivateForumContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PrivateForumContentMessage + +public inline fun Message.ifPrivateForumContentMessage(block: (PrivateForumContentMessage) -> T): T? = privateForumContentMessageOrNull() ?.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.channelPaidPostOrNull(): ChannelPaidPost? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelPaidPost public inline fun Message.channelPaidPostOrThrow(): ChannelPaidPost = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelPaidPost public inline fun Message.ifChannelPaidPost(block: (ChannelPaidPost) -> T): T? = channelPaidPostOrNull() ?.let(block) -public inline fun Message.channelDirectMessagesEventMessageOrNull(): ChannelDirectMessagesEventMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage +public inline fun Message.optionallyFromUserMessageOrNull(): OptionallyFromUserMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage -public inline fun Message.channelDirectMessagesEventMessageOrThrow(): ChannelDirectMessagesEventMessage = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage +public inline fun Message.optionallyFromUserMessageOrThrow(): OptionallyFromUserMessage = this as dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage -public inline fun Message.ifChannelDirectMessagesEventMessage(block: (ChannelDirectMessagesEventMessage) -> T): T? = channelDirectMessagesEventMessageOrNull() ?.let(block) +public inline fun Message.ifOptionallyFromUserMessage(block: (OptionallyFromUserMessage) -> T): T? = optionallyFromUserMessageOrNull() ?.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.fromUserChatMessageOrNull(): FromUserChatMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.FromUserChatMessage + +public inline fun Message.fromUserChatMessageOrThrow(): FromUserChatMessage = this as dev.inmo.tgbotapi.types.message.abstracts.FromUserChatMessage + +public inline fun Message.ifFromUserChatMessage(block: (FromUserChatMessage) -> T): T? = fromUserChatMessageOrNull() ?.let(block) public inline fun Message.possiblyForwardedMessageOrNull(): PossiblyForwardedMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage @@ -1732,54 +2304,6 @@ public inline fun Message.possiblyWithEffectMessageOrThrow(): PossiblyWithEffect public inline fun Message.ifPossiblyWithEffectMessage(block: (PossiblyWithEffectMessage) -> T): T? = possiblyWithEffectMessageOrNull() ?.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.possiblyPaidMessageOrNull(): PossiblyPaidMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaidMessage - -public inline fun Message.possiblyPaidMessageOrThrow(): PossiblyPaidMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaidMessage - -public inline fun Message.ifPossiblyPaidMessage(block: (PossiblyPaidMessage) -> T): T? = possiblyPaidMessageOrNull() ?.let(block) - -public inline fun Message.possiblyOfflineMessageOrNull(): PossiblyOfflineMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PossiblyOfflineMessage - -public inline fun Message.possiblyOfflineMessageOrThrow(): PossiblyOfflineMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PossiblyOfflineMessage - -public inline fun Message.ifPossiblyOfflineMessage(block: (PossiblyOfflineMessage) -> T): T? = possiblyOfflineMessageOrNull() ?.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.requestGuestMessageOrNull(): RequestGuestMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.RequestGuestMessage - -public inline fun Message.requestGuestMessageOrThrow(): RequestGuestMessage = this as dev.inmo.tgbotapi.types.message.abstracts.RequestGuestMessage - -public inline fun Message.ifRequestGuestMessage(block: (RequestGuestMessage) -> T): T? = requestGuestMessageOrNull() ?.let(block) - -public inline fun Message.possiblyGuestAnswerMessageOrNull(): PossiblyGuestAnswerMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PossiblyGuestAnswerMessage - -public inline fun Message.possiblyGuestAnswerMessageOrThrow(): PossiblyGuestAnswerMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PossiblyGuestAnswerMessage - -public inline fun Message.ifPossiblyGuestAnswerMessage(block: (PossiblyGuestAnswerMessage) -> T): T? = possiblyGuestAnswerMessageOrNull() ?.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.privateForumContentMessageOrNull(): PrivateForumContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PrivateForumContentMessage - -public inline fun Message.privateForumContentMessageOrThrow(): PrivateForumContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PrivateForumContentMessage - -public inline fun Message.ifPrivateForumContentMessage(block: (PrivateForumContentMessage) -> T): T? = privateForumContentMessageOrNull() ?.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 @@ -1882,35 +2406,83 @@ public inline fun Message.commonSuggestedChannelDirectMessagesContentMessageOrTh public inline fun Message.ifCommonSuggestedChannelDirectMessagesContentMessage(block: (CommonSuggestedChannelDirectMessagesContentMessage) -> T): T? = commonSuggestedChannelDirectMessagesContentMessageOrNull() ?.let(block) -public inline fun Message.channelContentMessageOrNull(): ChannelContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage +public inline fun Message.possiblyGuestAnswerMessageOrNull(): PossiblyGuestAnswerMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PossiblyGuestAnswerMessage -public inline fun Message.channelContentMessageOrThrow(): ChannelContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage +public inline fun Message.possiblyGuestAnswerMessageOrThrow(): PossiblyGuestAnswerMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PossiblyGuestAnswerMessage -public inline fun Message.ifChannelContentMessage(block: (ChannelContentMessage) -> T): T? = channelContentMessageOrNull() ?.let(block) +public inline fun Message.ifPossiblyGuestAnswerMessage(block: (PossiblyGuestAnswerMessage) -> T): T? = possiblyGuestAnswerMessageOrNull() ?.let(block) -public inline fun Message.privateContentMessageOrNull(): PrivateContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage +public inline fun Message.groupEventMessageOrNull(): GroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage -public inline fun Message.privateContentMessageOrThrow(): PrivateContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage +public inline fun Message.groupEventMessageOrThrow(): GroupEventMessage = this as dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage -public inline fun Message.ifPrivateContentMessage(block: (PrivateContentMessage) -> T): T? = privateContentMessageOrNull() ?.let(block) +public inline fun Message.ifGroupEventMessage(block: (GroupEventMessage) -> T): T? = groupEventMessageOrNull() ?.let(block) -public inline fun Message.passportMessageOrNull(): PassportMessage? = this as? dev.inmo.tgbotapi.types.message.PassportMessage +public inline fun Message.possiblyPaymentMessageOrNull(): PossiblyPaymentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage -public inline fun Message.passportMessageOrThrow(): PassportMessage = this as dev.inmo.tgbotapi.types.message.PassportMessage +public inline fun Message.possiblyPaymentMessageOrThrow(): PossiblyPaymentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PossiblyPaymentMessage -public inline fun Message.ifPassportMessage(block: (PassportMessage) -> T): T? = passportMessageOrNull() ?.let(block) +public inline fun Message.ifPossiblyPaymentMessage(block: (PossiblyPaymentMessage) -> T): T? = possiblyPaymentMessageOrNull() ?.let(block) -public inline fun Message.privateEventMessageOrNull(): PrivateEventMessage? = this as? dev.inmo.tgbotapi.types.message.PrivateEventMessage +public inline fun Message.supergroupEventMessageOrNull(): SupergroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage -public inline fun Message.privateEventMessageOrThrow(): PrivateEventMessage = this as dev.inmo.tgbotapi.types.message.PrivateEventMessage +public inline fun Message.supergroupEventMessageOrThrow(): SupergroupEventMessage = this as dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage -public inline fun Message.ifPrivateEventMessage(block: (PrivateEventMessage) -> T): T? = privateEventMessageOrNull() ?.let(block) +public inline fun Message.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T): T? = supergroupEventMessageOrNull() ?.let(block) -public inline fun Message.commonChannelDirectMessagesEventMessageOrNull(): CommonChannelDirectMessagesEventMessage? = this as? dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage +public inline fun Message.signedMessageOrNull(): SignedMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.SignedMessage -public inline fun Message.commonChannelDirectMessagesEventMessageOrThrow(): CommonChannelDirectMessagesEventMessage = this as dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage +public inline fun Message.signedMessageOrThrow(): SignedMessage = this as dev.inmo.tgbotapi.types.message.abstracts.SignedMessage -public inline fun Message.ifCommonChannelDirectMessagesEventMessage(block: (CommonChannelDirectMessagesEventMessage) -> T): T? = commonChannelDirectMessagesEventMessageOrNull() ?.let(block) +public inline fun Message.ifSignedMessage(block: (SignedMessage) -> T): T? = signedMessageOrNull() ?.let(block) + +public inline fun Message.businessContentMessageOrNull(): BusinessContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage + +public inline fun Message.businessContentMessageOrThrow(): BusinessContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage + +public inline fun Message.ifBusinessContentMessage(block: (BusinessContentMessage) -> T): T? = businessContentMessageOrNull() ?.let(block) + +public inline fun Message.requestGuestMessageOrNull(): RequestGuestMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.RequestGuestMessage + +public inline fun Message.requestGuestMessageOrThrow(): RequestGuestMessage = this as dev.inmo.tgbotapi.types.message.abstracts.RequestGuestMessage + +public inline fun Message.ifRequestGuestMessage(block: (RequestGuestMessage) -> T): T? = requestGuestMessageOrNull() ?.let(block) + +public inline fun Message.possiblyOfflineMessageOrNull(): PossiblyOfflineMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PossiblyOfflineMessage + +public inline fun Message.possiblyOfflineMessageOrThrow(): PossiblyOfflineMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PossiblyOfflineMessage + +public inline fun Message.ifPossiblyOfflineMessage(block: (PossiblyOfflineMessage) -> T): T? = possiblyOfflineMessageOrNull() ?.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.commonContentMessageOrNull(): CommonContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.CommonContentMessage + +public inline fun Message.commonContentMessageOrThrow(): CommonContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.CommonContentMessage + +public inline fun Message.ifCommonContentMessage(block: (CommonContentMessage) -> T): T? = commonContentMessageOrNull() ?.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.possiblyMediaGroupMessageOrNull(): PossiblyMediaGroupMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PossiblyMediaGroupMessage + +public inline fun Message.possiblyMediaGroupMessageOrThrow(): PossiblyMediaGroupMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PossiblyMediaGroupMessage + +public inline fun Message.ifPossiblyMediaGroupMessage(block: (PossiblyMediaGroupMessage) -> T): T? = possiblyMediaGroupMessageOrNull() ?.let(block) + +public inline fun Message.requestGuestContentMessageOrNull(): RequestGuestContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.RequestGuestContentMessage + +public inline fun Message.requestGuestContentMessageOrThrow(): RequestGuestContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.RequestGuestContentMessage + +public inline fun Message.ifRequestGuestContentMessage(block: (RequestGuestContentMessage) -> T): T? = requestGuestContentMessageOrNull() ?.let(block) public inline fun Message.commonGroupEventMessageOrNull(): CommonGroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.CommonGroupEventMessage @@ -1918,383 +2490,29 @@ public inline fun Message.commonGroupEventMessageOrThrow(): CommonGroupEventMess public inline fun Message.ifCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T): T? = commonGroupEventMessageOrNull() ?.let(block) -public inline fun ResendableContent.videoNoteContentOrNull(): VideoNoteContent? = this as? dev.inmo.tgbotapi.types.message.content.VideoNoteContent +public inline fun Message.privateForumEventMessageOrNull(): PrivateForumEventMessage? = this as? dev.inmo.tgbotapi.types.message.PrivateForumEventMessage -public inline fun ResendableContent.videoNoteContentOrThrow(): VideoNoteContent = this as dev.inmo.tgbotapi.types.message.content.VideoNoteContent +public inline fun Message.privateForumEventMessageOrThrow(): PrivateForumEventMessage = this as dev.inmo.tgbotapi.types.message.PrivateForumEventMessage -public inline fun ResendableContent.ifVideoNoteContent(block: (VideoNoteContent) -> T): T? = videoNoteContentOrNull() ?.let(block) +public inline fun Message.ifPrivateForumEventMessage(block: (PrivateForumEventMessage) -> T): T? = privateForumEventMessageOrNull() ?.let(block) -public inline fun ResendableContent.voiceContentOrNull(): VoiceContent? = this as? dev.inmo.tgbotapi.types.message.content.VoiceContent +public inline fun Message.commonSupergroupEventMessageOrNull(): CommonSupergroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage -public inline fun ResendableContent.voiceContentOrThrow(): VoiceContent = this as dev.inmo.tgbotapi.types.message.content.VoiceContent +public inline fun Message.commonSupergroupEventMessageOrThrow(): CommonSupergroupEventMessage = this as dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage -public inline fun ResendableContent.ifVoiceContent(block: (VoiceContent) -> T): T? = voiceContentOrNull() ?.let(block) +public inline fun Message.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T): T? = commonSupergroupEventMessageOrNull() ?.let(block) -public inline fun ResendableContent.giveawayContentOrNull(): GiveawayContent? = this as? dev.inmo.tgbotapi.types.message.content.GiveawayContent +public inline fun Location.staticLocationOrNull(): StaticLocation? = this as? dev.inmo.tgbotapi.types.location.StaticLocation -public inline fun ResendableContent.giveawayContentOrThrow(): GiveawayContent = this as dev.inmo.tgbotapi.types.message.content.GiveawayContent +public inline fun Location.staticLocationOrThrow(): StaticLocation = this as dev.inmo.tgbotapi.types.location.StaticLocation -public inline fun ResendableContent.ifGiveawayContent(block: (GiveawayContent) -> T): T? = giveawayContentOrNull() ?.let(block) +public inline fun Location.ifStaticLocation(block: (StaticLocation) -> T): T? = staticLocationOrNull() ?.let(block) -public inline fun ResendableContent.stickerContentOrNull(): StickerContent? = this as? dev.inmo.tgbotapi.types.message.content.StickerContent +public inline fun Location.liveLocationOrNull(): LiveLocation? = this as? dev.inmo.tgbotapi.types.location.LiveLocation -public inline fun ResendableContent.stickerContentOrThrow(): StickerContent = this as dev.inmo.tgbotapi.types.message.content.StickerContent +public inline fun Location.liveLocationOrThrow(): LiveLocation = this as dev.inmo.tgbotapi.types.location.LiveLocation -public inline fun ResendableContent.ifStickerContent(block: (StickerContent) -> T): T? = stickerContentOrNull() ?.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.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.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.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.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.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.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.paidMediaInfoContentOrNull(): PaidMediaInfoContent? = this as? dev.inmo.tgbotapi.types.message.content.PaidMediaInfoContent - -public inline fun ResendableContent.paidMediaInfoContentOrThrow(): PaidMediaInfoContent = this as dev.inmo.tgbotapi.types.message.content.PaidMediaInfoContent - -public inline fun ResendableContent.ifPaidMediaInfoContent(block: (PaidMediaInfoContent) -> T): T? = paidMediaInfoContentOrNull() ?.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.giveawayPublicResultsContentOrNull(): GiveawayPublicResultsContent? = this as? dev.inmo.tgbotapi.types.message.content.GiveawayPublicResultsContent - -public inline fun ResendableContent.giveawayPublicResultsContentOrThrow(): GiveawayPublicResultsContent = this as dev.inmo.tgbotapi.types.message.content.GiveawayPublicResultsContent - -public inline fun ResendableContent.ifGiveawayPublicResultsContent(block: (GiveawayPublicResultsContent) -> T): T? = giveawayPublicResultsContentOrNull() ?.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.audioMediaGroupPartContentOrNull(): AudioMediaGroupPartContent? = this as? dev.inmo.tgbotapi.types.message.content.AudioMediaGroupPartContent - -public inline fun ResendableContent.audioMediaGroupPartContentOrThrow(): AudioMediaGroupPartContent = this as dev.inmo.tgbotapi.types.message.content.AudioMediaGroupPartContent - -public inline fun ResendableContent.ifAudioMediaGroupPartContent(block: (AudioMediaGroupPartContent) -> T): T? = audioMediaGroupPartContentOrNull() ?.let(block) - -public inline fun ResendableContent.documentMediaGroupPartContentOrNull(): DocumentMediaGroupPartContent? = this as? dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupPartContent - -public inline fun ResendableContent.documentMediaGroupPartContentOrThrow(): DocumentMediaGroupPartContent = this as dev.inmo.tgbotapi.types.message.content.DocumentMediaGroupPartContent - -public inline fun ResendableContent.ifDocumentMediaGroupPartContent(block: (DocumentMediaGroupPartContent) -> T): T? = documentMediaGroupPartContentOrNull() ?.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.mediaGroupCollectionContentOrNull(): MediaGroupCollectionContent? = this as? dev.inmo.tgbotapi.types.message.content.MediaGroupCollectionContent - -public inline fun ResendableContent.mediaGroupCollectionContentOrThrow(): MediaGroupCollectionContent = this as dev.inmo.tgbotapi.types.message.content.MediaGroupCollectionContent - -public inline fun ResendableContent.ifMediaGroupCollectionContent(block: (MediaGroupCollectionContent) -> T): T? = mediaGroupCollectionContentOrNull() ?.let(block) - -public inline fun ResendableContent.mediaGroupPartContentOrNull(): MediaGroupPartContent? = this as? dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent - -public inline fun ResendableContent.mediaGroupPartContentOrThrow(): MediaGroupPartContent = this as dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent - -public inline fun ResendableContent.ifMediaGroupPartContent(block: (MediaGroupPartContent) -> T): T? = mediaGroupPartContentOrNull() ?.let(block) - -public inline fun ResendableContent.visualMediaGroupPartContentOrNull(): VisualMediaGroupPartContent? = this as? dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent - -public inline fun ResendableContent.visualMediaGroupPartContentOrThrow(): VisualMediaGroupPartContent = this as dev.inmo.tgbotapi.types.message.content.VisualMediaGroupPartContent - -public inline fun ResendableContent.ifVisualMediaGroupPartContent(block: (VisualMediaGroupPartContent) -> T): T? = visualMediaGroupPartContentOrNull() ?.let(block) - -public inline fun ResendableContent.storyContentOrNull(): StoryContent? = this as? dev.inmo.tgbotapi.types.message.content.StoryContent - -public inline fun ResendableContent.storyContentOrThrow(): StoryContent = this as dev.inmo.tgbotapi.types.message.content.StoryContent - -public inline fun ResendableContent.ifStoryContent(block: (StoryContent) -> T): T? = storyContentOrNull() ?.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.textedContentOrNull(): TextedContent? = this as? dev.inmo.tgbotapi.types.message.content.TextedContent - -public inline fun ResendableContent.textedContentOrThrow(): TextedContent = this as dev.inmo.tgbotapi.types.message.content.TextedContent - -public inline fun ResendableContent.ifTextedContent(block: (TextedContent) -> T): T? = textedContentOrNull() ?.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.spoilerableMediaContentOrNull(): SpoilerableMediaContent? = this as? dev.inmo.tgbotapi.types.message.content.SpoilerableMediaContent - -public inline fun ResendableContent.spoilerableMediaContentOrThrow(): SpoilerableMediaContent = this as dev.inmo.tgbotapi.types.message.content.SpoilerableMediaContent - -public inline fun ResendableContent.ifSpoilerableMediaContent(block: (SpoilerableMediaContent) -> T): T? = spoilerableMediaContentOrNull() ?.let(block) - -public inline fun ResendableContent.withCustomizedCaptionMediaContentOrNull(): WithCustomizedCaptionMediaContent? = this as? dev.inmo.tgbotapi.types.message.content.WithCustomizedCaptionMediaContent - -public inline fun ResendableContent.withCustomizedCaptionMediaContentOrThrow(): WithCustomizedCaptionMediaContent = this as dev.inmo.tgbotapi.types.message.content.WithCustomizedCaptionMediaContent - -public inline fun ResendableContent.ifWithCustomizedCaptionMediaContent(block: (WithCustomizedCaptionMediaContent) -> T): T? = withCustomizedCaptionMediaContentOrNull() ?.let(block) - -public inline fun ResendableContent.checklistContentOrNull(): ChecklistContent? = this as? dev.inmo.tgbotapi.types.message.content.ChecklistContent - -public inline fun ResendableContent.checklistContentOrThrow(): ChecklistContent = this as dev.inmo.tgbotapi.types.message.content.ChecklistContent - -public inline fun ResendableContent.ifChecklistContent(block: (ChecklistContent) -> T): T? = checklistContentOrNull() ?.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.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.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.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.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.livePhotoContentOrNull(): LivePhotoContent? = this as? dev.inmo.tgbotapi.types.message.content.LivePhotoContent - -public inline fun ResendableContent.livePhotoContentOrThrow(): LivePhotoContent = this as dev.inmo.tgbotapi.types.message.content.LivePhotoContent - -public inline fun ResendableContent.ifLivePhotoContent(block: (LivePhotoContent) -> T): T? = livePhotoContentOrNull() ?.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.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.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.expandableBlockquoteTextSourceOrNull(): ExpandableBlockquoteTextSource? = this as? dev.inmo.tgbotapi.types.message.textsources.ExpandableBlockquoteTextSource - -public inline fun TextSource.expandableBlockquoteTextSourceOrThrow(): ExpandableBlockquoteTextSource = this as dev.inmo.tgbotapi.types.message.textsources.ExpandableBlockquoteTextSource - -public inline fun TextSource.ifExpandableBlockquoteTextSource(block: (ExpandableBlockquoteTextSource) -> T): T? = expandableBlockquoteTextSourceOrNull() ?.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.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.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.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.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.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.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 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.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.customEmojiTextSourceOrNull(): CustomEmojiTextSource? = this as? dev.inmo.tgbotapi.types.message.textsources.CustomEmojiTextSource - -public inline fun TextSource.customEmojiTextSourceOrThrow(): CustomEmojiTextSource = this as dev.inmo.tgbotapi.types.message.textsources.CustomEmojiTextSource - -public inline fun TextSource.ifCustomEmojiTextSource(block: (CustomEmojiTextSource) -> T): T? = customEmojiTextSourceOrNull() ?.let(block) - -public inline fun TextSource.blockquoteTextSourceOrNull(): BlockquoteTextSource? = this as? dev.inmo.tgbotapi.types.message.textsources.BlockquoteTextSource - -public inline fun TextSource.blockquoteTextSourceOrThrow(): BlockquoteTextSource = this as dev.inmo.tgbotapi.types.message.textsources.BlockquoteTextSource - -public inline fun TextSource.ifBlockquoteTextSource(block: (BlockquoteTextSource) -> T): T? = blockquoteTextSourceOrNull() ?.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.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.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.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.dateTimeTextSourceOrNull(): DateTimeTextSource? = this as? dev.inmo.tgbotapi.types.message.textsources.DateTimeTextSource - -public inline fun TextSource.dateTimeTextSourceOrThrow(): DateTimeTextSource = this as dev.inmo.tgbotapi.types.message.textsources.DateTimeTextSource - -public inline fun TextSource.ifDateTimeTextSource(block: (DateTimeTextSource) -> T): T? = dateTimeTextSourceOrNull() ?.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.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 RevenueWithdrawalState.pendingOrNull(): RevenueWithdrawalState.Pending? = this as? dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Pending - -public inline fun RevenueWithdrawalState.pendingOrThrow(): RevenueWithdrawalState.Pending = this as dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Pending - -public inline fun RevenueWithdrawalState.ifPending(block: (RevenueWithdrawalState.Pending) -> T): T? = pendingOrNull() ?.let(block) - -public inline fun RevenueWithdrawalState.succeededOrNull(): RevenueWithdrawalState.Succeeded? = this as? dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Succeeded - -public inline fun RevenueWithdrawalState.succeededOrThrow(): RevenueWithdrawalState.Succeeded = this as dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Succeeded - -public inline fun RevenueWithdrawalState.ifSucceeded(block: (RevenueWithdrawalState.Succeeded) -> T): T? = succeededOrNull() ?.let(block) - -public inline fun RevenueWithdrawalState.failedOrNull(): RevenueWithdrawalState.Failed? = this as? dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Failed - -public inline fun RevenueWithdrawalState.failedOrThrow(): RevenueWithdrawalState.Failed = this as dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Failed - -public inline fun RevenueWithdrawalState.ifFailed(block: (RevenueWithdrawalState.Failed) -> T): T? = failedOrNull() ?.let(block) - -public inline fun RevenueWithdrawalState.unknownOrNull(): RevenueWithdrawalState.Unknown? = this as? dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Unknown - -public inline fun RevenueWithdrawalState.unknownOrThrow(): RevenueWithdrawalState.Unknown = this as dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Unknown - -public inline fun RevenueWithdrawalState.ifUnknown(block: (RevenueWithdrawalState.Unknown) -> T): T? = unknownOrNull() ?.let(block) +public inline fun Location.ifLiveLocation(block: (LiveLocation) -> T): T? = liveLocationOrNull() ?.let(block) public inline fun StarTransaction.incomingOrNull(): StarTransaction.Incoming? = this as? dev.inmo.tgbotapi.types.payments.stars.StarTransaction.Incoming @@ -2362,173 +2580,167 @@ public inline fun TransactionPartner.unknownOrThrow(): TransactionPartner.Unknow public inline fun TransactionPartner.ifUnknown(block: (TransactionPartner.Unknown) -> T): T? = unknownOrNull() ?.let(block) -public inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrNull(): ExactScheduledCloseInfo? = this as? dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo +public inline fun RevenueWithdrawalState.pendingOrNull(): RevenueWithdrawalState.Pending? = this as? dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Pending -public inline fun ScheduledCloseInfo.exactScheduledCloseInfoOrThrow(): ExactScheduledCloseInfo = this as dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo +public inline fun RevenueWithdrawalState.pendingOrThrow(): RevenueWithdrawalState.Pending = this as dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Pending -public inline fun ScheduledCloseInfo.ifExactScheduledCloseInfo(block: (ExactScheduledCloseInfo) -> T): T? = exactScheduledCloseInfoOrNull() ?.let(block) +public inline fun RevenueWithdrawalState.ifPending(block: (RevenueWithdrawalState.Pending) -> T): T? = pendingOrNull() ?.let(block) -public inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrNull(): ApproximateScheduledCloseInfo? = this as? dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo +public inline fun RevenueWithdrawalState.succeededOrNull(): RevenueWithdrawalState.Succeeded? = this as? dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Succeeded -public inline fun ScheduledCloseInfo.approximateScheduledCloseInfoOrThrow(): ApproximateScheduledCloseInfo = this as dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo +public inline fun RevenueWithdrawalState.succeededOrThrow(): RevenueWithdrawalState.Succeeded = this as dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Succeeded -public inline fun ScheduledCloseInfo.ifApproximateScheduledCloseInfo(block: (ApproximateScheduledCloseInfo) -> T): T? = approximateScheduledCloseInfoOrNull() ?.let(block) +public inline fun RevenueWithdrawalState.ifSucceeded(block: (RevenueWithdrawalState.Succeeded) -> T): T? = succeededOrNull() ?.let(block) -public inline fun Poll.unknownPollTypeOrNull(): UnknownPollType? = this as? dev.inmo.tgbotapi.types.polls.UnknownPollType +public inline fun RevenueWithdrawalState.failedOrNull(): RevenueWithdrawalState.Failed? = this as? dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Failed -public inline fun Poll.unknownPollTypeOrThrow(): UnknownPollType = this as dev.inmo.tgbotapi.types.polls.UnknownPollType +public inline fun RevenueWithdrawalState.failedOrThrow(): RevenueWithdrawalState.Failed = this as dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Failed -public inline fun Poll.ifUnknownPollType(block: (UnknownPollType) -> T): T? = unknownPollTypeOrNull() ?.let(block) +public inline fun RevenueWithdrawalState.ifFailed(block: (RevenueWithdrawalState.Failed) -> T): T? = failedOrNull() ?.let(block) -public inline fun Poll.regularPollOrNull(): RegularPoll? = this as? dev.inmo.tgbotapi.types.polls.RegularPoll +public inline fun RevenueWithdrawalState.unknownOrNull(): RevenueWithdrawalState.Unknown? = this as? dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Unknown -public inline fun Poll.regularPollOrThrow(): RegularPoll = this as dev.inmo.tgbotapi.types.polls.RegularPoll +public inline fun RevenueWithdrawalState.unknownOrThrow(): RevenueWithdrawalState.Unknown = this as dev.inmo.tgbotapi.types.payments.stars.RevenueWithdrawalState.Unknown -public inline fun Poll.ifRegularPoll(block: (RegularPoll) -> T): T? = regularPollOrNull() ?.let(block) +public inline fun RevenueWithdrawalState.ifUnknown(block: (RevenueWithdrawalState.Unknown) -> T): T? = unknownOrNull() ?.let(block) -public inline fun Poll.quizPollOrNull(): QuizPoll? = this as? dev.inmo.tgbotapi.types.polls.QuizPoll +public inline fun Reaction.emojiOrNull(): Reaction.Emoji? = this as? dev.inmo.tgbotapi.types.reactions.Reaction.Emoji -public inline fun Poll.quizPollOrThrow(): QuizPoll = this as dev.inmo.tgbotapi.types.polls.QuizPoll +public inline fun Reaction.emojiOrThrow(): Reaction.Emoji = this as dev.inmo.tgbotapi.types.reactions.Reaction.Emoji -public inline fun Poll.ifQuizPoll(block: (QuizPoll) -> T): T? = quizPollOrNull() ?.let(block) +public inline fun Reaction.ifEmoji(block: (Reaction.Emoji) -> T): T? = emojiOrNull() ?.let(block) -public inline fun BackgroundFill.solidOrNull(): BackgroundFill.Solid? = this as? dev.inmo.tgbotapi.types.BackgroundFill.Solid +public inline fun Reaction.customEmojiOrNull(): Reaction.CustomEmoji? = this as? dev.inmo.tgbotapi.types.reactions.Reaction.CustomEmoji -public inline fun BackgroundFill.solidOrThrow(): BackgroundFill.Solid = this as dev.inmo.tgbotapi.types.BackgroundFill.Solid +public inline fun Reaction.customEmojiOrThrow(): Reaction.CustomEmoji = this as dev.inmo.tgbotapi.types.reactions.Reaction.CustomEmoji -public inline fun BackgroundFill.ifSolid(block: (BackgroundFill.Solid) -> T): T? = solidOrNull() ?.let(block) +public inline fun Reaction.ifCustomEmoji(block: (Reaction.CustomEmoji) -> T): T? = customEmojiOrNull() ?.let(block) -public inline fun BackgroundFill.gradientOrNull(): BackgroundFill.Gradient? = this as? dev.inmo.tgbotapi.types.BackgroundFill.Gradient +public inline fun Reaction.paidOrNull(): Reaction.Paid? = this as? dev.inmo.tgbotapi.types.reactions.Reaction.Paid -public inline fun BackgroundFill.gradientOrThrow(): BackgroundFill.Gradient = this as dev.inmo.tgbotapi.types.BackgroundFill.Gradient +public inline fun Reaction.paidOrThrow(): Reaction.Paid = this as dev.inmo.tgbotapi.types.reactions.Reaction.Paid -public inline fun BackgroundFill.ifGradient(block: (BackgroundFill.Gradient) -> T): T? = gradientOrNull() ?.let(block) +public inline fun Reaction.ifPaid(block: (Reaction.Paid) -> T): T? = paidOrNull() ?.let(block) -public inline fun BackgroundFill.freeformGradientOrNull(): BackgroundFill.FreeformGradient? = this as? dev.inmo.tgbotapi.types.BackgroundFill.FreeformGradient +public inline fun Reaction.unknownOrNull(): Reaction.Unknown? = this as? dev.inmo.tgbotapi.types.reactions.Reaction.Unknown -public inline fun BackgroundFill.freeformGradientOrThrow(): BackgroundFill.FreeformGradient = this as dev.inmo.tgbotapi.types.BackgroundFill.FreeformGradient +public inline fun Reaction.unknownOrThrow(): Reaction.Unknown = this as dev.inmo.tgbotapi.types.reactions.Reaction.Unknown -public inline fun BackgroundFill.ifFreeformGradient(block: (BackgroundFill.FreeformGradient) -> T): T? = freeformGradientOrNull() ?.let(block) +public inline fun Reaction.ifUnknown(block: (Reaction.Unknown) -> T): T? = unknownOrNull() ?.let(block) -public inline fun BackgroundFill.unknownOrNull(): BackgroundFill.Unknown? = this as? dev.inmo.tgbotapi.types.BackgroundFill.Unknown +public inline fun SecureValue.otherDocumentsSecureValueOrNull(): OtherDocumentsSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.OtherDocumentsSecureValue -public inline fun BackgroundFill.unknownOrThrow(): BackgroundFill.Unknown = this as dev.inmo.tgbotapi.types.BackgroundFill.Unknown +public inline fun SecureValue.otherDocumentsSecureValueOrThrow(): OtherDocumentsSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.OtherDocumentsSecureValue -public inline fun BackgroundFill.ifUnknown(block: (BackgroundFill.Unknown) -> T): T? = unknownOrNull() ?.let(block) +public inline fun SecureValue.ifOtherDocumentsSecureValue(block: (OtherDocumentsSecureValue) -> T): T? = otherDocumentsSecureValueOrNull() ?.let(block) -public inline fun Location.staticLocationOrNull(): StaticLocation? = this as? dev.inmo.tgbotapi.types.location.StaticLocation +public inline fun SecureValue.utilityBillSecureValueOrNull(): UtilityBillSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.UtilityBillSecureValue -public inline fun Location.staticLocationOrThrow(): StaticLocation = this as dev.inmo.tgbotapi.types.location.StaticLocation +public inline fun SecureValue.utilityBillSecureValueOrThrow(): UtilityBillSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.UtilityBillSecureValue -public inline fun Location.ifStaticLocation(block: (StaticLocation) -> T): T? = staticLocationOrNull() ?.let(block) +public inline fun SecureValue.ifUtilityBillSecureValue(block: (UtilityBillSecureValue) -> T): T? = utilityBillSecureValueOrNull() ?.let(block) -public inline fun Location.liveLocationOrNull(): LiveLocation? = this as? dev.inmo.tgbotapi.types.location.LiveLocation +public inline fun SecureValue.bankStatementSecureValueOrNull(): BankStatementSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.BankStatementSecureValue -public inline fun Location.liveLocationOrThrow(): LiveLocation = this as dev.inmo.tgbotapi.types.location.LiveLocation +public inline fun SecureValue.bankStatementSecureValueOrThrow(): BankStatementSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.BankStatementSecureValue -public inline fun Location.ifLiveLocation(block: (LiveLocation) -> T): T? = liveLocationOrNull() ?.let(block) +public inline fun SecureValue.ifBankStatementSecureValue(block: (BankStatementSecureValue) -> T): T? = bankStatementSecureValueOrNull() ?.let(block) -public inline fun ChatIdentifier.idChatIdentifierOrNull(): IdChatIdentifier? = this as? dev.inmo.tgbotapi.types.IdChatIdentifier +public inline fun SecureValue.rentalAgreementSecureValueOrNull(): RentalAgreementSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.RentalAgreementSecureValue -public inline fun ChatIdentifier.idChatIdentifierOrThrow(): IdChatIdentifier = this as dev.inmo.tgbotapi.types.IdChatIdentifier +public inline fun SecureValue.rentalAgreementSecureValueOrThrow(): RentalAgreementSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.RentalAgreementSecureValue -public inline fun ChatIdentifier.ifIdChatIdentifier(block: (IdChatIdentifier) -> T): T? = idChatIdentifierOrNull() ?.let(block) +public inline fun SecureValue.ifRentalAgreementSecureValue(block: (RentalAgreementSecureValue) -> T): T? = rentalAgreementSecureValueOrNull() ?.let(block) -public inline fun ChatIdentifier.chatIdOrNull(): ChatId? = this as? dev.inmo.tgbotapi.types.ChatId +public inline fun SecureValue.passportRegistrationSecureValueOrNull(): PassportRegistrationSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.PassportRegistrationSecureValue -public inline fun ChatIdentifier.chatIdOrThrow(): ChatId = this as dev.inmo.tgbotapi.types.ChatId +public inline fun SecureValue.passportRegistrationSecureValueOrThrow(): PassportRegistrationSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.PassportRegistrationSecureValue -public inline fun ChatIdentifier.ifChatId(block: (ChatId) -> T): T? = chatIdOrNull() ?.let(block) +public inline fun SecureValue.ifPassportRegistrationSecureValue(block: (PassportRegistrationSecureValue) -> T): T? = passportRegistrationSecureValueOrNull() ?.let(block) -public inline fun ChatIdentifier.chatIdWithThreadIdOrNull(): ChatIdWithThreadId? = this as? dev.inmo.tgbotapi.types.ChatIdWithThreadId +public inline fun SecureValue.temporalRegistrationSecureValueOrNull(): TemporalRegistrationSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.TemporalRegistrationSecureValue -public inline fun ChatIdentifier.chatIdWithThreadIdOrThrow(): ChatIdWithThreadId = this as dev.inmo.tgbotapi.types.ChatIdWithThreadId +public inline fun SecureValue.temporalRegistrationSecureValueOrThrow(): TemporalRegistrationSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.TemporalRegistrationSecureValue -public inline fun ChatIdentifier.ifChatIdWithThreadId(block: (ChatIdWithThreadId) -> T): T? = chatIdWithThreadIdOrNull() ?.let(block) +public inline fun SecureValue.ifTemporalRegistrationSecureValue(block: (TemporalRegistrationSecureValue) -> T): T? = temporalRegistrationSecureValueOrNull() ?.let(block) -public inline fun ChatIdentifier.chatIdWithChannelDirectMessageThreadIdOrNull(): ChatIdWithChannelDirectMessageThreadId? = this as? dev.inmo.tgbotapi.types.ChatIdWithChannelDirectMessageThreadId +public inline fun SecureValue.identityWithReverseSideSecureValueOrNull(): IdentityWithReverseSideSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.IdentityWithReverseSideSecureValue -public inline fun ChatIdentifier.chatIdWithChannelDirectMessageThreadIdOrThrow(): ChatIdWithChannelDirectMessageThreadId = this as dev.inmo.tgbotapi.types.ChatIdWithChannelDirectMessageThreadId +public inline fun SecureValue.identityWithReverseSideSecureValueOrThrow(): IdentityWithReverseSideSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.IdentityWithReverseSideSecureValue -public inline fun ChatIdentifier.ifChatIdWithChannelDirectMessageThreadId(block: (ChatIdWithChannelDirectMessageThreadId) -> T): T? = chatIdWithChannelDirectMessageThreadIdOrNull() ?.let(block) +public inline fun SecureValue.ifIdentityWithReverseSideSecureValue(block: (IdentityWithReverseSideSecureValue) -> T): T? = identityWithReverseSideSecureValueOrNull() ?.let(block) -public inline fun ChatIdentifier.businessChatIdOrNull(): BusinessChatId? = this as? dev.inmo.tgbotapi.types.BusinessChatId +public inline fun SecureValue.driverLicenseSecureValueOrNull(): DriverLicenseSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.DriverLicenseSecureValue -public inline fun ChatIdentifier.businessChatIdOrThrow(): BusinessChatId = this as dev.inmo.tgbotapi.types.BusinessChatId +public inline fun SecureValue.driverLicenseSecureValueOrThrow(): DriverLicenseSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.DriverLicenseSecureValue -public inline fun ChatIdentifier.ifBusinessChatId(block: (BusinessChatId) -> T): T? = businessChatIdOrNull() ?.let(block) +public inline fun SecureValue.ifDriverLicenseSecureValue(block: (DriverLicenseSecureValue) -> T): T? = driverLicenseSecureValueOrNull() ?.let(block) -public inline fun ChatIdentifier.usernameOrNull(): Username? = this as? dev.inmo.tgbotapi.types.Username +public inline fun SecureValue.identityCardSecureValueOrNull(): IdentityCardSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.IdentityCardSecureValue -public inline fun ChatIdentifier.usernameOrThrow(): Username = this as dev.inmo.tgbotapi.types.Username +public inline fun SecureValue.identityCardSecureValueOrThrow(): IdentityCardSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.IdentityCardSecureValue -public inline fun ChatIdentifier.ifUsername(block: (Username) -> T): T? = usernameOrNull() ?.let(block) +public inline fun SecureValue.ifIdentityCardSecureValue(block: (IdentityCardSecureValue) -> T): T? = identityCardSecureValueOrNull() ?.let(block) -public inline fun ChatBoostSource.byUserOrNull(): ChatBoostSource.ByUser? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.ByUser +public inline fun SecureValue.passportSecureValueOrNull(): PassportSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.PassportSecureValue -public inline fun ChatBoostSource.byUserOrThrow(): ChatBoostSource.ByUser = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.ByUser +public inline fun SecureValue.passportSecureValueOrThrow(): PassportSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.PassportSecureValue -public inline fun ChatBoostSource.ifByUser(block: (ChatBoostSource.ByUser) -> T): T? = byUserOrNull() ?.let(block) +public inline fun SecureValue.ifPassportSecureValue(block: (PassportSecureValue) -> T): T? = passportSecureValueOrNull() ?.let(block) -public inline fun ChatBoostSource.premiumOrNull(): ChatBoostSource.Premium? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Premium +public inline fun SecureValue.commonPassportSecureValueOrNull(): CommonPassportSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.CommonPassportSecureValue -public inline fun ChatBoostSource.premiumOrThrow(): ChatBoostSource.Premium = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Premium +public inline fun SecureValue.commonPassportSecureValueOrThrow(): CommonPassportSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.CommonPassportSecureValue -public inline fun ChatBoostSource.ifPremium(block: (ChatBoostSource.Premium) -> T): T? = premiumOrNull() ?.let(block) +public inline fun SecureValue.ifCommonPassportSecureValue(block: (CommonPassportSecureValue) -> T): T? = commonPassportSecureValueOrNull() ?.let(block) -public inline fun ChatBoostSource.giftCodeOrNull(): ChatBoostSource.GiftCode? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.GiftCode +public inline fun SecureValue.internalPassportSecureValueOrNull(): InternalPassportSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.InternalPassportSecureValue -public inline fun ChatBoostSource.giftCodeOrThrow(): ChatBoostSource.GiftCode = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.GiftCode +public inline fun SecureValue.internalPassportSecureValueOrThrow(): InternalPassportSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.InternalPassportSecureValue -public inline fun ChatBoostSource.ifGiftCode(block: (ChatBoostSource.GiftCode) -> T): T? = giftCodeOrNull() ?.let(block) +public inline fun SecureValue.ifInternalPassportSecureValue(block: (InternalPassportSecureValue) -> T): T? = internalPassportSecureValueOrNull() ?.let(block) -public inline fun ChatBoostSource.giveawayOrNull(): ChatBoostSource.Giveaway? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway +public inline fun SecureValue.personalDetailsSecureValueOrNull(): PersonalDetailsSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.PersonalDetailsSecureValue -public inline fun ChatBoostSource.giveawayOrThrow(): ChatBoostSource.Giveaway = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway +public inline fun SecureValue.personalDetailsSecureValueOrThrow(): PersonalDetailsSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.PersonalDetailsSecureValue -public inline fun ChatBoostSource.ifGiveaway(block: (ChatBoostSource.Giveaway) -> T): T? = giveawayOrNull() ?.let(block) +public inline fun SecureValue.ifPersonalDetailsSecureValue(block: (PersonalDetailsSecureValue) -> T): T? = personalDetailsSecureValueOrNull() ?.let(block) -public inline fun ChatBoostSource.unknownOrNull(): ChatBoostSource.Unknown? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Unknown +public inline fun SecureValue.addressSecureValueOrNull(): AddressSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.AddressSecureValue -public inline fun ChatBoostSource.unknownOrThrow(): ChatBoostSource.Unknown = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Unknown +public inline fun SecureValue.addressSecureValueOrThrow(): AddressSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.AddressSecureValue -public inline fun ChatBoostSource.ifUnknown(block: (ChatBoostSource.Unknown) -> T): T? = unknownOrNull() ?.let(block) +public inline fun SecureValue.ifAddressSecureValue(block: (AddressSecureValue) -> T): T? = addressSecureValueOrNull() ?.let(block) -public inline fun ChatBoostSource.giveawayCreatedOrNull(): ChatBoostSource.Giveaway.Created? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Created +public inline fun SecureValue.secureValueIdentityOrNull(): SecureValueIdentity? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueIdentity -public inline fun ChatBoostSource.giveawayCreatedOrThrow(): ChatBoostSource.Giveaway.Created = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Created +public inline fun SecureValue.secureValueIdentityOrThrow(): SecureValueIdentity = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueIdentity -public inline fun ChatBoostSource.ifGiveawayCreated(block: (ChatBoostSource.Giveaway.Created) -> T): T? = giveawayCreatedOrNull() ?.let(block) +public inline fun SecureValue.ifSecureValueIdentity(block: (SecureValueIdentity) -> T): T? = secureValueIdentityOrNull() ?.let(block) -public inline fun ChatBoostSource.giveawayClaimedOrNull(): ChatBoostSource.Giveaway.Claimed? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Claimed +public inline fun SecureValue.secureValueWithTranslationsOrNull(): SecureValueWithTranslations? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithTranslations -public inline fun ChatBoostSource.giveawayClaimedOrThrow(): ChatBoostSource.Giveaway.Claimed = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Claimed +public inline fun SecureValue.secureValueWithTranslationsOrThrow(): SecureValueWithTranslations = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithTranslations -public inline fun ChatBoostSource.ifGiveawayClaimed(block: (ChatBoostSource.Giveaway.Claimed) -> T): T? = giveawayClaimedOrNull() ?.let(block) +public inline fun SecureValue.ifSecureValueWithTranslations(block: (SecureValueWithTranslations) -> T): T? = secureValueWithTranslationsOrNull() ?.let(block) -public inline fun ChatBoostSource.giveawayUnclaimedOrNull(): ChatBoostSource.Giveaway.Unclaimed? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Unclaimed +public inline fun SecureValue.secureValueWithDataOrNull(): SecureValueWithData? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithData -public inline fun ChatBoostSource.giveawayUnclaimedOrThrow(): ChatBoostSource.Giveaway.Unclaimed = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Unclaimed +public inline fun SecureValue.secureValueWithDataOrThrow(): SecureValueWithData = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithData -public inline fun ChatBoostSource.ifGiveawayUnclaimed(block: (ChatBoostSource.Giveaway.Unclaimed) -> T): T? = giveawayUnclaimedOrNull() ?.let(block) +public inline fun SecureValue.ifSecureValueWithData(block: (SecureValueWithData) -> T): T? = secureValueWithDataOrNull() ?.let(block) -public inline fun RequestResponse.usersSharedOrNull(): UsersShared? = this as? dev.inmo.tgbotapi.types.request.UsersShared +public inline fun SecureValue.secureValueWithFilesOrNull(): SecureValueWithFiles? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithFiles -public inline fun RequestResponse.usersSharedOrThrow(): UsersShared = this as dev.inmo.tgbotapi.types.request.UsersShared +public inline fun SecureValue.secureValueWithFilesOrThrow(): SecureValueWithFiles = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithFiles -public inline fun RequestResponse.ifUsersShared(block: (UsersShared) -> T): T? = usersSharedOrNull() ?.let(block) +public inline fun SecureValue.ifSecureValueWithFiles(block: (SecureValueWithFiles) -> T): T? = secureValueWithFilesOrNull() ?.let(block) -public inline fun RequestResponse.chatSharedOrNull(): ChatShared? = this as? dev.inmo.tgbotapi.types.request.ChatShared +public inline fun SecureValue.secureValueWithReverseSideOrNull(): SecureValueWithReverseSide? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithReverseSide -public inline fun RequestResponse.chatSharedOrThrow(): ChatShared = this as dev.inmo.tgbotapi.types.request.ChatShared +public inline fun SecureValue.secureValueWithReverseSideOrThrow(): SecureValueWithReverseSide = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithReverseSide -public inline fun RequestResponse.ifChatShared(block: (ChatShared) -> T): T? = chatSharedOrNull() ?.let(block) - -public inline fun RequestResponse.chatSharedRequestOrNull(): ChatSharedRequest? = this as? dev.inmo.tgbotapi.types.request.ChatSharedRequest - -public inline fun RequestResponse.chatSharedRequestOrThrow(): ChatSharedRequest = this as dev.inmo.tgbotapi.types.request.ChatSharedRequest - -public inline fun RequestResponse.ifChatSharedRequest(block: (ChatSharedRequest) -> T): T? = chatSharedRequestOrNull() ?.let(block) +public inline fun SecureValue.ifSecureValueWithReverseSide(block: (SecureValueWithReverseSide) -> T): T? = secureValueWithReverseSideOrNull() ?.let(block) public inline fun PassportElementError.unknownPassportElementErrorOrNull(): UnknownPassportElementError? = this as? dev.inmo.tgbotapi.types.passport.UnknownPassportElementError @@ -2620,11 +2832,89 @@ public inline fun EncryptedPassportElement.encryptedAddressOrThrow(): EncryptedA public inline fun EncryptedPassportElement.ifEncryptedAddress(block: (EncryptedAddress) -> T): T? = encryptedAddressOrNull() ?.let(block) -public inline fun EncryptedPassportElement.phoneNumberOrNull(): PhoneNumber? = this as? dev.inmo.tgbotapi.types.passport.encrypted.PhoneNumber +public inline fun EncryptedPassportElement.encryptedPersonalDetailsOrNull(): EncryptedPersonalDetails? = this as? dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPersonalDetails -public inline fun EncryptedPassportElement.phoneNumberOrThrow(): PhoneNumber = this as dev.inmo.tgbotapi.types.passport.encrypted.PhoneNumber +public inline fun EncryptedPassportElement.encryptedPersonalDetailsOrThrow(): EncryptedPersonalDetails = this as dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPersonalDetails -public inline fun EncryptedPassportElement.ifPhoneNumber(block: (PhoneNumber) -> T): T? = phoneNumberOrNull() ?.let(block) +public inline fun EncryptedPassportElement.ifEncryptedPersonalDetails(block: (EncryptedPersonalDetails) -> T): T? = encryptedPersonalDetailsOrNull() ?.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.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.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.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 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.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.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.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.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.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.passportOrNull(): Passport? = this as? dev.inmo.tgbotapi.types.passport.encrypted.Passport @@ -2644,6 +2934,12 @@ public inline fun EncryptedPassportElement.internalPassportOrThrow(): InternalPa 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.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 @@ -2680,383 +2976,827 @@ public inline fun EncryptedPassportElement.temporaryRegistrationOrThrow(): Tempo public inline fun EncryptedPassportElement.ifTemporaryRegistration(block: (TemporaryRegistration) -> T): T? = temporaryRegistrationOrNull() ?.let(block) -public inline fun EncryptedPassportElement.emailOrNull(): Email? = this as? dev.inmo.tgbotapi.types.passport.encrypted.Email +public inline fun ChatIdentifier.idChatIdentifierOrNull(): IdChatIdentifier? = this as? dev.inmo.tgbotapi.types.IdChatIdentifier -public inline fun EncryptedPassportElement.emailOrThrow(): Email = this as dev.inmo.tgbotapi.types.passport.encrypted.Email +public inline fun ChatIdentifier.idChatIdentifierOrThrow(): IdChatIdentifier = this as dev.inmo.tgbotapi.types.IdChatIdentifier -public inline fun EncryptedPassportElement.ifEmail(block: (Email) -> T): T? = emailOrNull() ?.let(block) +public inline fun ChatIdentifier.ifIdChatIdentifier(block: (IdChatIdentifier) -> T): T? = idChatIdentifierOrNull() ?.let(block) -public inline fun EncryptedPassportElement.encryptedPassportElementWithTranslatableIDDocumentOrNull(): EncryptedPassportElementWithTranslatableIDDocument? = this as? dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableIDDocument +public inline fun ChatIdentifier.chatIdOrNull(): ChatId? = this as? dev.inmo.tgbotapi.types.ChatId -public inline fun EncryptedPassportElement.encryptedPassportElementWithTranslatableIDDocumentOrThrow(): EncryptedPassportElementWithTranslatableIDDocument = this as dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPassportElementWithTranslatableIDDocument +public inline fun ChatIdentifier.chatIdOrThrow(): ChatId = this as dev.inmo.tgbotapi.types.ChatId -public inline fun EncryptedPassportElement.ifEncryptedPassportElementWithTranslatableIDDocument(block: (EncryptedPassportElementWithTranslatableIDDocument) -> T): T? = encryptedPassportElementWithTranslatableIDDocumentOrNull() ?.let(block) +public inline fun ChatIdentifier.ifChatId(block: (ChatId) -> T): T? = chatIdOrNull() ?.let(block) -public inline fun EncryptedPassportElement.driverLicenseOrNull(): DriverLicense? = this as? dev.inmo.tgbotapi.types.passport.encrypted.DriverLicense +public inline fun ChatIdentifier.chatIdWithThreadIdOrNull(): ChatIdWithThreadId? = this as? dev.inmo.tgbotapi.types.ChatIdWithThreadId -public inline fun EncryptedPassportElement.driverLicenseOrThrow(): DriverLicense = this as dev.inmo.tgbotapi.types.passport.encrypted.DriverLicense +public inline fun ChatIdentifier.chatIdWithThreadIdOrThrow(): ChatIdWithThreadId = this as dev.inmo.tgbotapi.types.ChatIdWithThreadId -public inline fun EncryptedPassportElement.ifDriverLicense(block: (DriverLicense) -> T): T? = driverLicenseOrNull() ?.let(block) +public inline fun ChatIdentifier.ifChatIdWithThreadId(block: (ChatIdWithThreadId) -> T): T? = chatIdWithThreadIdOrNull() ?.let(block) -public inline fun EncryptedPassportElement.identityCardOrNull(): IdentityCard? = this as? dev.inmo.tgbotapi.types.passport.encrypted.IdentityCard +public inline fun ChatIdentifier.chatIdWithChannelDirectMessageThreadIdOrNull(): ChatIdWithChannelDirectMessageThreadId? = this as? dev.inmo.tgbotapi.types.ChatIdWithChannelDirectMessageThreadId -public inline fun EncryptedPassportElement.identityCardOrThrow(): IdentityCard = this as dev.inmo.tgbotapi.types.passport.encrypted.IdentityCard +public inline fun ChatIdentifier.chatIdWithChannelDirectMessageThreadIdOrThrow(): ChatIdWithChannelDirectMessageThreadId = this as dev.inmo.tgbotapi.types.ChatIdWithChannelDirectMessageThreadId -public inline fun EncryptedPassportElement.ifIdentityCard(block: (IdentityCard) -> T): T? = identityCardOrNull() ?.let(block) +public inline fun ChatIdentifier.ifChatIdWithChannelDirectMessageThreadId(block: (ChatIdWithChannelDirectMessageThreadId) -> T): T? = chatIdWithChannelDirectMessageThreadIdOrNull() ?.let(block) -public inline fun EncryptedPassportElement.encryptedPassportElementWithFrontSideOrNull(): EncryptedPassportElementWithFrontSide? = this as? dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFrontSide +public inline fun ChatIdentifier.businessChatIdOrNull(): BusinessChatId? = this as? dev.inmo.tgbotapi.types.BusinessChatId -public inline fun EncryptedPassportElement.encryptedPassportElementWithFrontSideOrThrow(): EncryptedPassportElementWithFrontSide = this as dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFrontSide +public inline fun ChatIdentifier.businessChatIdOrThrow(): BusinessChatId = this as dev.inmo.tgbotapi.types.BusinessChatId -public inline fun EncryptedPassportElement.ifEncryptedPassportElementWithFrontSide(block: (EncryptedPassportElementWithFrontSide) -> T): T? = encryptedPassportElementWithFrontSideOrNull() ?.let(block) +public inline fun ChatIdentifier.ifBusinessChatId(block: (BusinessChatId) -> T): T? = businessChatIdOrNull() ?.let(block) -public inline fun EncryptedPassportElement.encryptedPassportElementWithReverseSideOrNull(): EncryptedPassportElementWithReverseSide? = this as? dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithReverseSide +public inline fun ChatIdentifier.usernameOrNull(): Username? = this as? dev.inmo.tgbotapi.types.Username -public inline fun EncryptedPassportElement.encryptedPassportElementWithReverseSideOrThrow(): EncryptedPassportElementWithReverseSide = this as dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithReverseSide +public inline fun ChatIdentifier.usernameOrThrow(): Username = this as dev.inmo.tgbotapi.types.Username -public inline fun EncryptedPassportElement.ifEncryptedPassportElementWithReverseSide(block: (EncryptedPassportElementWithReverseSide) -> T): T? = encryptedPassportElementWithReverseSideOrNull() ?.let(block) +public inline fun ChatIdentifier.ifUsername(block: (Username) -> T): T? = usernameOrNull() ?.let(block) -public inline fun EncryptedPassportElement.encryptedPassportElementWithDataOrNull(): EncryptedPassportElementWithData? = this as? dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithData +public inline fun InlineQueryResult.withCustomizableCaptionInlineQueryResultOrNull(): WithCustomizableCaptionInlineQueryResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithCustomizableCaptionInlineQueryResult -public inline fun EncryptedPassportElement.encryptedPassportElementWithDataOrThrow(): EncryptedPassportElementWithData = this as dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithData +public inline fun InlineQueryResult.withCustomizableCaptionInlineQueryResultOrThrow(): WithCustomizableCaptionInlineQueryResult = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithCustomizableCaptionInlineQueryResult -public inline fun EncryptedPassportElement.ifEncryptedPassportElementWithData(block: (EncryptedPassportElementWithData) -> T): T? = encryptedPassportElementWithDataOrNull() ?.let(block) +public inline fun InlineQueryResult.ifWithCustomizableCaptionInlineQueryResult(block: (WithCustomizableCaptionInlineQueryResult) -> T): T? = withCustomizableCaptionInlineQueryResultOrNull() ?.let(block) -public inline fun EncryptedPassportElement.encryptedPassportElementWithSelfieOrNull(): EncryptedPassportElementWithSelfie? = this as? dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithSelfie +public inline fun InlineQueryResult.titledInlineQueryResultOrNull(): TitledInlineQueryResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.TitledInlineQueryResult -public inline fun EncryptedPassportElement.encryptedPassportElementWithSelfieOrThrow(): EncryptedPassportElementWithSelfie = this as dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithSelfie +public inline fun InlineQueryResult.titledInlineQueryResultOrThrow(): TitledInlineQueryResult = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.TitledInlineQueryResult -public inline fun EncryptedPassportElement.ifEncryptedPassportElementWithSelfie(block: (EncryptedPassportElementWithSelfie) -> T): T? = encryptedPassportElementWithSelfieOrNull() ?.let(block) +public inline fun InlineQueryResult.ifTitledInlineQueryResult(block: (TitledInlineQueryResult) -> T): T? = titledInlineQueryResultOrNull() ?.let(block) -public inline fun EncryptedPassportElement.unknownEncryptedPassportElementOrNull(): UnknownEncryptedPassportElement? = this as? dev.inmo.tgbotapi.types.passport.encrypted.abstracts.UnknownEncryptedPassportElement +public inline fun InlineQueryResult.urlInlineQueryResultOrNull(): UrlInlineQueryResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.UrlInlineQueryResult -public inline fun EncryptedPassportElement.unknownEncryptedPassportElementOrThrow(): UnknownEncryptedPassportElement = this as dev.inmo.tgbotapi.types.passport.encrypted.abstracts.UnknownEncryptedPassportElement +public inline fun InlineQueryResult.urlInlineQueryResultOrThrow(): UrlInlineQueryResult = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.UrlInlineQueryResult -public inline fun EncryptedPassportElement.ifUnknownEncryptedPassportElement(block: (UnknownEncryptedPassportElement) -> T): T? = unknownEncryptedPassportElementOrNull() ?.let(block) +public inline fun InlineQueryResult.ifUrlInlineQueryResult(block: (UrlInlineQueryResult) -> T): T? = urlInlineQueryResultOrNull() ?.let(block) -public inline fun EncryptedPassportElement.encryptedPassportElementWithPhoneNumberOrNull(): EncryptedPassportElementWithPhoneNumber? = this as? dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithPhoneNumber +public inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrNull(): WithInputMessageContentInlineQueryResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult -public inline fun EncryptedPassportElement.encryptedPassportElementWithPhoneNumberOrThrow(): EncryptedPassportElementWithPhoneNumber = this as dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithPhoneNumber +public inline fun InlineQueryResult.withInputMessageContentInlineQueryResultOrThrow(): WithInputMessageContentInlineQueryResult = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult -public inline fun EncryptedPassportElement.ifEncryptedPassportElementWithPhoneNumber(block: (EncryptedPassportElementWithPhoneNumber) -> T): T? = encryptedPassportElementWithPhoneNumberOrNull() ?.let(block) +public inline fun InlineQueryResult.ifWithInputMessageContentInlineQueryResult(block: (WithInputMessageContentInlineQueryResult) -> T): T? = withInputMessageContentInlineQueryResultOrNull() ?.let(block) -public inline fun EncryptedPassportElement.encryptedPassportElementTranslatableOrNull(): EncryptedPassportElementTranslatable? = this as? dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementTranslatable +public inline fun InlineQueryResult.optionallyTitledInlineQueryResultOrNull(): OptionallyTitledInlineQueryResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.OptionallyTitledInlineQueryResult -public inline fun EncryptedPassportElement.encryptedPassportElementTranslatableOrThrow(): EncryptedPassportElementTranslatable = this as dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementTranslatable +public inline fun InlineQueryResult.optionallyTitledInlineQueryResultOrThrow(): OptionallyTitledInlineQueryResult = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.OptionallyTitledInlineQueryResult -public inline fun EncryptedPassportElement.ifEncryptedPassportElementTranslatable(block: (EncryptedPassportElementTranslatable) -> T): T? = encryptedPassportElementTranslatableOrNull() ?.let(block) +public inline fun InlineQueryResult.ifOptionallyTitledInlineQueryResult(block: (OptionallyTitledInlineQueryResult) -> T): T? = optionallyTitledInlineQueryResultOrNull() ?.let(block) -public inline fun EncryptedPassportElement.encryptedPassportElementWithFilesCollectionOrNull(): EncryptedPassportElementWithFilesCollection? = this as? dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFilesCollection +public inline fun InlineQueryResult.inlineQueryResultVoiceCachedOrNull(): InlineQueryResultVoiceCached? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached -public inline fun EncryptedPassportElement.encryptedPassportElementWithFilesCollectionOrThrow(): EncryptedPassportElementWithFilesCollection = this as dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithFilesCollection +public inline fun InlineQueryResult.inlineQueryResultVoiceCachedOrThrow(): InlineQueryResultVoiceCached = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached -public inline fun EncryptedPassportElement.ifEncryptedPassportElementWithFilesCollection(block: (EncryptedPassportElementWithFilesCollection) -> T): T? = encryptedPassportElementWithFilesCollectionOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultVoiceCached(block: (InlineQueryResultVoiceCached) -> T): T? = inlineQueryResultVoiceCachedOrNull() ?.let(block) -public inline fun EncryptedPassportElement.encryptedPassportElementWithEmailOrNull(): EncryptedPassportElementWithEmail? = this as? dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithEmail +public inline fun InlineQueryResult.inlineQueryResultVoiceOrNull(): InlineQueryResultVoice? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice -public inline fun EncryptedPassportElement.encryptedPassportElementWithEmailOrThrow(): EncryptedPassportElementWithEmail = this as dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElementWithEmail +public inline fun InlineQueryResult.inlineQueryResultVoiceOrThrow(): InlineQueryResultVoice = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice -public inline fun EncryptedPassportElement.ifEncryptedPassportElementWithEmail(block: (EncryptedPassportElementWithEmail) -> T): T? = encryptedPassportElementWithEmailOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultVoice(block: (InlineQueryResultVoice) -> T): T? = inlineQueryResultVoiceOrNull() ?.let(block) -public inline fun EncryptedPassportElement.encryptedPersonalDetailsOrNull(): EncryptedPersonalDetails? = this as? dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPersonalDetails +public inline fun InlineQueryResult.inlineQueryResultVoiceCommonOrNull(): InlineQueryResultVoiceCommon? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCommon -public inline fun EncryptedPassportElement.encryptedPersonalDetailsOrThrow(): EncryptedPersonalDetails = this as dev.inmo.tgbotapi.types.passport.encrypted.EncryptedPersonalDetails +public inline fun InlineQueryResult.inlineQueryResultVoiceCommonOrThrow(): InlineQueryResultVoiceCommon = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCommon -public inline fun EncryptedPassportElement.ifEncryptedPersonalDetails(block: (EncryptedPersonalDetails) -> T): T? = encryptedPersonalDetailsOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultVoiceCommon(block: (InlineQueryResultVoiceCommon) -> T): T? = inlineQueryResultVoiceCommonOrNull() ?.let(block) -public inline fun SecureValue.personalDetailsSecureValueOrNull(): PersonalDetailsSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.PersonalDetailsSecureValue +public inline fun InlineQueryResult.inlineQueryResultDocumentCachedOrNull(): InlineQueryResultDocumentCached? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCached -public inline fun SecureValue.personalDetailsSecureValueOrThrow(): PersonalDetailsSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.PersonalDetailsSecureValue +public inline fun InlineQueryResult.inlineQueryResultDocumentCachedOrThrow(): InlineQueryResultDocumentCached = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCached -public inline fun SecureValue.ifPersonalDetailsSecureValue(block: (PersonalDetailsSecureValue) -> T): T? = personalDetailsSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultDocumentCached(block: (InlineQueryResultDocumentCached) -> T): T? = inlineQueryResultDocumentCachedOrNull() ?.let(block) -public inline fun SecureValue.otherDocumentsSecureValueOrNull(): OtherDocumentsSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.OtherDocumentsSecureValue +public inline fun InlineQueryResult.inlineQueryResultDocumentOrNull(): InlineQueryResultDocument? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocument -public inline fun SecureValue.otherDocumentsSecureValueOrThrow(): OtherDocumentsSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.OtherDocumentsSecureValue +public inline fun InlineQueryResult.inlineQueryResultDocumentOrThrow(): InlineQueryResultDocument = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocument -public inline fun SecureValue.ifOtherDocumentsSecureValue(block: (OtherDocumentsSecureValue) -> T): T? = otherDocumentsSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultDocument(block: (InlineQueryResultDocument) -> T): T? = inlineQueryResultDocumentOrNull() ?.let(block) -public inline fun SecureValue.utilityBillSecureValueOrNull(): UtilityBillSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.UtilityBillSecureValue +public inline fun InlineQueryResult.inlineQueryResultDocumentCommonOrNull(): InlineQueryResultDocumentCommon? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCommon -public inline fun SecureValue.utilityBillSecureValueOrThrow(): UtilityBillSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.UtilityBillSecureValue +public inline fun InlineQueryResult.inlineQueryResultDocumentCommonOrThrow(): InlineQueryResultDocumentCommon = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document.InlineQueryResultDocumentCommon -public inline fun SecureValue.ifUtilityBillSecureValue(block: (UtilityBillSecureValue) -> T): T? = utilityBillSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultDocumentCommon(block: (InlineQueryResultDocumentCommon) -> T): T? = inlineQueryResultDocumentCommonOrNull() ?.let(block) -public inline fun SecureValue.bankStatementSecureValueOrNull(): BankStatementSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.BankStatementSecureValue +public inline fun InlineQueryResult.inlineQueryResultPhotoCachedOrNull(): InlineQueryResultPhotoCached? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCached -public inline fun SecureValue.bankStatementSecureValueOrThrow(): BankStatementSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.BankStatementSecureValue +public inline fun InlineQueryResult.inlineQueryResultPhotoCachedOrThrow(): InlineQueryResultPhotoCached = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCached -public inline fun SecureValue.ifBankStatementSecureValue(block: (BankStatementSecureValue) -> T): T? = bankStatementSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultPhotoCached(block: (InlineQueryResultPhotoCached) -> T): T? = inlineQueryResultPhotoCachedOrNull() ?.let(block) -public inline fun SecureValue.rentalAgreementSecureValueOrNull(): RentalAgreementSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.RentalAgreementSecureValue +public inline fun InlineQueryResult.inlineQueryResultPhotoCommonOrNull(): InlineQueryResultPhotoCommon? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCommon -public inline fun SecureValue.rentalAgreementSecureValueOrThrow(): RentalAgreementSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.RentalAgreementSecureValue +public inline fun InlineQueryResult.inlineQueryResultPhotoCommonOrThrow(): InlineQueryResultPhotoCommon = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhotoCommon -public inline fun SecureValue.ifRentalAgreementSecureValue(block: (RentalAgreementSecureValue) -> T): T? = rentalAgreementSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultPhotoCommon(block: (InlineQueryResultPhotoCommon) -> T): T? = inlineQueryResultPhotoCommonOrNull() ?.let(block) -public inline fun SecureValue.passportRegistrationSecureValueOrNull(): PassportRegistrationSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.PassportRegistrationSecureValue +public inline fun InlineQueryResult.inlineQueryResultPhotoOrNull(): InlineQueryResultPhoto? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhoto -public inline fun SecureValue.passportRegistrationSecureValueOrThrow(): PassportRegistrationSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.PassportRegistrationSecureValue +public inline fun InlineQueryResult.inlineQueryResultPhotoOrThrow(): InlineQueryResultPhoto = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo.InlineQueryResultPhoto -public inline fun SecureValue.ifPassportRegistrationSecureValue(block: (PassportRegistrationSecureValue) -> T): T? = passportRegistrationSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultPhoto(block: (InlineQueryResultPhoto) -> T): T? = inlineQueryResultPhotoOrNull() ?.let(block) -public inline fun SecureValue.temporalRegistrationSecureValueOrNull(): TemporalRegistrationSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.TemporalRegistrationSecureValue +public inline fun InlineQueryResult.inlineQueryResultGifCachedOrNull(): InlineQueryResultGifCached? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached -public inline fun SecureValue.temporalRegistrationSecureValueOrThrow(): TemporalRegistrationSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.TemporalRegistrationSecureValue +public inline fun InlineQueryResult.inlineQueryResultGifCachedOrThrow(): InlineQueryResultGifCached = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached -public inline fun SecureValue.ifTemporalRegistrationSecureValue(block: (TemporalRegistrationSecureValue) -> T): T? = temporalRegistrationSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultGifCached(block: (InlineQueryResultGifCached) -> T): T? = inlineQueryResultGifCachedOrNull() ?.let(block) -public inline fun SecureValue.passportSecureValueOrNull(): PassportSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.PassportSecureValue +public inline fun InlineQueryResult.inlineQueryResultGifOrNull(): InlineQueryResultGif? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif -public inline fun SecureValue.passportSecureValueOrThrow(): PassportSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.PassportSecureValue +public inline fun InlineQueryResult.inlineQueryResultGifOrThrow(): InlineQueryResultGif = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif -public inline fun SecureValue.ifPassportSecureValue(block: (PassportSecureValue) -> T): T? = passportSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultGif(block: (InlineQueryResultGif) -> T): T? = inlineQueryResultGifOrNull() ?.let(block) -public inline fun SecureValue.commonPassportSecureValueOrNull(): CommonPassportSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.CommonPassportSecureValue +public inline fun InlineQueryResult.inlineQueryResultGifCommonOrNull(): InlineQueryResultGifCommon? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCommon -public inline fun SecureValue.commonPassportSecureValueOrThrow(): CommonPassportSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.CommonPassportSecureValue +public inline fun InlineQueryResult.inlineQueryResultGifCommonOrThrow(): InlineQueryResultGifCommon = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCommon -public inline fun SecureValue.ifCommonPassportSecureValue(block: (CommonPassportSecureValue) -> T): T? = commonPassportSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultGifCommon(block: (InlineQueryResultGifCommon) -> T): T? = inlineQueryResultGifCommonOrNull() ?.let(block) -public inline fun SecureValue.internalPassportSecureValueOrNull(): InternalPassportSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.InternalPassportSecureValue +public inline fun InlineQueryResult.inlineQueryResultVideoOrNull(): InlineQueryResultVideo? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo -public inline fun SecureValue.internalPassportSecureValueOrThrow(): InternalPassportSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.InternalPassportSecureValue +public inline fun InlineQueryResult.inlineQueryResultVideoOrThrow(): InlineQueryResultVideo = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideo -public inline fun SecureValue.ifInternalPassportSecureValue(block: (InternalPassportSecureValue) -> T): T? = internalPassportSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultVideo(block: (InlineQueryResultVideo) -> T): T? = inlineQueryResultVideoOrNull() ?.let(block) -public inline fun SecureValue.secureValueWithFilesOrNull(): SecureValueWithFiles? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithFiles +public inline fun InlineQueryResult.inlineQueryResultVideoCommonOrNull(): InlineQueryResultVideoCommon? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCommon -public inline fun SecureValue.secureValueWithFilesOrThrow(): SecureValueWithFiles = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithFiles +public inline fun InlineQueryResult.inlineQueryResultVideoCommonOrThrow(): InlineQueryResultVideoCommon = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCommon -public inline fun SecureValue.ifSecureValueWithFiles(block: (SecureValueWithFiles) -> T): T? = secureValueWithFilesOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultVideoCommon(block: (InlineQueryResultVideoCommon) -> T): T? = inlineQueryResultVideoCommonOrNull() ?.let(block) -public inline fun SecureValue.secureValueWithReverseSideOrNull(): SecureValueWithReverseSide? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithReverseSide +public inline fun InlineQueryResult.inlineQueryResultVideoCachedOrNull(): InlineQueryResultVideoCached? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCached -public inline fun SecureValue.secureValueWithReverseSideOrThrow(): SecureValueWithReverseSide = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithReverseSide +public inline fun InlineQueryResult.inlineQueryResultVideoCachedOrThrow(): InlineQueryResultVideoCached = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCached -public inline fun SecureValue.ifSecureValueWithReverseSide(block: (SecureValueWithReverseSide) -> T): T? = secureValueWithReverseSideOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultVideoCached(block: (InlineQueryResultVideoCached) -> T): T? = inlineQueryResultVideoCachedOrNull() ?.let(block) -public inline fun SecureValue.secureValueWithTranslationsOrNull(): SecureValueWithTranslations? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithTranslations +public inline fun InlineQueryResult.inlineQueryResultAudioCachedOrNull(): InlineQueryResultAudioCached? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached -public inline fun SecureValue.secureValueWithTranslationsOrThrow(): SecureValueWithTranslations = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithTranslations +public inline fun InlineQueryResult.inlineQueryResultAudioCachedOrThrow(): InlineQueryResultAudioCached = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCached -public inline fun SecureValue.ifSecureValueWithTranslations(block: (SecureValueWithTranslations) -> T): T? = secureValueWithTranslationsOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultAudioCached(block: (InlineQueryResultAudioCached) -> T): T? = inlineQueryResultAudioCachedOrNull() ?.let(block) -public inline fun SecureValue.secureValueWithDataOrNull(): SecureValueWithData? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithData +public inline fun InlineQueryResult.inlineQueryResultAudioCommonOrNull(): InlineQueryResultAudioCommon? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCommon -public inline fun SecureValue.secureValueWithDataOrThrow(): SecureValueWithData = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithData +public inline fun InlineQueryResult.inlineQueryResultAudioCommonOrThrow(): InlineQueryResultAudioCommon = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudioCommon -public inline fun SecureValue.ifSecureValueWithData(block: (SecureValueWithData) -> T): T? = secureValueWithDataOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultAudioCommon(block: (InlineQueryResultAudioCommon) -> T): T? = inlineQueryResultAudioCommonOrNull() ?.let(block) -public inline fun SecureValue.secureValueIdentityOrNull(): SecureValueIdentity? = this as? dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueIdentity +public inline fun InlineQueryResult.inlineQueryResultAudioOrNull(): InlineQueryResultAudio? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio -public inline fun SecureValue.secureValueIdentityOrThrow(): SecureValueIdentity = this as dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueIdentity +public inline fun InlineQueryResult.inlineQueryResultAudioOrThrow(): InlineQueryResultAudio = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.InlineQueryResultAudio -public inline fun SecureValue.ifSecureValueIdentity(block: (SecureValueIdentity) -> T): T? = secureValueIdentityOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultAudio(block: (InlineQueryResultAudio) -> T): T? = inlineQueryResultAudioOrNull() ?.let(block) -public inline fun SecureValue.identityWithReverseSideSecureValueOrNull(): IdentityWithReverseSideSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.IdentityWithReverseSideSecureValue +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCommonOrNull(): InlineQueryResultMpeg4GifCommon? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCommon -public inline fun SecureValue.identityWithReverseSideSecureValueOrThrow(): IdentityWithReverseSideSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.IdentityWithReverseSideSecureValue +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCommonOrThrow(): InlineQueryResultMpeg4GifCommon = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCommon -public inline fun SecureValue.ifIdentityWithReverseSideSecureValue(block: (IdentityWithReverseSideSecureValue) -> T): T? = identityWithReverseSideSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultMpeg4GifCommon(block: (InlineQueryResultMpeg4GifCommon) -> T): T? = inlineQueryResultMpeg4GifCommonOrNull() ?.let(block) -public inline fun SecureValue.driverLicenseSecureValueOrNull(): DriverLicenseSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.DriverLicenseSecureValue +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedOrNull(): InlineQueryResultMpeg4GifCached? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCached -public inline fun SecureValue.driverLicenseSecureValueOrThrow(): DriverLicenseSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.DriverLicenseSecureValue +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifCachedOrThrow(): InlineQueryResultMpeg4GifCached = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCached -public inline fun SecureValue.ifDriverLicenseSecureValue(block: (DriverLicenseSecureValue) -> T): T? = driverLicenseSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultMpeg4GifCached(block: (InlineQueryResultMpeg4GifCached) -> T): T? = inlineQueryResultMpeg4GifCachedOrNull() ?.let(block) -public inline fun SecureValue.identityCardSecureValueOrNull(): IdentityCardSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.IdentityCardSecureValue +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifOrNull(): InlineQueryResultMpeg4Gif? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif -public inline fun SecureValue.identityCardSecureValueOrThrow(): IdentityCardSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.IdentityCardSecureValue +public inline fun InlineQueryResult.inlineQueryResultMpeg4GifOrThrow(): InlineQueryResultMpeg4Gif = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif -public inline fun SecureValue.ifIdentityCardSecureValue(block: (IdentityCardSecureValue) -> T): T? = identityCardSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultMpeg4Gif(block: (InlineQueryResultMpeg4Gif) -> T): T? = inlineQueryResultMpeg4GifOrNull() ?.let(block) -public inline fun SecureValue.addressSecureValueOrNull(): AddressSecureValue? = this as? dev.inmo.tgbotapi.types.passport.decrypted.AddressSecureValue +public inline fun InlineQueryResult.thumbSizedInlineQueryResultOrNull(): ThumbSizedInlineQueryResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbSizedInlineQueryResult -public inline fun SecureValue.addressSecureValueOrThrow(): AddressSecureValue = this as dev.inmo.tgbotapi.types.passport.decrypted.AddressSecureValue +public inline fun InlineQueryResult.thumbSizedInlineQueryResultOrThrow(): ThumbSizedInlineQueryResult = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbSizedInlineQueryResult -public inline fun SecureValue.ifAddressSecureValue(block: (AddressSecureValue) -> T): T? = addressSecureValueOrNull() ?.let(block) +public inline fun InlineQueryResult.ifThumbSizedInlineQueryResult(block: (ThumbSizedInlineQueryResult) -> T): T? = thumbSizedInlineQueryResultOrNull() ?.let(block) -public inline fun ChatMessageReactionUpdated.byUserOrNull(): ChatMessageReactionUpdated.ByUser? = this as? dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated.ByUser +public inline fun InlineQueryResult.describedInlineQueryResultOrNull(): DescribedInlineQueryResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.DescribedInlineQueryResult -public inline fun ChatMessageReactionUpdated.byUserOrThrow(): ChatMessageReactionUpdated.ByUser = this as dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated.ByUser +public inline fun InlineQueryResult.describedInlineQueryResultOrThrow(): DescribedInlineQueryResult = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.DescribedInlineQueryResult -public inline fun ChatMessageReactionUpdated.ifByUser(block: (ChatMessageReactionUpdated.ByUser) -> T): T? = byUserOrNull() ?.let(block) +public inline fun InlineQueryResult.ifDescribedInlineQueryResult(block: (DescribedInlineQueryResult) -> T): T? = describedInlineQueryResultOrNull() ?.let(block) -public inline fun ChatMessageReactionUpdated.byChatOrNull(): ChatMessageReactionUpdated.ByChat? = this as? dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated.ByChat +public inline fun InlineQueryResult.thumbedInlineQueryResultOrNull(): ThumbedInlineQueryResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedInlineQueryResult -public inline fun ChatMessageReactionUpdated.byChatOrThrow(): ChatMessageReactionUpdated.ByChat = this as dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated.ByChat +public inline fun InlineQueryResult.thumbedInlineQueryResultOrThrow(): ThumbedInlineQueryResult = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedInlineQueryResult -public inline fun ChatMessageReactionUpdated.ifByChat(block: (ChatMessageReactionUpdated.ByChat) -> T): T? = byChatOrNull() ?.let(block) +public inline fun InlineQueryResult.ifThumbedInlineQueryResult(block: (ThumbedInlineQueryResult) -> T): T? = thumbedInlineQueryResultOrNull() ?.let(block) -public inline fun ChatMessageReactionUpdated.unknownOrNull(): ChatMessageReactionUpdated.Unknown? = this as? dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated.Unknown +public inline fun InlineQueryResult.thumbedWithMimeTypeInlineQueryResultOrNull(): ThumbedWithMimeTypeInlineQueryResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedWithMimeTypeInlineQueryResult -public inline fun ChatMessageReactionUpdated.unknownOrThrow(): ChatMessageReactionUpdated.Unknown = this as dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated.Unknown +public inline fun InlineQueryResult.thumbedWithMimeTypeInlineQueryResultOrThrow(): ThumbedWithMimeTypeInlineQueryResult = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.ThumbedWithMimeTypeInlineQueryResult -public inline fun ChatMessageReactionUpdated.ifUnknown(block: (ChatMessageReactionUpdated.Unknown) -> T): T? = unknownOrNull() ?.let(block) +public inline fun InlineQueryResult.ifThumbedWithMimeTypeInlineQueryResult(block: (ThumbedWithMimeTypeInlineQueryResult) -> T): T? = thumbedWithMimeTypeInlineQueryResultOrNull() ?.let(block) -public inline fun Chat.extendedBotOrNull(): ExtendedBot? = this as? dev.inmo.tgbotapi.types.chat.ExtendedBot +public inline fun InlineQueryResult.sizedInlineQueryResultOrNull(): SizedInlineQueryResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.SizedInlineQueryResult -public inline fun Chat.extendedBotOrThrow(): ExtendedBot = this as dev.inmo.tgbotapi.types.chat.ExtendedBot +public inline fun InlineQueryResult.sizedInlineQueryResultOrThrow(): SizedInlineQueryResult = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.SizedInlineQueryResult -public inline fun Chat.ifExtendedBot(block: (ExtendedBot) -> T): T? = extendedBotOrNull() ?.let(block) +public inline fun InlineQueryResult.ifSizedInlineQueryResult(block: (SizedInlineQueryResult) -> T): T? = sizedInlineQueryResultOrNull() ?.let(block) -public inline fun Chat.unknownExtendedChatOrNull(): UnknownExtendedChat? = this as? dev.inmo.tgbotapi.types.chat.UnknownExtendedChat +public inline fun InlineQueryResult.fileInlineQueryResultOrNull(): FileInlineQueryResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.FileInlineQueryResult -public inline fun Chat.unknownExtendedChatOrThrow(): UnknownExtendedChat = this as dev.inmo.tgbotapi.types.chat.UnknownExtendedChat +public inline fun InlineQueryResult.fileInlineQueryResultOrThrow(): FileInlineQueryResult = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.FileInlineQueryResult -public inline fun Chat.ifUnknownExtendedChat(block: (UnknownExtendedChat) -> T): T? = unknownExtendedChatOrNull() ?.let(block) +public inline fun InlineQueryResult.ifFileInlineQueryResult(block: (FileInlineQueryResult) -> T): T? = fileInlineQueryResultOrNull() ?.let(block) -public inline fun Chat.unknownChatTypeOrNull(): UnknownChatType? = this as? dev.inmo.tgbotapi.types.chat.UnknownChatType +public inline fun InlineQueryResult.inlineQueryResultArticleOrNull(): InlineQueryResultArticle? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle -public inline fun Chat.unknownChatTypeOrThrow(): UnknownChatType = this as dev.inmo.tgbotapi.types.chat.UnknownChatType +public inline fun InlineQueryResult.inlineQueryResultArticleOrThrow(): InlineQueryResultArticle = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle -public inline fun Chat.ifUnknownChatType(block: (UnknownChatType) -> T): T? = unknownChatTypeOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultArticle(block: (InlineQueryResultArticle) -> T): T? = inlineQueryResultArticleOrNull() ?.let(block) -public inline fun Chat.previewChatOrNull(): PreviewChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewChat +public inline fun InlineQueryResult.inlineQueryResultVenueOrNull(): InlineQueryResultVenue? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVenue -public inline fun Chat.previewChatOrThrow(): PreviewChat = this as dev.inmo.tgbotapi.types.chat.PreviewChat +public inline fun InlineQueryResult.inlineQueryResultVenueOrThrow(): InlineQueryResultVenue = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultVenue -public inline fun Chat.ifPreviewChat(block: (PreviewChat) -> T): T? = previewChatOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultVenue(block: (InlineQueryResultVenue) -> T): T? = inlineQueryResultVenueOrNull() ?.let(block) -public inline fun Chat.previewUsernameChatOrNull(): PreviewUsernameChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewUsernameChat +public inline fun InlineQueryResult.inlineQueryResultLocationOrNull(): InlineQueryResultLocation? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultLocation -public inline fun Chat.previewUsernameChatOrThrow(): PreviewUsernameChat = this as dev.inmo.tgbotapi.types.chat.PreviewUsernameChat +public inline fun InlineQueryResult.inlineQueryResultLocationOrThrow(): InlineQueryResultLocation = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultLocation -public inline fun Chat.ifPreviewUsernameChat(block: (PreviewUsernameChat) -> T): T? = previewUsernameChatOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultLocation(block: (InlineQueryResultLocation) -> T): T? = inlineQueryResultLocationOrNull() ?.let(block) -public inline fun Chat.previewPrivateChatOrNull(): PreviewPrivateChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewPrivateChat +public inline fun InlineQueryResult.inlineQueryResultContactOrNull(): InlineQueryResultContact? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultContact -public inline fun Chat.previewPrivateChatOrThrow(): PreviewPrivateChat = this as dev.inmo.tgbotapi.types.chat.PreviewPrivateChat +public inline fun InlineQueryResult.inlineQueryResultContactOrThrow(): InlineQueryResultContact = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultContact -public inline fun Chat.ifPreviewPrivateChat(block: (PreviewPrivateChat) -> T): T? = previewPrivateChatOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultContact(block: (InlineQueryResultContact) -> T): T? = inlineQueryResultContactOrNull() ?.let(block) -public inline fun Chat.previewPrivateForumChatOrNull(): PreviewPrivateForumChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewPrivateForumChat +public inline fun InlineQueryResult.inlineQueryResultStickerCachedOrNull(): InlineQueryResultStickerCached? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultStickerCached -public inline fun Chat.previewPrivateForumChatOrThrow(): PreviewPrivateForumChat = this as dev.inmo.tgbotapi.types.chat.PreviewPrivateForumChat +public inline fun InlineQueryResult.inlineQueryResultStickerCachedOrThrow(): InlineQueryResultStickerCached = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultStickerCached -public inline fun Chat.ifPreviewPrivateForumChat(block: (PreviewPrivateForumChat) -> T): T? = previewPrivateForumChatOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultStickerCached(block: (InlineQueryResultStickerCached) -> T): T? = inlineQueryResultStickerCachedOrNull() ?.let(block) -public inline fun Chat.previewBusinessChatOrNull(): PreviewBusinessChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewBusinessChat +public inline fun InlineQueryResult.inlineQueryResultGameOrNull(): InlineQueryResultGame? = this as? dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGame -public inline fun Chat.previewBusinessChatOrThrow(): PreviewBusinessChat = this as dev.inmo.tgbotapi.types.chat.PreviewBusinessChat +public inline fun InlineQueryResult.inlineQueryResultGameOrThrow(): InlineQueryResultGame = this as dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultGame -public inline fun Chat.ifPreviewBusinessChat(block: (PreviewBusinessChat) -> T): T? = previewBusinessChatOrNull() ?.let(block) +public inline fun InlineQueryResult.ifInlineQueryResultGame(block: (InlineQueryResultGame) -> T): T? = inlineQueryResultGameOrNull() ?.let(block) -public inline fun Chat.previewPublicChatOrNull(): PreviewPublicChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewPublicChat +public inline fun InputMessageContent.inputContactMessageContentOrNull(): InputContactMessageContent? = this as? dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputContactMessageContent -public inline fun Chat.previewPublicChatOrThrow(): PreviewPublicChat = this as dev.inmo.tgbotapi.types.chat.PreviewPublicChat +public inline fun InputMessageContent.inputContactMessageContentOrThrow(): InputContactMessageContent = this as dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputContactMessageContent -public inline fun Chat.ifPreviewPublicChat(block: (PreviewPublicChat) -> T): T? = previewPublicChatOrNull() ?.let(block) +public inline fun InputMessageContent.ifInputContactMessageContent(block: (InputContactMessageContent) -> T): T? = inputContactMessageContentOrNull() ?.let(block) -public inline fun Chat.previewSuperPublicChatOrNull(): PreviewSuperPublicChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewSuperPublicChat +public inline fun InputMessageContent.inputLocationMessageContentOrNull(): InputLocationMessageContent? = this as? dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputLocationMessageContent -public inline fun Chat.previewSuperPublicChatOrThrow(): PreviewSuperPublicChat = this as dev.inmo.tgbotapi.types.chat.PreviewSuperPublicChat +public inline fun InputMessageContent.inputLocationMessageContentOrThrow(): InputLocationMessageContent = this as dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputLocationMessageContent -public inline fun Chat.ifPreviewSuperPublicChat(block: (PreviewSuperPublicChat) -> T): T? = previewSuperPublicChatOrNull() ?.let(block) +public inline fun InputMessageContent.ifInputLocationMessageContent(block: (InputLocationMessageContent) -> T): T? = inputLocationMessageContentOrNull() ?.let(block) -public inline fun Chat.previewChannelChatOrNull(): PreviewChannelChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewChannelChat +public inline fun InputMessageContent.inputInvoiceMessageContentOrNull(): InputInvoiceMessageContent? = this as? dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent -public inline fun Chat.previewChannelChatOrThrow(): PreviewChannelChat = this as dev.inmo.tgbotapi.types.chat.PreviewChannelChat +public inline fun InputMessageContent.inputInvoiceMessageContentOrThrow(): InputInvoiceMessageContent = this as dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent -public inline fun Chat.ifPreviewChannelChat(block: (PreviewChannelChat) -> T): T? = previewChannelChatOrNull() ?.let(block) +public inline fun InputMessageContent.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T): T? = inputInvoiceMessageContentOrNull() ?.let(block) -public inline fun Chat.previewGroupChatOrNull(): PreviewGroupChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewGroupChat +public inline fun InputMessageContent.inputTextMessageContentOrNull(): InputTextMessageContent? = this as? dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent -public inline fun Chat.previewGroupChatOrThrow(): PreviewGroupChat = this as dev.inmo.tgbotapi.types.chat.PreviewGroupChat +public inline fun InputMessageContent.inputTextMessageContentOrThrow(): InputTextMessageContent = this as dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent -public inline fun Chat.ifPreviewGroupChat(block: (PreviewGroupChat) -> T): T? = previewGroupChatOrNull() ?.let(block) +public inline fun InputMessageContent.ifInputTextMessageContent(block: (InputTextMessageContent) -> T): T? = inputTextMessageContentOrNull() ?.let(block) -public inline fun Chat.previewSupergroupChatOrNull(): PreviewSupergroupChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewSupergroupChat +public inline fun InputMessageContent.inputVenueMessageContentOrNull(): InputVenueMessageContent? = this as? dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessageContent -public inline fun Chat.previewSupergroupChatOrThrow(): PreviewSupergroupChat = this as dev.inmo.tgbotapi.types.chat.PreviewSupergroupChat +public inline fun InputMessageContent.inputVenueMessageContentOrThrow(): InputVenueMessageContent = this as dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessageContent -public inline fun Chat.ifPreviewSupergroupChat(block: (PreviewSupergroupChat) -> T): T? = previewSupergroupChatOrNull() ?.let(block) +public inline fun InputMessageContent.ifInputVenueMessageContent(block: (InputVenueMessageContent) -> T): T? = inputVenueMessageContentOrNull() ?.let(block) -public inline fun Chat.previewForumChatOrNull(): PreviewForumChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewForumChat +public inline fun BotAction.typingActionOrNull(): TypingAction? = this as? dev.inmo.tgbotapi.types.actions.TypingAction -public inline fun Chat.previewForumChatOrThrow(): PreviewForumChat = this as dev.inmo.tgbotapi.types.chat.PreviewForumChat +public inline fun BotAction.typingActionOrThrow(): TypingAction = this as dev.inmo.tgbotapi.types.actions.TypingAction -public inline fun Chat.ifPreviewForumChat(block: (PreviewForumChat) -> T): T? = previewForumChatOrNull() ?.let(block) +public inline fun BotAction.ifTypingAction(block: (TypingAction) -> T): T? = typingActionOrNull() ?.let(block) -public inline fun Chat.previewChannelDirectMessagesChatOrNull(): PreviewChannelDirectMessagesChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewChannelDirectMessagesChat +public inline fun BotAction.uploadPhotoActionOrNull(): UploadPhotoAction? = this as? dev.inmo.tgbotapi.types.actions.UploadPhotoAction -public inline fun Chat.previewChannelDirectMessagesChatOrThrow(): PreviewChannelDirectMessagesChat = this as dev.inmo.tgbotapi.types.chat.PreviewChannelDirectMessagesChat +public inline fun BotAction.uploadPhotoActionOrThrow(): UploadPhotoAction = this as dev.inmo.tgbotapi.types.actions.UploadPhotoAction -public inline fun Chat.ifPreviewChannelDirectMessagesChat(block: (PreviewChannelDirectMessagesChat) -> T): T? = previewChannelDirectMessagesChatOrNull() ?.let(block) +public inline fun BotAction.ifUploadPhotoAction(block: (UploadPhotoAction) -> T): T? = uploadPhotoActionOrNull() ?.let(block) -public inline fun Chat.extendedChatOrNull(): ExtendedChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedChat +public inline fun BotAction.recordVideoActionOrNull(): RecordVideoAction? = this as? dev.inmo.tgbotapi.types.actions.RecordVideoAction -public inline fun Chat.extendedChatOrThrow(): ExtendedChat = this as dev.inmo.tgbotapi.types.chat.ExtendedChat +public inline fun BotAction.recordVideoActionOrThrow(): RecordVideoAction = this as dev.inmo.tgbotapi.types.actions.RecordVideoAction -public inline fun Chat.ifExtendedChat(block: (ExtendedChat) -> T): T? = extendedChatOrNull() ?.let(block) +public inline fun BotAction.ifRecordVideoAction(block: (RecordVideoAction) -> T): T? = recordVideoActionOrNull() ?.let(block) -public inline fun Chat.extendedNonBotChatOrNull(): ExtendedNonBotChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedNonBotChat +public inline fun BotAction.uploadVideoActionOrNull(): UploadVideoAction? = this as? dev.inmo.tgbotapi.types.actions.UploadVideoAction -public inline fun Chat.extendedNonBotChatOrThrow(): ExtendedNonBotChat = this as dev.inmo.tgbotapi.types.chat.ExtendedNonBotChat +public inline fun BotAction.uploadVideoActionOrThrow(): UploadVideoAction = this as dev.inmo.tgbotapi.types.actions.UploadVideoAction -public inline fun Chat.ifExtendedNonBotChat(block: (ExtendedNonBotChat) -> T): T? = extendedNonBotChatOrNull() ?.let(block) +public inline fun BotAction.ifUploadVideoAction(block: (UploadVideoAction) -> T): T? = uploadVideoActionOrNull() ?.let(block) -public inline fun Chat.extendedChannelChatOrNull(): ExtendedChannelChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedChannelChat +public inline fun BotAction.recordVoiceActionOrNull(): RecordVoiceAction? = this as? dev.inmo.tgbotapi.types.actions.RecordVoiceAction -public inline fun Chat.extendedChannelChatOrThrow(): ExtendedChannelChat = this as dev.inmo.tgbotapi.types.chat.ExtendedChannelChat +public inline fun BotAction.recordVoiceActionOrThrow(): RecordVoiceAction = this as dev.inmo.tgbotapi.types.actions.RecordVoiceAction -public inline fun Chat.ifExtendedChannelChat(block: (ExtendedChannelChat) -> T): T? = extendedChannelChatOrNull() ?.let(block) +public inline fun BotAction.ifRecordVoiceAction(block: (RecordVoiceAction) -> T): T? = recordVoiceActionOrNull() ?.let(block) -public inline fun Chat.extendedGroupChatOrNull(): ExtendedGroupChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedGroupChat +public inline fun BotAction.uploadVoiceActionOrNull(): UploadVoiceAction? = this as? dev.inmo.tgbotapi.types.actions.UploadVoiceAction -public inline fun Chat.extendedGroupChatOrThrow(): ExtendedGroupChat = this as dev.inmo.tgbotapi.types.chat.ExtendedGroupChat +public inline fun BotAction.uploadVoiceActionOrThrow(): UploadVoiceAction = this as dev.inmo.tgbotapi.types.actions.UploadVoiceAction -public inline fun Chat.ifExtendedGroupChat(block: (ExtendedGroupChat) -> T): T? = extendedGroupChatOrNull() ?.let(block) +public inline fun BotAction.ifUploadVoiceAction(block: (UploadVoiceAction) -> T): T? = uploadVoiceActionOrNull() ?.let(block) -public inline fun Chat.extendedPrivateChatOrNull(): ExtendedPrivateChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat +public inline fun BotAction.uploadDocumentActionOrNull(): UploadDocumentAction? = this as? dev.inmo.tgbotapi.types.actions.UploadDocumentAction -public inline fun Chat.extendedPrivateChatOrThrow(): ExtendedPrivateChat = this as dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat +public inline fun BotAction.uploadDocumentActionOrThrow(): UploadDocumentAction = this as dev.inmo.tgbotapi.types.actions.UploadDocumentAction -public inline fun Chat.ifExtendedPrivateChat(block: (ExtendedPrivateChat) -> T): T? = extendedPrivateChatOrNull() ?.let(block) +public inline fun BotAction.ifUploadDocumentAction(block: (UploadDocumentAction) -> T): T? = uploadDocumentActionOrNull() ?.let(block) -public inline fun Chat.extendedPrivateForumChatOrNull(): ExtendedPrivateForumChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedPrivateForumChat +public inline fun BotAction.findLocationActionOrNull(): FindLocationAction? = this as? dev.inmo.tgbotapi.types.actions.FindLocationAction -public inline fun Chat.extendedPrivateForumChatOrThrow(): ExtendedPrivateForumChat = this as dev.inmo.tgbotapi.types.chat.ExtendedPrivateForumChat +public inline fun BotAction.findLocationActionOrThrow(): FindLocationAction = this as dev.inmo.tgbotapi.types.actions.FindLocationAction -public inline fun Chat.ifExtendedPrivateForumChat(block: (ExtendedPrivateForumChat) -> T): T? = extendedPrivateForumChatOrNull() ?.let(block) +public inline fun BotAction.ifFindLocationAction(block: (FindLocationAction) -> T): T? = findLocationActionOrNull() ?.let(block) -public inline fun Chat.extendedPublicChatOrNull(): ExtendedPublicChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedPublicChat +public inline fun BotAction.recordVideoNoteActionOrNull(): RecordVideoNoteAction? = this as? dev.inmo.tgbotapi.types.actions.RecordVideoNoteAction -public inline fun Chat.extendedPublicChatOrThrow(): ExtendedPublicChat = this as dev.inmo.tgbotapi.types.chat.ExtendedPublicChat +public inline fun BotAction.recordVideoNoteActionOrThrow(): RecordVideoNoteAction = this as dev.inmo.tgbotapi.types.actions.RecordVideoNoteAction -public inline fun Chat.ifExtendedPublicChat(block: (ExtendedPublicChat) -> T): T? = extendedPublicChatOrNull() ?.let(block) +public inline fun BotAction.ifRecordVideoNoteAction(block: (RecordVideoNoteAction) -> T): T? = recordVideoNoteActionOrNull() ?.let(block) -public inline fun Chat.extendedSupergroupChatOrNull(): ExtendedSupergroupChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat +public inline fun BotAction.uploadVideoNoteActionOrNull(): UploadVideoNoteAction? = this as? dev.inmo.tgbotapi.types.actions.UploadVideoNoteAction -public inline fun Chat.extendedSupergroupChatOrThrow(): ExtendedSupergroupChat = this as dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat +public inline fun BotAction.uploadVideoNoteActionOrThrow(): UploadVideoNoteAction = this as dev.inmo.tgbotapi.types.actions.UploadVideoNoteAction -public inline fun Chat.ifExtendedSupergroupChat(block: (ExtendedSupergroupChat) -> T): T? = extendedSupergroupChatOrNull() ?.let(block) +public inline fun BotAction.ifUploadVideoNoteAction(block: (UploadVideoNoteAction) -> T): T? = uploadVideoNoteActionOrNull() ?.let(block) -public inline fun Chat.extendedForumChatOrNull(): ExtendedForumChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedForumChat +public inline fun BotAction.chooseStickerActionOrNull(): ChooseStickerAction? = this as? dev.inmo.tgbotapi.types.actions.ChooseStickerAction -public inline fun Chat.extendedForumChatOrThrow(): ExtendedForumChat = this as dev.inmo.tgbotapi.types.chat.ExtendedForumChat +public inline fun BotAction.chooseStickerActionOrThrow(): ChooseStickerAction = this as dev.inmo.tgbotapi.types.actions.ChooseStickerAction -public inline fun Chat.ifExtendedForumChat(block: (ExtendedForumChat) -> T): T? = extendedForumChatOrNull() ?.let(block) +public inline fun BotAction.ifChooseStickerAction(block: (ChooseStickerAction) -> T): T? = chooseStickerActionOrNull() ?.let(block) -public inline fun Chat.extendedChannelDirectMessagesChatOrNull(): ExtendedChannelDirectMessagesChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedChannelDirectMessagesChat +public inline fun BotAction.customBotActionOrNull(): CustomBotAction? = this as? dev.inmo.tgbotapi.types.actions.CustomBotAction -public inline fun Chat.extendedChannelDirectMessagesChatOrThrow(): ExtendedChannelDirectMessagesChat = this as dev.inmo.tgbotapi.types.chat.ExtendedChannelDirectMessagesChat +public inline fun BotAction.customBotActionOrThrow(): CustomBotAction = this as dev.inmo.tgbotapi.types.actions.CustomBotAction -public inline fun Chat.ifExtendedChannelDirectMessagesChat(block: (ExtendedChannelDirectMessagesChat) -> T): T? = extendedChannelDirectMessagesChatOrNull() ?.let(block) +public inline fun BotAction.ifCustomBotAction(block: (CustomBotAction) -> T): T? = customBotActionOrNull() ?.let(block) -public inline fun Chat.extendedChatWithUsernameOrNull(): ExtendedChatWithUsername? = this as? dev.inmo.tgbotapi.types.chat.ExtendedChatWithUsername +public inline fun BackgroundFill.solidOrNull(): BackgroundFill.Solid? = this as? dev.inmo.tgbotapi.types.BackgroundFill.Solid -public inline fun Chat.extendedChatWithUsernameOrThrow(): ExtendedChatWithUsername = this as dev.inmo.tgbotapi.types.chat.ExtendedChatWithUsername +public inline fun BackgroundFill.solidOrThrow(): BackgroundFill.Solid = this as dev.inmo.tgbotapi.types.BackgroundFill.Solid -public inline fun Chat.ifExtendedChatWithUsername(block: (ExtendedChatWithUsername) -> T): T? = extendedChatWithUsernameOrNull() ?.let(block) +public inline fun BackgroundFill.ifSolid(block: (BackgroundFill.Solid) -> T): T? = solidOrNull() ?.let(block) -public inline fun Chat.extendedBusinessChatOrNull(): ExtendedBusinessChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedBusinessChat +public inline fun BackgroundFill.gradientOrNull(): BackgroundFill.Gradient? = this as? dev.inmo.tgbotapi.types.BackgroundFill.Gradient -public inline fun Chat.extendedBusinessChatOrThrow(): ExtendedBusinessChat = this as dev.inmo.tgbotapi.types.chat.ExtendedBusinessChat +public inline fun BackgroundFill.gradientOrThrow(): BackgroundFill.Gradient = this as dev.inmo.tgbotapi.types.BackgroundFill.Gradient -public inline fun Chat.ifExtendedBusinessChat(block: (ExtendedBusinessChat) -> T): T? = extendedBusinessChatOrNull() ?.let(block) +public inline fun BackgroundFill.ifGradient(block: (BackgroundFill.Gradient) -> T): T? = gradientOrNull() ?.let(block) + +public inline fun BackgroundFill.freeformGradientOrNull(): BackgroundFill.FreeformGradient? = this as? dev.inmo.tgbotapi.types.BackgroundFill.FreeformGradient + +public inline fun BackgroundFill.freeformGradientOrThrow(): BackgroundFill.FreeformGradient = this as dev.inmo.tgbotapi.types.BackgroundFill.FreeformGradient + +public inline fun BackgroundFill.ifFreeformGradient(block: (BackgroundFill.FreeformGradient) -> T): T? = freeformGradientOrNull() ?.let(block) + +public inline fun BackgroundFill.unknownOrNull(): BackgroundFill.Unknown? = this as? dev.inmo.tgbotapi.types.BackgroundFill.Unknown + +public inline fun BackgroundFill.unknownOrThrow(): BackgroundFill.Unknown = this as dev.inmo.tgbotapi.types.BackgroundFill.Unknown + +public inline fun BackgroundFill.ifUnknown(block: (BackgroundFill.Unknown) -> T): T? = unknownOrNull() ?.let(block) + +public inline fun ReplyInfo.internalOrNull(): ReplyInfo.Internal? = this as? dev.inmo.tgbotapi.types.ReplyInfo.Internal + +public inline fun ReplyInfo.internalOrThrow(): ReplyInfo.Internal = this as dev.inmo.tgbotapi.types.ReplyInfo.Internal + +public inline fun ReplyInfo.ifInternal(block: (ReplyInfo.Internal) -> T): T? = internalOrNull() ?.let(block) + +public inline fun ReplyInfo.toStoryOrNull(): ReplyInfo.ToStory? = this as? dev.inmo.tgbotapi.types.ReplyInfo.ToStory + +public inline fun ReplyInfo.toStoryOrThrow(): ReplyInfo.ToStory = this as dev.inmo.tgbotapi.types.ReplyInfo.ToStory + +public inline fun ReplyInfo.ifToStory(block: (ReplyInfo.ToStory) -> T): T? = toStoryOrNull() ?.let(block) + +public inline fun ReplyInfo.externalOrNull(): ReplyInfo.External? = this as? dev.inmo.tgbotapi.types.ReplyInfo.External + +public inline fun ReplyInfo.externalOrThrow(): ReplyInfo.External = this as dev.inmo.tgbotapi.types.ReplyInfo.External + +public inline fun ReplyInfo.ifExternal(block: (ReplyInfo.External) -> T): T? = externalOrNull() ?.let(block) + +public inline fun ReplyInfo.externalTextOrNull(): ReplyInfo.External.Text? = this as? dev.inmo.tgbotapi.types.ReplyInfo.External.Text + +public inline fun ReplyInfo.externalTextOrThrow(): ReplyInfo.External.Text = this as dev.inmo.tgbotapi.types.ReplyInfo.External.Text + +public inline fun ReplyInfo.ifExternalText(block: (ReplyInfo.External.Text) -> T): T? = externalTextOrNull() ?.let(block) + +public inline fun ReplyInfo.externalContentOrNull(): ReplyInfo.External.Content? = this as? dev.inmo.tgbotapi.types.ReplyInfo.External.Content + +public inline fun ReplyInfo.externalContentOrThrow(): ReplyInfo.External.Content = this as dev.inmo.tgbotapi.types.ReplyInfo.External.Content + +public inline fun ReplyInfo.ifExternalContent(block: (ReplyInfo.External.Content) -> T): T? = externalContentOrNull() ?.let(block) + +public inline fun ReplyInfo.externalContentSimpleOrNull(): ReplyInfo.External.Content.Simple? = this as? dev.inmo.tgbotapi.types.ReplyInfo.External.Content.Simple + +public inline fun ReplyInfo.externalContentSimpleOrThrow(): ReplyInfo.External.Content.Simple = this as dev.inmo.tgbotapi.types.ReplyInfo.External.Content.Simple + +public inline fun ReplyInfo.ifExternalContentSimple(block: (ReplyInfo.External.Content.Simple) -> T): T? = externalContentSimpleOrNull() ?.let(block) + +public inline fun ReplyInfo.externalContentMediaOrNull(): ReplyInfo.External.Content.Media? = this as? dev.inmo.tgbotapi.types.ReplyInfo.External.Content.Media + +public inline fun ReplyInfo.externalContentMediaOrThrow(): ReplyInfo.External.Content.Media = this as dev.inmo.tgbotapi.types.ReplyInfo.External.Content.Media + +public inline fun ReplyInfo.ifExternalContentMedia(block: (ReplyInfo.External.Content.Media) -> T): T? = externalContentMediaOrNull() ?.let(block) + +public inline fun ChatBoostSource.byUserOrNull(): ChatBoostSource.ByUser? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.ByUser + +public inline fun ChatBoostSource.byUserOrThrow(): ChatBoostSource.ByUser = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.ByUser + +public inline fun ChatBoostSource.ifByUser(block: (ChatBoostSource.ByUser) -> T): T? = byUserOrNull() ?.let(block) + +public inline fun ChatBoostSource.premiumOrNull(): ChatBoostSource.Premium? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Premium + +public inline fun ChatBoostSource.premiumOrThrow(): ChatBoostSource.Premium = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Premium + +public inline fun ChatBoostSource.ifPremium(block: (ChatBoostSource.Premium) -> T): T? = premiumOrNull() ?.let(block) + +public inline fun ChatBoostSource.giftCodeOrNull(): ChatBoostSource.GiftCode? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.GiftCode + +public inline fun ChatBoostSource.giftCodeOrThrow(): ChatBoostSource.GiftCode = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.GiftCode + +public inline fun ChatBoostSource.ifGiftCode(block: (ChatBoostSource.GiftCode) -> T): T? = giftCodeOrNull() ?.let(block) + +public inline fun ChatBoostSource.giveawayOrNull(): ChatBoostSource.Giveaway? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway + +public inline fun ChatBoostSource.giveawayOrThrow(): ChatBoostSource.Giveaway = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway + +public inline fun ChatBoostSource.ifGiveaway(block: (ChatBoostSource.Giveaway) -> T): T? = giveawayOrNull() ?.let(block) + +public inline fun ChatBoostSource.unknownOrNull(): ChatBoostSource.Unknown? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Unknown + +public inline fun ChatBoostSource.unknownOrThrow(): ChatBoostSource.Unknown = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Unknown + +public inline fun ChatBoostSource.ifUnknown(block: (ChatBoostSource.Unknown) -> T): T? = unknownOrNull() ?.let(block) + +public inline fun ChatBoostSource.giveawayCreatedOrNull(): ChatBoostSource.Giveaway.Created? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Created + +public inline fun ChatBoostSource.giveawayCreatedOrThrow(): ChatBoostSource.Giveaway.Created = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Created + +public inline fun ChatBoostSource.ifGiveawayCreated(block: (ChatBoostSource.Giveaway.Created) -> T): T? = giveawayCreatedOrNull() ?.let(block) + +public inline fun ChatBoostSource.giveawayClaimedOrNull(): ChatBoostSource.Giveaway.Claimed? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Claimed + +public inline fun ChatBoostSource.giveawayClaimedOrThrow(): ChatBoostSource.Giveaway.Claimed = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Claimed + +public inline fun ChatBoostSource.ifGiveawayClaimed(block: (ChatBoostSource.Giveaway.Claimed) -> T): T? = giveawayClaimedOrNull() ?.let(block) + +public inline fun ChatBoostSource.giveawayUnclaimedOrNull(): ChatBoostSource.Giveaway.Unclaimed? = this as? dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Unclaimed + +public inline fun ChatBoostSource.giveawayUnclaimedOrThrow(): ChatBoostSource.Giveaway.Unclaimed = this as dev.inmo.tgbotapi.types.boosts.ChatBoostSource.Giveaway.Unclaimed + +public inline fun ChatBoostSource.ifGiveawayUnclaimed(block: (ChatBoostSource.Giveaway.Unclaimed) -> T): T? = giveawayUnclaimedOrNull() ?.let(block) + +public inline fun BusinessConnection.enabledOrNull(): BusinessConnection.Enabled? = this as? dev.inmo.tgbotapi.types.business_connection.BusinessConnection.Enabled + +public inline fun BusinessConnection.enabledOrThrow(): BusinessConnection.Enabled = this as dev.inmo.tgbotapi.types.business_connection.BusinessConnection.Enabled + +public inline fun BusinessConnection.ifEnabled(block: (BusinessConnection.Enabled) -> T): T? = enabledOrNull() ?.let(block) + +public inline fun BusinessConnection.disabledOrNull(): BusinessConnection.Disabled? = this as? dev.inmo.tgbotapi.types.business_connection.BusinessConnection.Disabled + +public inline fun BusinessConnection.disabledOrThrow(): BusinessConnection.Disabled = this as dev.inmo.tgbotapi.types.business_connection.BusinessConnection.Disabled + +public inline fun BusinessConnection.ifDisabled(block: (BusinessConnection.Disabled) -> T): T? = disabledOrNull() ?.let(block) + +public inline fun Update.deletedBusinessMessageUpdateOrNull(): DeletedBusinessMessageUpdate? = this as? dev.inmo.tgbotapi.types.update.DeletedBusinessMessageUpdate + +public inline fun Update.deletedBusinessMessageUpdateOrThrow(): DeletedBusinessMessageUpdate = this as dev.inmo.tgbotapi.types.update.DeletedBusinessMessageUpdate + +public inline fun Update.ifDeletedBusinessMessageUpdate(block: (DeletedBusinessMessageUpdate) -> T): T? = deletedBusinessMessageUpdateOrNull() ?.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.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.chatBoostUpdatedUpdateOrNull(): ChatBoostUpdatedUpdate? = this as? dev.inmo.tgbotapi.types.update.ChatBoostUpdatedUpdate + +public inline fun Update.chatBoostUpdatedUpdateOrThrow(): ChatBoostUpdatedUpdate = this as dev.inmo.tgbotapi.types.update.ChatBoostUpdatedUpdate + +public inline fun Update.ifChatBoostUpdatedUpdate(block: (ChatBoostUpdatedUpdate) -> T): T? = chatBoostUpdatedUpdateOrNull() ?.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.guestMessageUpdateOrNull(): GuestMessageUpdate? = this as? dev.inmo.tgbotapi.types.update.GuestMessageUpdate + +public inline fun Update.guestMessageUpdateOrThrow(): GuestMessageUpdate = this as dev.inmo.tgbotapi.types.update.GuestMessageUpdate + +public inline fun Update.ifGuestMessageUpdate(block: (GuestMessageUpdate) -> T): T? = guestMessageUpdateOrNull() ?.let(block) + +public inline fun Update.chatMessageReactionUpdatedUpdateOrNull(): ChatMessageReactionUpdatedUpdate? = this as? dev.inmo.tgbotapi.types.update.ChatMessageReactionUpdatedUpdate + +public inline fun Update.chatMessageReactionUpdatedUpdateOrThrow(): ChatMessageReactionUpdatedUpdate = this as dev.inmo.tgbotapi.types.update.ChatMessageReactionUpdatedUpdate + +public inline fun Update.ifChatMessageReactionUpdatedUpdate(block: (ChatMessageReactionUpdatedUpdate) -> T): T? = chatMessageReactionUpdatedUpdateOrNull() ?.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.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.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.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.chatMessageReactionsCountUpdatedUpdateOrNull(): ChatMessageReactionsCountUpdatedUpdate? = this as? dev.inmo.tgbotapi.types.update.ChatMessageReactionsCountUpdatedUpdate + +public inline fun Update.chatMessageReactionsCountUpdatedUpdateOrThrow(): ChatMessageReactionsCountUpdatedUpdate = this as dev.inmo.tgbotapi.types.update.ChatMessageReactionsCountUpdatedUpdate + +public inline fun Update.ifChatMessageReactionsCountUpdatedUpdate(block: (ChatMessageReactionsCountUpdatedUpdate) -> T): T? = chatMessageReactionsCountUpdatedUpdateOrNull() ?.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.chatBoostRemovedUpdateOrNull(): ChatBoostRemovedUpdate? = this as? dev.inmo.tgbotapi.types.update.ChatBoostRemovedUpdate + +public inline fun Update.chatBoostRemovedUpdateOrThrow(): ChatBoostRemovedUpdate = this as dev.inmo.tgbotapi.types.update.ChatBoostRemovedUpdate + +public inline fun Update.ifChatBoostRemovedUpdate(block: (ChatBoostRemovedUpdate) -> T): T? = chatBoostRemovedUpdateOrNull() ?.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.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.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.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.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.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.editBusinessMessageUpdateOrNull(): EditBusinessMessageUpdate? = this as? dev.inmo.tgbotapi.types.update.EditBusinessMessageUpdate + +public inline fun Update.editBusinessMessageUpdateOrThrow(): EditBusinessMessageUpdate = this as dev.inmo.tgbotapi.types.update.EditBusinessMessageUpdate + +public inline fun Update.ifEditBusinessMessageUpdate(block: (EditBusinessMessageUpdate) -> T): T? = editBusinessMessageUpdateOrNull() ?.let(block) + +public inline fun Update.paidMediaPurchasedUpdateOrNull(): PaidMediaPurchasedUpdate? = this as? dev.inmo.tgbotapi.types.update.PaidMediaPurchasedUpdate + +public inline fun Update.paidMediaPurchasedUpdateOrThrow(): PaidMediaPurchasedUpdate = this as dev.inmo.tgbotapi.types.update.PaidMediaPurchasedUpdate + +public inline fun Update.ifPaidMediaPurchasedUpdate(block: (PaidMediaPurchasedUpdate) -> T): T? = paidMediaPurchasedUpdateOrNull() ?.let(block) + +public inline fun Update.managedBotUpdateOrNull(): ManagedBotUpdate? = this as? dev.inmo.tgbotapi.types.update.ManagedBotUpdate + +public inline fun Update.managedBotUpdateOrThrow(): ManagedBotUpdate = this as dev.inmo.tgbotapi.types.update.ManagedBotUpdate + +public inline fun Update.ifManagedBotUpdate(block: (ManagedBotUpdate) -> T): T? = managedBotUpdateOrNull() ?.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.businessConnectionUpdateOrNull(): BusinessConnectionUpdate? = this as? dev.inmo.tgbotapi.types.update.BusinessConnectionUpdate + +public inline fun Update.businessConnectionUpdateOrThrow(): BusinessConnectionUpdate = this as dev.inmo.tgbotapi.types.update.BusinessConnectionUpdate + +public inline fun Update.ifBusinessConnectionUpdate(block: (BusinessConnectionUpdate) -> T): T? = businessConnectionUpdateOrNull() ?.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.businessMessageUpdateOrNull(): BusinessMessageUpdate? = this as? dev.inmo.tgbotapi.types.update.BusinessMessageUpdate + +public inline fun Update.businessMessageUpdateOrThrow(): BusinessMessageUpdate = this as dev.inmo.tgbotapi.types.update.BusinessMessageUpdate + +public inline fun Update.ifBusinessMessageUpdate(block: (BusinessMessageUpdate) -> T): T? = businessMessageUpdateOrNull() ?.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.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 KeyboardButtonRequestUsers.anyOrNull(): KeyboardButtonRequestUsers.Any? = this as? dev.inmo.tgbotapi.types.buttons.KeyboardButtonRequestUsers.Any + +public inline fun KeyboardButtonRequestUsers.anyOrThrow(): KeyboardButtonRequestUsers.Any = this as dev.inmo.tgbotapi.types.buttons.KeyboardButtonRequestUsers.Any + +public inline fun KeyboardButtonRequestUsers.ifAny(block: (KeyboardButtonRequestUsers.Any) -> T): T? = anyOrNull() ?.let(block) + +public inline fun KeyboardButtonRequestUsers.commonOrNull(): KeyboardButtonRequestUsers.Common? = this as? dev.inmo.tgbotapi.types.buttons.KeyboardButtonRequestUsers.Common + +public inline fun KeyboardButtonRequestUsers.commonOrThrow(): KeyboardButtonRequestUsers.Common = this as dev.inmo.tgbotapi.types.buttons.KeyboardButtonRequestUsers.Common + +public inline fun KeyboardButtonRequestUsers.ifCommon(block: (KeyboardButtonRequestUsers.Common) -> T): T? = commonOrNull() ?.let(block) + +public inline fun KeyboardButtonRequestUsers.botOrNull(): KeyboardButtonRequestUsers.Bot? = this as? dev.inmo.tgbotapi.types.buttons.KeyboardButtonRequestUsers.Bot + +public inline fun KeyboardButtonRequestUsers.botOrThrow(): KeyboardButtonRequestUsers.Bot = this as dev.inmo.tgbotapi.types.buttons.KeyboardButtonRequestUsers.Bot + +public inline fun KeyboardButtonRequestUsers.ifBot(block: (KeyboardButtonRequestUsers.Bot) -> T): T? = botOrNull() ?.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.switchInlineQueryChosenChatInlineKeyboardButtonOrNull(): SwitchInlineQueryChosenChatInlineKeyboardButton? = this as? dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryChosenChatInlineKeyboardButton + +public inline fun InlineKeyboardButton.switchInlineQueryChosenChatInlineKeyboardButtonOrThrow(): SwitchInlineQueryChosenChatInlineKeyboardButton = this as dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.SwitchInlineQueryChosenChatInlineKeyboardButton + +public inline fun InlineKeyboardButton.ifSwitchInlineQueryChosenChatInlineKeyboardButton(block: (SwitchInlineQueryChosenChatInlineKeyboardButton) -> T): T? = switchInlineQueryChosenChatInlineKeyboardButtonOrNull() ?.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.copyTextButtonOrNull(): CopyTextButton? = this as? dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CopyTextButton + +public inline fun InlineKeyboardButton.copyTextButtonOrThrow(): CopyTextButton = this as dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.CopyTextButton + +public inline fun InlineKeyboardButton.ifCopyTextButton(block: (CopyTextButton) -> T): T? = copyTextButtonOrNull() ?.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.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 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 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 Chat.usernameChatOrNull(): UsernameChat? = this as? dev.inmo.tgbotapi.types.chat.UsernameChat @@ -3148,6 +3888,168 @@ public inline fun Chat.ableToAddInAttachmentMenuChatOrThrow(): AbleToAddInAttach public inline fun Chat.ifAbleToAddInAttachmentMenuChat(block: (AbleToAddInAttachmentMenuChat) -> T): T? = ableToAddInAttachmentMenuChatOrNull() ?.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 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.extendedNonBotChatOrNull(): ExtendedNonBotChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedNonBotChat + +public inline fun Chat.extendedNonBotChatOrThrow(): ExtendedNonBotChat = this as dev.inmo.tgbotapi.types.chat.ExtendedNonBotChat + +public inline fun Chat.ifExtendedNonBotChat(block: (ExtendedNonBotChat) -> T): T? = extendedNonBotChatOrNull() ?.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.extendedPrivateForumChatOrNull(): ExtendedPrivateForumChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedPrivateForumChat + +public inline fun Chat.extendedPrivateForumChatOrThrow(): ExtendedPrivateForumChat = this as dev.inmo.tgbotapi.types.chat.ExtendedPrivateForumChat + +public inline fun Chat.ifExtendedPrivateForumChat(block: (ExtendedPrivateForumChat) -> T): T? = extendedPrivateForumChatOrNull() ?.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.extendedForumChatOrNull(): ExtendedForumChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedForumChat + +public inline fun Chat.extendedForumChatOrThrow(): ExtendedForumChat = this as dev.inmo.tgbotapi.types.chat.ExtendedForumChat + +public inline fun Chat.ifExtendedForumChat(block: (ExtendedForumChat) -> T): T? = extendedForumChatOrNull() ?.let(block) + +public inline fun Chat.extendedChannelDirectMessagesChatOrNull(): ExtendedChannelDirectMessagesChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedChannelDirectMessagesChat + +public inline fun Chat.extendedChannelDirectMessagesChatOrThrow(): ExtendedChannelDirectMessagesChat = this as dev.inmo.tgbotapi.types.chat.ExtendedChannelDirectMessagesChat + +public inline fun Chat.ifExtendedChannelDirectMessagesChat(block: (ExtendedChannelDirectMessagesChat) -> T): T? = extendedChannelDirectMessagesChatOrNull() ?.let(block) + +public inline fun Chat.extendedChatWithUsernameOrNull(): ExtendedChatWithUsername? = this as? dev.inmo.tgbotapi.types.chat.ExtendedChatWithUsername + +public inline fun Chat.extendedChatWithUsernameOrThrow(): ExtendedChatWithUsername = this as dev.inmo.tgbotapi.types.chat.ExtendedChatWithUsername + +public inline fun Chat.ifExtendedChatWithUsername(block: (ExtendedChatWithUsername) -> T): T? = extendedChatWithUsernameOrNull() ?.let(block) + +public inline fun Chat.extendedBusinessChatOrNull(): ExtendedBusinessChat? = this as? dev.inmo.tgbotapi.types.chat.ExtendedBusinessChat + +public inline fun Chat.extendedBusinessChatOrThrow(): ExtendedBusinessChat = this as dev.inmo.tgbotapi.types.chat.ExtendedBusinessChat + +public inline fun Chat.ifExtendedBusinessChat(block: (ExtendedBusinessChat) -> T): T? = extendedBusinessChatOrNull() ?.let(block) + +public inline fun Chat.previewChatOrNull(): PreviewChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewChat + +public inline fun Chat.previewChatOrThrow(): PreviewChat = this as dev.inmo.tgbotapi.types.chat.PreviewChat + +public inline fun Chat.ifPreviewChat(block: (PreviewChat) -> T): T? = previewChatOrNull() ?.let(block) + +public inline fun Chat.previewUsernameChatOrNull(): PreviewUsernameChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewUsernameChat + +public inline fun Chat.previewUsernameChatOrThrow(): PreviewUsernameChat = this as dev.inmo.tgbotapi.types.chat.PreviewUsernameChat + +public inline fun Chat.ifPreviewUsernameChat(block: (PreviewUsernameChat) -> T): T? = previewUsernameChatOrNull() ?.let(block) + +public inline fun Chat.previewPrivateChatOrNull(): PreviewPrivateChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewPrivateChat + +public inline fun Chat.previewPrivateChatOrThrow(): PreviewPrivateChat = this as dev.inmo.tgbotapi.types.chat.PreviewPrivateChat + +public inline fun Chat.ifPreviewPrivateChat(block: (PreviewPrivateChat) -> T): T? = previewPrivateChatOrNull() ?.let(block) + +public inline fun Chat.previewPrivateForumChatOrNull(): PreviewPrivateForumChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewPrivateForumChat + +public inline fun Chat.previewPrivateForumChatOrThrow(): PreviewPrivateForumChat = this as dev.inmo.tgbotapi.types.chat.PreviewPrivateForumChat + +public inline fun Chat.ifPreviewPrivateForumChat(block: (PreviewPrivateForumChat) -> T): T? = previewPrivateForumChatOrNull() ?.let(block) + +public inline fun Chat.previewBusinessChatOrNull(): PreviewBusinessChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewBusinessChat + +public inline fun Chat.previewBusinessChatOrThrow(): PreviewBusinessChat = this as dev.inmo.tgbotapi.types.chat.PreviewBusinessChat + +public inline fun Chat.ifPreviewBusinessChat(block: (PreviewBusinessChat) -> T): T? = previewBusinessChatOrNull() ?.let(block) + +public inline fun Chat.previewPublicChatOrNull(): PreviewPublicChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewPublicChat + +public inline fun Chat.previewPublicChatOrThrow(): PreviewPublicChat = this as dev.inmo.tgbotapi.types.chat.PreviewPublicChat + +public inline fun Chat.ifPreviewPublicChat(block: (PreviewPublicChat) -> T): T? = previewPublicChatOrNull() ?.let(block) + +public inline fun Chat.previewSuperPublicChatOrNull(): PreviewSuperPublicChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewSuperPublicChat + +public inline fun Chat.previewSuperPublicChatOrThrow(): PreviewSuperPublicChat = this as dev.inmo.tgbotapi.types.chat.PreviewSuperPublicChat + +public inline fun Chat.ifPreviewSuperPublicChat(block: (PreviewSuperPublicChat) -> T): T? = previewSuperPublicChatOrNull() ?.let(block) + +public inline fun Chat.previewChannelChatOrNull(): PreviewChannelChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewChannelChat + +public inline fun Chat.previewChannelChatOrThrow(): PreviewChannelChat = this as dev.inmo.tgbotapi.types.chat.PreviewChannelChat + +public inline fun Chat.ifPreviewChannelChat(block: (PreviewChannelChat) -> T): T? = previewChannelChatOrNull() ?.let(block) + +public inline fun Chat.previewGroupChatOrNull(): PreviewGroupChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewGroupChat + +public inline fun Chat.previewGroupChatOrThrow(): PreviewGroupChat = this as dev.inmo.tgbotapi.types.chat.PreviewGroupChat + +public inline fun Chat.ifPreviewGroupChat(block: (PreviewGroupChat) -> T): T? = previewGroupChatOrNull() ?.let(block) + +public inline fun Chat.previewSupergroupChatOrNull(): PreviewSupergroupChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewSupergroupChat + +public inline fun Chat.previewSupergroupChatOrThrow(): PreviewSupergroupChat = this as dev.inmo.tgbotapi.types.chat.PreviewSupergroupChat + +public inline fun Chat.ifPreviewSupergroupChat(block: (PreviewSupergroupChat) -> T): T? = previewSupergroupChatOrNull() ?.let(block) + +public inline fun Chat.previewForumChatOrNull(): PreviewForumChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewForumChat + +public inline fun Chat.previewForumChatOrThrow(): PreviewForumChat = this as dev.inmo.tgbotapi.types.chat.PreviewForumChat + +public inline fun Chat.ifPreviewForumChat(block: (PreviewForumChat) -> T): T? = previewForumChatOrNull() ?.let(block) + +public inline fun Chat.previewChannelDirectMessagesChatOrNull(): PreviewChannelDirectMessagesChat? = this as? dev.inmo.tgbotapi.types.chat.PreviewChannelDirectMessagesChat + +public inline fun Chat.previewChannelDirectMessagesChatOrThrow(): PreviewChannelDirectMessagesChat = this as dev.inmo.tgbotapi.types.chat.PreviewChannelDirectMessagesChat + +public inline fun Chat.ifPreviewChannelDirectMessagesChat(block: (PreviewChannelDirectMessagesChat) -> T): T? = previewChannelDirectMessagesChatOrNull() ?.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.userOrNull(): User? = this as? dev.inmo.tgbotapi.types.chat.User public inline fun Chat.userOrThrow(): User = this as dev.inmo.tgbotapi.types.chat.User @@ -3184,881 +4086,59 @@ public inline fun Chat.commonUserOrThrow(): CommonUser = this as dev.inmo.tgbota public inline fun Chat.ifCommonUser(block: (CommonUser) -> T): T? = commonUserOrNull() ?.let(block) -public inline fun TelegramMedia.telegramPaidMediaLivePhotoOrNull(): TelegramPaidMediaLivePhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramPaidMediaLivePhoto +public inline fun ChatMessageReactionUpdated.byUserOrNull(): ChatMessageReactionUpdated.ByUser? = this as? dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated.ByUser -public inline fun TelegramMedia.telegramPaidMediaLivePhotoOrThrow(): TelegramPaidMediaLivePhoto = this as dev.inmo.tgbotapi.types.media.TelegramPaidMediaLivePhoto +public inline fun ChatMessageReactionUpdated.byUserOrThrow(): ChatMessageReactionUpdated.ByUser = this as dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated.ByUser -public inline fun TelegramMedia.ifTelegramPaidMediaLivePhoto(block: (TelegramPaidMediaLivePhoto) -> T): T? = telegramPaidMediaLivePhotoOrNull() ?.let(block) +public inline fun ChatMessageReactionUpdated.ifByUser(block: (ChatMessageReactionUpdated.ByUser) -> T): T? = byUserOrNull() ?.let(block) -public inline fun TelegramMedia.telegramPaidMediaPhotoOrNull(): TelegramPaidMediaPhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramPaidMediaPhoto +public inline fun ChatMessageReactionUpdated.byChatOrNull(): ChatMessageReactionUpdated.ByChat? = this as? dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated.ByChat -public inline fun TelegramMedia.telegramPaidMediaPhotoOrThrow(): TelegramPaidMediaPhoto = this as dev.inmo.tgbotapi.types.media.TelegramPaidMediaPhoto +public inline fun ChatMessageReactionUpdated.byChatOrThrow(): ChatMessageReactionUpdated.ByChat = this as dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated.ByChat -public inline fun TelegramMedia.ifTelegramPaidMediaPhoto(block: (TelegramPaidMediaPhoto) -> T): T? = telegramPaidMediaPhotoOrNull() ?.let(block) +public inline fun ChatMessageReactionUpdated.ifByChat(block: (ChatMessageReactionUpdated.ByChat) -> T): T? = byChatOrNull() ?.let(block) -public inline fun TelegramMedia.telegramMediaDocumentOrNull(): TelegramMediaDocument? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaDocument +public inline fun ChatMessageReactionUpdated.unknownOrNull(): ChatMessageReactionUpdated.Unknown? = this as? dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated.Unknown -public inline fun TelegramMedia.telegramMediaDocumentOrThrow(): TelegramMediaDocument = this as dev.inmo.tgbotapi.types.media.TelegramMediaDocument +public inline fun ChatMessageReactionUpdated.unknownOrThrow(): ChatMessageReactionUpdated.Unknown = this as dev.inmo.tgbotapi.types.chat.ChatMessageReactionUpdated.Unknown -public inline fun TelegramMedia.ifTelegramMediaDocument(block: (TelegramMediaDocument) -> T): T? = telegramMediaDocumentOrNull() ?.let(block) +public inline fun ChatMessageReactionUpdated.ifUnknown(block: (ChatMessageReactionUpdated.Unknown) -> T): T? = unknownOrNull() ?.let(block) -public inline fun TelegramMedia.telegramMediaPhotoOrNull(): TelegramMediaPhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaPhoto +public inline fun CommonSendInvoiceData.sendInvoiceOrNull(): SendInvoice? = this as? dev.inmo.tgbotapi.requests.send.payments.SendInvoice -public inline fun TelegramMedia.telegramMediaPhotoOrThrow(): TelegramMediaPhoto = this as dev.inmo.tgbotapi.types.media.TelegramMediaPhoto +public inline fun CommonSendInvoiceData.sendInvoiceOrThrow(): SendInvoice = this as dev.inmo.tgbotapi.requests.send.payments.SendInvoice -public inline fun TelegramMedia.ifTelegramMediaPhoto(block: (TelegramMediaPhoto) -> T): T? = telegramMediaPhotoOrNull() ?.let(block) +public inline fun CommonSendInvoiceData.ifSendInvoice(block: (SendInvoice) -> T): T? = sendInvoiceOrNull() ?.let(block) -public inline fun TelegramMedia.telegramMediaLivePhotoOrNull(): TelegramMediaLivePhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto +public inline fun CommonSendInvoiceData.createInvoiceLinkOrNull(): CreateInvoiceLink? = this as? dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink -public inline fun TelegramMedia.telegramMediaLivePhotoOrThrow(): TelegramMediaLivePhoto = this as dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto +public inline fun CommonSendInvoiceData.createInvoiceLinkOrThrow(): CreateInvoiceLink = this as dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink -public inline fun TelegramMedia.ifTelegramMediaLivePhoto(block: (TelegramMediaLivePhoto) -> T): T? = telegramMediaLivePhotoOrNull() ?.let(block) +public inline fun CommonSendInvoiceData.ifCreateInvoiceLink(block: (CreateInvoiceLink) -> T): T? = createInvoiceLinkOrNull() ?.let(block) -public inline fun TelegramMedia.mediaGroupMemberTelegramMediaOrNull(): MediaGroupMemberTelegramMedia? = this as? dev.inmo.tgbotapi.types.media.MediaGroupMemberTelegramMedia +public inline fun CommonSendInvoiceData.inputInvoiceMessageContentOrNull(): InputInvoiceMessageContent? = this as? dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent -public inline fun TelegramMedia.mediaGroupMemberTelegramMediaOrThrow(): MediaGroupMemberTelegramMedia = this as dev.inmo.tgbotapi.types.media.MediaGroupMemberTelegramMedia +public inline fun CommonSendInvoiceData.inputInvoiceMessageContentOrThrow(): InputInvoiceMessageContent = this as dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputInvoiceMessageContent -public inline fun TelegramMedia.ifMediaGroupMemberTelegramMedia(block: (MediaGroupMemberTelegramMedia) -> T): T? = mediaGroupMemberTelegramMediaOrNull() ?.let(block) +public inline fun CommonSendInvoiceData.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T): T? = inputInvoiceMessageContentOrNull() ?.let(block) -public inline fun TelegramMedia.audioMediaGroupMemberTelegramMediaOrNull(): AudioMediaGroupMemberTelegramMedia? = this as? dev.inmo.tgbotapi.types.media.AudioMediaGroupMemberTelegramMedia +public inline fun OptionallyWithUser.pollAnswerOrNull(): PollAnswer? = this as? dev.inmo.tgbotapi.types.polls.PollAnswer -public inline fun TelegramMedia.audioMediaGroupMemberTelegramMediaOrThrow(): AudioMediaGroupMemberTelegramMedia = this as dev.inmo.tgbotapi.types.media.AudioMediaGroupMemberTelegramMedia +public inline fun OptionallyWithUser.pollAnswerOrThrow(): PollAnswer = this as dev.inmo.tgbotapi.types.polls.PollAnswer -public inline fun TelegramMedia.ifAudioMediaGroupMemberTelegramMedia(block: (AudioMediaGroupMemberTelegramMedia) -> T): T? = audioMediaGroupMemberTelegramMediaOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifPollAnswer(block: (PollAnswer) -> T): T? = pollAnswerOrNull() ?.let(block) -public inline fun TelegramMedia.documentMediaGroupMemberTelegramMediaOrNull(): DocumentMediaGroupMemberTelegramMedia? = this as? dev.inmo.tgbotapi.types.media.DocumentMediaGroupMemberTelegramMedia +public inline fun OptionallyWithUser.pollAnswerPublicOrNull(): PollAnswer.Public? = this as? dev.inmo.tgbotapi.types.polls.PollAnswer.Public -public inline fun TelegramMedia.documentMediaGroupMemberTelegramMediaOrThrow(): DocumentMediaGroupMemberTelegramMedia = this as dev.inmo.tgbotapi.types.media.DocumentMediaGroupMemberTelegramMedia +public inline fun OptionallyWithUser.pollAnswerPublicOrThrow(): PollAnswer.Public = this as dev.inmo.tgbotapi.types.polls.PollAnswer.Public -public inline fun TelegramMedia.ifDocumentMediaGroupMemberTelegramMedia(block: (DocumentMediaGroupMemberTelegramMedia) -> T): T? = documentMediaGroupMemberTelegramMediaOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifPollAnswerPublic(block: (PollAnswer.Public) -> T): T? = pollAnswerPublicOrNull() ?.let(block) -public inline fun TelegramMedia.visualMediaGroupMemberTelegramMediaOrNull(): VisualMediaGroupMemberTelegramMedia? = this as? dev.inmo.tgbotapi.types.media.VisualMediaGroupMemberTelegramMedia +public inline fun OptionallyWithUser.pollAnswerAnonymousOrNull(): PollAnswer.Anonymous? = this as? dev.inmo.tgbotapi.types.polls.PollAnswer.Anonymous -public inline fun TelegramMedia.visualMediaGroupMemberTelegramMediaOrThrow(): VisualMediaGroupMemberTelegramMedia = this as dev.inmo.tgbotapi.types.media.VisualMediaGroupMemberTelegramMedia +public inline fun OptionallyWithUser.pollAnswerAnonymousOrThrow(): PollAnswer.Anonymous = this as dev.inmo.tgbotapi.types.polls.PollAnswer.Anonymous -public inline fun TelegramMedia.ifVisualMediaGroupMemberTelegramMedia(block: (VisualMediaGroupMemberTelegramMedia) -> T): T? = visualMediaGroupMemberTelegramMediaOrNull() ?.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.telegramPaidMediaVideoOrNull(): TelegramPaidMediaVideo? = this as? dev.inmo.tgbotapi.types.media.TelegramPaidMediaVideo - -public inline fun TelegramMedia.telegramPaidMediaVideoOrThrow(): TelegramPaidMediaVideo = this as dev.inmo.tgbotapi.types.media.TelegramPaidMediaVideo - -public inline fun TelegramMedia.ifTelegramPaidMediaVideo(block: (TelegramPaidMediaVideo) -> T): T? = telegramPaidMediaVideoOrNull() ?.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.coveredTelegramMediaOrNull(): CoveredTelegramMedia? = this as? dev.inmo.tgbotapi.types.media.CoveredTelegramMedia - -public inline fun TelegramMedia.coveredTelegramMediaOrThrow(): CoveredTelegramMedia = this as dev.inmo.tgbotapi.types.media.CoveredTelegramMedia - -public inline fun TelegramMedia.ifCoveredTelegramMedia(block: (CoveredTelegramMedia) -> T): T? = coveredTelegramMediaOrNull() ?.let(block) - -public inline fun TelegramMedia.telegramFreeMediaOrNull(): TelegramFreeMedia? = this as? dev.inmo.tgbotapi.types.media.TelegramFreeMedia - -public inline fun TelegramMedia.telegramFreeMediaOrThrow(): TelegramFreeMedia = this as dev.inmo.tgbotapi.types.media.TelegramFreeMedia - -public inline fun TelegramMedia.ifTelegramFreeMedia(block: (TelegramFreeMedia) -> T): T? = telegramFreeMediaOrNull() ?.let(block) - -public inline fun TelegramMedia.spoilerableTelegramMediaOrNull(): SpoilerableTelegramMedia? = this as? dev.inmo.tgbotapi.types.media.SpoilerableTelegramMedia - -public inline fun TelegramMedia.spoilerableTelegramMediaOrThrow(): SpoilerableTelegramMedia = this as dev.inmo.tgbotapi.types.media.SpoilerableTelegramMedia - -public inline fun TelegramMedia.ifSpoilerableTelegramMedia(block: (SpoilerableTelegramMedia) -> T): T? = spoilerableTelegramMediaOrNull() ?.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.withCustomStartTelegramMediaOrNull(): WithCustomStartTelegramMedia? = this as? dev.inmo.tgbotapi.types.media.WithCustomStartTelegramMedia - -public inline fun TelegramMedia.withCustomStartTelegramMediaOrThrow(): WithCustomStartTelegramMedia = this as dev.inmo.tgbotapi.types.media.WithCustomStartTelegramMedia - -public inline fun TelegramMedia.ifWithCustomStartTelegramMedia(block: (WithCustomStartTelegramMedia) -> T): T? = withCustomStartTelegramMediaOrNull() ?.let(block) - -public inline fun TelegramMedia.withCustomizableCaptionTelegramMediaOrNull(): WithCustomizableCaptionTelegramMedia? = this as? dev.inmo.tgbotapi.types.media.WithCustomizableCaptionTelegramMedia - -public inline fun TelegramMedia.withCustomizableCaptionTelegramMediaOrThrow(): WithCustomizableCaptionTelegramMedia = this as dev.inmo.tgbotapi.types.media.WithCustomizableCaptionTelegramMedia - -public inline fun TelegramMedia.ifWithCustomizableCaptionTelegramMedia(block: (WithCustomizableCaptionTelegramMedia) -> T): T? = withCustomizableCaptionTelegramMediaOrNull() ?.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.telegramMediaStickerOrNull(): TelegramMediaSticker? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaSticker - -public inline fun TelegramMedia.telegramMediaStickerOrThrow(): TelegramMediaSticker = this as dev.inmo.tgbotapi.types.media.TelegramMediaSticker - -public inline fun TelegramMedia.ifTelegramMediaSticker(block: (TelegramMediaSticker) -> T): T? = telegramMediaStickerOrNull() ?.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.telegramPaidMediaOrNull(): TelegramPaidMedia? = this as? dev.inmo.tgbotapi.types.media.TelegramPaidMedia - -public inline fun TelegramMedia.telegramPaidMediaOrThrow(): TelegramPaidMedia = this as dev.inmo.tgbotapi.types.media.TelegramPaidMedia - -public inline fun TelegramMedia.ifTelegramPaidMedia(block: (TelegramPaidMedia) -> T): T? = telegramPaidMediaOrNull() ?.let(block) - -public inline fun TelegramMedia.visualTelegramPaidMediaOrNull(): VisualTelegramPaidMedia? = this as? dev.inmo.tgbotapi.types.media.VisualTelegramPaidMedia - -public inline fun TelegramMedia.visualTelegramPaidMediaOrThrow(): VisualTelegramPaidMedia = this as dev.inmo.tgbotapi.types.media.VisualTelegramPaidMedia - -public inline fun TelegramMedia.ifVisualTelegramPaidMedia(block: (VisualTelegramPaidMedia) -> T): T? = visualTelegramPaidMediaOrNull() ?.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.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 BaseTelegramMediaFile.voiceFileOrNull(): VoiceFile? = this as? dev.inmo.tgbotapi.types.files.VoiceFile - -public inline fun BaseTelegramMediaFile.voiceFileOrThrow(): VoiceFile = this as dev.inmo.tgbotapi.types.files.VoiceFile - -public inline fun BaseTelegramMediaFile.ifVoiceFile(block: (VoiceFile) -> T): T? = voiceFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.audioFileOrNull(): AudioFile? = this as? dev.inmo.tgbotapi.types.files.AudioFile - -public inline fun BaseTelegramMediaFile.audioFileOrThrow(): AudioFile = this as dev.inmo.tgbotapi.types.files.AudioFile - -public inline fun BaseTelegramMediaFile.ifAudioFile(block: (AudioFile) -> T): T? = audioFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.videoQualityOrNull(): VideoQuality? = this as? dev.inmo.tgbotapi.types.files.VideoQuality - -public inline fun BaseTelegramMediaFile.videoQualityOrThrow(): VideoQuality = this as dev.inmo.tgbotapi.types.files.VideoQuality - -public inline fun BaseTelegramMediaFile.ifVideoQuality(block: (VideoQuality) -> T): T? = videoQualityOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.videoNoteFileOrNull(): VideoNoteFile? = this as? dev.inmo.tgbotapi.types.files.VideoNoteFile - -public inline fun BaseTelegramMediaFile.videoNoteFileOrThrow(): VideoNoteFile = this as dev.inmo.tgbotapi.types.files.VideoNoteFile - -public inline fun BaseTelegramMediaFile.ifVideoNoteFile(block: (VideoNoteFile) -> T): T? = videoNoteFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.mediaContentVariantOrNull(): MediaContentVariant? = this as? dev.inmo.tgbotapi.types.files.MediaContentVariant - -public inline fun BaseTelegramMediaFile.mediaContentVariantOrThrow(): MediaContentVariant = this as dev.inmo.tgbotapi.types.files.MediaContentVariant - -public inline fun BaseTelegramMediaFile.ifMediaContentVariant(block: (MediaContentVariant) -> T): T? = mediaContentVariantOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.fileOrNull(): File? = this as? dev.inmo.tgbotapi.types.files.File - -public inline fun BaseTelegramMediaFile.fileOrThrow(): File = this as dev.inmo.tgbotapi.types.files.File - -public inline fun BaseTelegramMediaFile.ifFile(block: (File) -> T): T? = fileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.usefulAsPaidMediaFileOrNull(): UsefulAsPaidMediaFile? = this as? dev.inmo.tgbotapi.types.files.UsefulAsPaidMediaFile - -public inline fun BaseTelegramMediaFile.usefulAsPaidMediaFileOrThrow(): UsefulAsPaidMediaFile = this as dev.inmo.tgbotapi.types.files.UsefulAsPaidMediaFile - -public inline fun BaseTelegramMediaFile.ifUsefulAsPaidMediaFile(block: (UsefulAsPaidMediaFile) -> T): T? = usefulAsPaidMediaFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.animationFileOrNull(): AnimationFile? = this as? dev.inmo.tgbotapi.types.files.AnimationFile - -public inline fun BaseTelegramMediaFile.animationFileOrThrow(): AnimationFile = this as dev.inmo.tgbotapi.types.files.AnimationFile - -public inline fun BaseTelegramMediaFile.ifAnimationFile(block: (AnimationFile) -> T): T? = animationFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.pathedFileOrNull(): PathedFile? = this as? dev.inmo.tgbotapi.types.files.PathedFile - -public inline fun BaseTelegramMediaFile.pathedFileOrThrow(): PathedFile = this as dev.inmo.tgbotapi.types.files.PathedFile - -public inline fun BaseTelegramMediaFile.ifPathedFile(block: (PathedFile) -> T): T? = pathedFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.playableMediaFileOrNull(): PlayableMediaFile? = this as? dev.inmo.tgbotapi.types.files.PlayableMediaFile - -public inline fun BaseTelegramMediaFile.playableMediaFileOrThrow(): PlayableMediaFile = this as dev.inmo.tgbotapi.types.files.PlayableMediaFile - -public inline fun BaseTelegramMediaFile.ifPlayableMediaFile(block: (PlayableMediaFile) -> T): T? = playableMediaFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.coveredMediaFileOrNull(): CoveredMediaFile? = this as? dev.inmo.tgbotapi.types.files.CoveredMediaFile - -public inline fun BaseTelegramMediaFile.coveredMediaFileOrThrow(): CoveredMediaFile = this as dev.inmo.tgbotapi.types.files.CoveredMediaFile - -public inline fun BaseTelegramMediaFile.ifCoveredMediaFile(block: (CoveredMediaFile) -> T): T? = coveredMediaFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.telegramMediaFileOrNull(): TelegramMediaFile? = this as? dev.inmo.tgbotapi.types.files.TelegramMediaFile - -public inline fun BaseTelegramMediaFile.telegramMediaFileOrThrow(): TelegramMediaFile = this as dev.inmo.tgbotapi.types.files.TelegramMediaFile - -public inline fun BaseTelegramMediaFile.ifTelegramMediaFile(block: (TelegramMediaFile) -> T): T? = telegramMediaFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.livePhotoFileOrNull(): LivePhotoFile? = this as? dev.inmo.tgbotapi.types.files.LivePhotoFile - -public inline fun BaseTelegramMediaFile.livePhotoFileOrThrow(): LivePhotoFile = this as dev.inmo.tgbotapi.types.files.LivePhotoFile - -public inline fun BaseTelegramMediaFile.ifLivePhotoFile(block: (LivePhotoFile) -> T): T? = livePhotoFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.sizedMediaFileOrNull(): SizedMediaFile? = this as? dev.inmo.tgbotapi.types.files.SizedMediaFile - -public inline fun BaseTelegramMediaFile.sizedMediaFileOrThrow(): SizedMediaFile = this as dev.inmo.tgbotapi.types.files.SizedMediaFile - -public inline fun BaseTelegramMediaFile.ifSizedMediaFile(block: (SizedMediaFile) -> T): T? = sizedMediaFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.documentFileOrNull(): DocumentFile? = this as? dev.inmo.tgbotapi.types.files.DocumentFile - -public inline fun BaseTelegramMediaFile.documentFileOrThrow(): DocumentFile = this as dev.inmo.tgbotapi.types.files.DocumentFile - -public inline fun BaseTelegramMediaFile.ifDocumentFile(block: (DocumentFile) -> T): T? = documentFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.photoFileOrNull(): PhotoFile? = this as? dev.inmo.tgbotapi.types.files.PhotoFile - -public inline fun BaseTelegramMediaFile.photoFileOrThrow(): PhotoFile = this as dev.inmo.tgbotapi.types.files.PhotoFile - -public inline fun BaseTelegramMediaFile.ifPhotoFile(block: (PhotoFile) -> T): T? = photoFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.photoSizeOrNull(): PhotoSize? = this as? dev.inmo.tgbotapi.types.files.PhotoSize - -public inline fun BaseTelegramMediaFile.photoSizeOrThrow(): PhotoSize = this as dev.inmo.tgbotapi.types.files.PhotoSize - -public inline fun BaseTelegramMediaFile.ifPhotoSize(block: (PhotoSize) -> T): T? = photoSizeOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.videoFileOrNull(): VideoFile? = this as? dev.inmo.tgbotapi.types.files.VideoFile - -public inline fun BaseTelegramMediaFile.videoFileOrThrow(): VideoFile = this as dev.inmo.tgbotapi.types.files.VideoFile - -public inline fun BaseTelegramMediaFile.ifVideoFile(block: (VideoFile) -> T): T? = videoFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.mimedMediaFileOrNull(): MimedMediaFile? = this as? dev.inmo.tgbotapi.types.files.MimedMediaFile - -public inline fun BaseTelegramMediaFile.mimedMediaFileOrThrow(): MimedMediaFile = this as dev.inmo.tgbotapi.types.files.MimedMediaFile - -public inline fun BaseTelegramMediaFile.ifMimedMediaFile(block: (MimedMediaFile) -> T): T? = mimedMediaFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.thumbedMediaFileOrNull(): ThumbedMediaFile? = this as? dev.inmo.tgbotapi.types.files.ThumbedMediaFile - -public inline fun BaseTelegramMediaFile.thumbedMediaFileOrThrow(): ThumbedMediaFile = this as dev.inmo.tgbotapi.types.files.ThumbedMediaFile - -public inline fun BaseTelegramMediaFile.ifThumbedMediaFile(block: (ThumbedMediaFile) -> T): T? = thumbedMediaFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.passportFileOrNull(): PassportFile? = this as? dev.inmo.tgbotapi.types.files.PassportFile - -public inline fun BaseTelegramMediaFile.passportFileOrThrow(): PassportFile = this as dev.inmo.tgbotapi.types.files.PassportFile - -public inline fun BaseTelegramMediaFile.ifPassportFile(block: (PassportFile) -> T): T? = passportFileOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.stickerOrNull(): Sticker? = this as? dev.inmo.tgbotapi.types.files.Sticker - -public inline fun BaseTelegramMediaFile.stickerOrThrow(): Sticker = this as dev.inmo.tgbotapi.types.files.Sticker - -public inline fun BaseTelegramMediaFile.ifSticker(block: (Sticker) -> T): T? = stickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.videoStickerOrNull(): VideoSticker? = this as? dev.inmo.tgbotapi.types.files.VideoSticker - -public inline fun BaseTelegramMediaFile.videoStickerOrThrow(): VideoSticker = this as dev.inmo.tgbotapi.types.files.VideoSticker - -public inline fun BaseTelegramMediaFile.ifVideoSticker(block: (VideoSticker) -> T): T? = videoStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.animatedStickerOrNull(): AnimatedSticker? = this as? dev.inmo.tgbotapi.types.files.AnimatedSticker - -public inline fun BaseTelegramMediaFile.animatedStickerOrThrow(): AnimatedSticker = this as dev.inmo.tgbotapi.types.files.AnimatedSticker - -public inline fun BaseTelegramMediaFile.ifAnimatedSticker(block: (AnimatedSticker) -> T): T? = animatedStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.regularStickerOrNull(): RegularSticker? = this as? dev.inmo.tgbotapi.types.files.RegularSticker - -public inline fun BaseTelegramMediaFile.regularStickerOrThrow(): RegularSticker = this as dev.inmo.tgbotapi.types.files.RegularSticker - -public inline fun BaseTelegramMediaFile.ifRegularSticker(block: (RegularSticker) -> T): T? = regularStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.regularSimpleStickerOrNull(): RegularSimpleSticker? = this as? dev.inmo.tgbotapi.types.files.RegularSimpleSticker - -public inline fun BaseTelegramMediaFile.regularSimpleStickerOrThrow(): RegularSimpleSticker = this as dev.inmo.tgbotapi.types.files.RegularSimpleSticker - -public inline fun BaseTelegramMediaFile.ifRegularSimpleSticker(block: (RegularSimpleSticker) -> T): T? = regularSimpleStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.regularAnimatedStickerOrNull(): RegularAnimatedSticker? = this as? dev.inmo.tgbotapi.types.files.RegularAnimatedSticker - -public inline fun BaseTelegramMediaFile.regularAnimatedStickerOrThrow(): RegularAnimatedSticker = this as dev.inmo.tgbotapi.types.files.RegularAnimatedSticker - -public inline fun BaseTelegramMediaFile.ifRegularAnimatedSticker(block: (RegularAnimatedSticker) -> T): T? = regularAnimatedStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.regularVideoStickerOrNull(): RegularVideoSticker? = this as? dev.inmo.tgbotapi.types.files.RegularVideoSticker - -public inline fun BaseTelegramMediaFile.regularVideoStickerOrThrow(): RegularVideoSticker = this as dev.inmo.tgbotapi.types.files.RegularVideoSticker - -public inline fun BaseTelegramMediaFile.ifRegularVideoSticker(block: (RegularVideoSticker) -> T): T? = regularVideoStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.maskStickerOrNull(): MaskSticker? = this as? dev.inmo.tgbotapi.types.files.MaskSticker - -public inline fun BaseTelegramMediaFile.maskStickerOrThrow(): MaskSticker = this as dev.inmo.tgbotapi.types.files.MaskSticker - -public inline fun BaseTelegramMediaFile.ifMaskSticker(block: (MaskSticker) -> T): T? = maskStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.maskSimpleStickerOrNull(): MaskSimpleSticker? = this as? dev.inmo.tgbotapi.types.files.MaskSimpleSticker - -public inline fun BaseTelegramMediaFile.maskSimpleStickerOrThrow(): MaskSimpleSticker = this as dev.inmo.tgbotapi.types.files.MaskSimpleSticker - -public inline fun BaseTelegramMediaFile.ifMaskSimpleSticker(block: (MaskSimpleSticker) -> T): T? = maskSimpleStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.maskAnimatedStickerOrNull(): MaskAnimatedSticker? = this as? dev.inmo.tgbotapi.types.files.MaskAnimatedSticker - -public inline fun BaseTelegramMediaFile.maskAnimatedStickerOrThrow(): MaskAnimatedSticker = this as dev.inmo.tgbotapi.types.files.MaskAnimatedSticker - -public inline fun BaseTelegramMediaFile.ifMaskAnimatedSticker(block: (MaskAnimatedSticker) -> T): T? = maskAnimatedStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.maskVideoStickerOrNull(): MaskVideoSticker? = this as? dev.inmo.tgbotapi.types.files.MaskVideoSticker - -public inline fun BaseTelegramMediaFile.maskVideoStickerOrThrow(): MaskVideoSticker = this as dev.inmo.tgbotapi.types.files.MaskVideoSticker - -public inline fun BaseTelegramMediaFile.ifMaskVideoSticker(block: (MaskVideoSticker) -> T): T? = maskVideoStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.customEmojiStickerOrNull(): CustomEmojiSticker? = this as? dev.inmo.tgbotapi.types.files.CustomEmojiSticker - -public inline fun BaseTelegramMediaFile.customEmojiStickerOrThrow(): CustomEmojiSticker = this as dev.inmo.tgbotapi.types.files.CustomEmojiSticker - -public inline fun BaseTelegramMediaFile.ifCustomEmojiSticker(block: (CustomEmojiSticker) -> T): T? = customEmojiStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.customEmojiSimpleStickerOrNull(): CustomEmojiSimpleSticker? = this as? dev.inmo.tgbotapi.types.files.CustomEmojiSimpleSticker - -public inline fun BaseTelegramMediaFile.customEmojiSimpleStickerOrThrow(): CustomEmojiSimpleSticker = this as dev.inmo.tgbotapi.types.files.CustomEmojiSimpleSticker - -public inline fun BaseTelegramMediaFile.ifCustomEmojiSimpleSticker(block: (CustomEmojiSimpleSticker) -> T): T? = customEmojiSimpleStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.customEmojiAnimatedStickerOrNull(): CustomEmojiAnimatedSticker? = this as? dev.inmo.tgbotapi.types.files.CustomEmojiAnimatedSticker - -public inline fun BaseTelegramMediaFile.customEmojiAnimatedStickerOrThrow(): CustomEmojiAnimatedSticker = this as dev.inmo.tgbotapi.types.files.CustomEmojiAnimatedSticker - -public inline fun BaseTelegramMediaFile.ifCustomEmojiAnimatedSticker(block: (CustomEmojiAnimatedSticker) -> T): T? = customEmojiAnimatedStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.customEmojiVideoStickerOrNull(): CustomEmojiVideoSticker? = this as? dev.inmo.tgbotapi.types.files.CustomEmojiVideoSticker - -public inline fun BaseTelegramMediaFile.customEmojiVideoStickerOrThrow(): CustomEmojiVideoSticker = this as dev.inmo.tgbotapi.types.files.CustomEmojiVideoSticker - -public inline fun BaseTelegramMediaFile.ifCustomEmojiVideoSticker(block: (CustomEmojiVideoSticker) -> T): T? = customEmojiVideoStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.unknownStickerOrNull(): UnknownSticker? = this as? dev.inmo.tgbotapi.types.files.UnknownSticker - -public inline fun BaseTelegramMediaFile.unknownStickerOrThrow(): UnknownSticker = this as dev.inmo.tgbotapi.types.files.UnknownSticker - -public inline fun BaseTelegramMediaFile.ifUnknownSticker(block: (UnknownSticker) -> T): T? = unknownStickerOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.staticLocationOrNull(): StaticLocation? = this as? dev.inmo.tgbotapi.types.location.StaticLocation - -public inline fun BaseTelegramMediaFile.staticLocationOrThrow(): StaticLocation = this as dev.inmo.tgbotapi.types.location.StaticLocation - -public inline fun BaseTelegramMediaFile.ifStaticLocation(block: (StaticLocation) -> T): T? = staticLocationOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.pollMediaOrNull(): PollMedia? = this as? dev.inmo.tgbotapi.types.media.PollMedia - -public inline fun BaseTelegramMediaFile.pollMediaOrThrow(): PollMedia = this as dev.inmo.tgbotapi.types.media.PollMedia - -public inline fun BaseTelegramMediaFile.ifPollMedia(block: (PollMedia) -> T): T? = pollMediaOrNull() ?.let(block) - -public inline fun BaseTelegramMediaFile.venueOrNull(): Venue? = this as? dev.inmo.tgbotapi.types.venue.Venue - -public inline fun BaseTelegramMediaFile.venueOrThrow(): Venue = this as dev.inmo.tgbotapi.types.venue.Venue - -public inline fun BaseTelegramMediaFile.ifVenue(block: (Venue) -> T): T? = venueOrNull() ?.let(block) - -public inline fun InputPollOptionMedia.telegramMediaPhotoOrNull(): TelegramMediaPhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaPhoto - -public inline fun InputPollOptionMedia.telegramMediaPhotoOrThrow(): TelegramMediaPhoto = this as dev.inmo.tgbotapi.types.media.TelegramMediaPhoto - -public inline fun InputPollOptionMedia.ifTelegramMediaPhoto(block: (TelegramMediaPhoto) -> T): T? = telegramMediaPhotoOrNull() ?.let(block) - -public inline fun InputPollOptionMedia.telegramMediaLivePhotoOrNull(): TelegramMediaLivePhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto - -public inline fun InputPollOptionMedia.telegramMediaLivePhotoOrThrow(): TelegramMediaLivePhoto = this as dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto - -public inline fun InputPollOptionMedia.ifTelegramMediaLivePhoto(block: (TelegramMediaLivePhoto) -> T): T? = telegramMediaLivePhotoOrNull() ?.let(block) - -public inline fun InputPollOptionMedia.telegramMediaLocationOrNull(): TelegramMediaLocation? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaLocation - -public inline fun InputPollOptionMedia.telegramMediaLocationOrThrow(): TelegramMediaLocation = this as dev.inmo.tgbotapi.types.media.TelegramMediaLocation - -public inline fun InputPollOptionMedia.ifTelegramMediaLocation(block: (TelegramMediaLocation) -> T): T? = telegramMediaLocationOrNull() ?.let(block) - -public inline fun InputPollOptionMedia.telegramMediaAnimationOrNull(): TelegramMediaAnimation? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaAnimation - -public inline fun InputPollOptionMedia.telegramMediaAnimationOrThrow(): TelegramMediaAnimation = this as dev.inmo.tgbotapi.types.media.TelegramMediaAnimation - -public inline fun InputPollOptionMedia.ifTelegramMediaAnimation(block: (TelegramMediaAnimation) -> T): T? = telegramMediaAnimationOrNull() ?.let(block) - -public inline fun InputPollOptionMedia.telegramMediaStickerOrNull(): TelegramMediaSticker? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaSticker - -public inline fun InputPollOptionMedia.telegramMediaStickerOrThrow(): TelegramMediaSticker = this as dev.inmo.tgbotapi.types.media.TelegramMediaSticker - -public inline fun InputPollOptionMedia.ifTelegramMediaSticker(block: (TelegramMediaSticker) -> T): T? = telegramMediaStickerOrNull() ?.let(block) - -public inline fun InputPollOptionMedia.telegramMediaVideoOrNull(): TelegramMediaVideo? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaVideo - -public inline fun InputPollOptionMedia.telegramMediaVideoOrThrow(): TelegramMediaVideo = this as dev.inmo.tgbotapi.types.media.TelegramMediaVideo - -public inline fun InputPollOptionMedia.ifTelegramMediaVideo(block: (TelegramMediaVideo) -> T): T? = telegramMediaVideoOrNull() ?.let(block) - -public inline fun InputPollOptionMedia.telegramMediaVenueOrNull(): TelegramMediaVenue? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaVenue - -public inline fun InputPollOptionMedia.telegramMediaVenueOrThrow(): TelegramMediaVenue = this as dev.inmo.tgbotapi.types.media.TelegramMediaVenue - -public inline fun InputPollOptionMedia.ifTelegramMediaVenue(block: (TelegramMediaVenue) -> T): T? = telegramMediaVenueOrNull() ?.let(block) - -public inline fun InputPollMedia.telegramMediaDocumentOrNull(): TelegramMediaDocument? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaDocument - -public inline fun InputPollMedia.telegramMediaDocumentOrThrow(): TelegramMediaDocument = this as dev.inmo.tgbotapi.types.media.TelegramMediaDocument - -public inline fun InputPollMedia.ifTelegramMediaDocument(block: (TelegramMediaDocument) -> T): T? = telegramMediaDocumentOrNull() ?.let(block) - -public inline fun InputPollMedia.telegramMediaPhotoOrNull(): TelegramMediaPhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaPhoto - -public inline fun InputPollMedia.telegramMediaPhotoOrThrow(): TelegramMediaPhoto = this as dev.inmo.tgbotapi.types.media.TelegramMediaPhoto - -public inline fun InputPollMedia.ifTelegramMediaPhoto(block: (TelegramMediaPhoto) -> T): T? = telegramMediaPhotoOrNull() ?.let(block) - -public inline fun InputPollMedia.telegramMediaLivePhotoOrNull(): TelegramMediaLivePhoto? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto - -public inline fun InputPollMedia.telegramMediaLivePhotoOrThrow(): TelegramMediaLivePhoto = this as dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto - -public inline fun InputPollMedia.ifTelegramMediaLivePhoto(block: (TelegramMediaLivePhoto) -> T): T? = telegramMediaLivePhotoOrNull() ?.let(block) - -public inline fun InputPollMedia.telegramMediaLocationOrNull(): TelegramMediaLocation? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaLocation - -public inline fun InputPollMedia.telegramMediaLocationOrThrow(): TelegramMediaLocation = this as dev.inmo.tgbotapi.types.media.TelegramMediaLocation - -public inline fun InputPollMedia.ifTelegramMediaLocation(block: (TelegramMediaLocation) -> T): T? = telegramMediaLocationOrNull() ?.let(block) - -public inline fun InputPollMedia.telegramMediaAudioOrNull(): TelegramMediaAudio? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaAudio - -public inline fun InputPollMedia.telegramMediaAudioOrThrow(): TelegramMediaAudio = this as dev.inmo.tgbotapi.types.media.TelegramMediaAudio - -public inline fun InputPollMedia.ifTelegramMediaAudio(block: (TelegramMediaAudio) -> T): T? = telegramMediaAudioOrNull() ?.let(block) - -public inline fun InputPollMedia.telegramMediaAnimationOrNull(): TelegramMediaAnimation? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaAnimation - -public inline fun InputPollMedia.telegramMediaAnimationOrThrow(): TelegramMediaAnimation = this as dev.inmo.tgbotapi.types.media.TelegramMediaAnimation - -public inline fun InputPollMedia.ifTelegramMediaAnimation(block: (TelegramMediaAnimation) -> T): T? = telegramMediaAnimationOrNull() ?.let(block) - -public inline fun InputPollMedia.telegramMediaVideoOrNull(): TelegramMediaVideo? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaVideo - -public inline fun InputPollMedia.telegramMediaVideoOrThrow(): TelegramMediaVideo = this as dev.inmo.tgbotapi.types.media.TelegramMediaVideo - -public inline fun InputPollMedia.ifTelegramMediaVideo(block: (TelegramMediaVideo) -> T): T? = telegramMediaVideoOrNull() ?.let(block) - -public inline fun InputPollMedia.telegramMediaVenueOrNull(): TelegramMediaVenue? = this as? dev.inmo.tgbotapi.types.media.TelegramMediaVenue - -public inline fun InputPollMedia.telegramMediaVenueOrThrow(): TelegramMediaVenue = this as dev.inmo.tgbotapi.types.media.TelegramMediaVenue - -public inline fun InputPollMedia.ifTelegramMediaVenue(block: (TelegramMediaVenue) -> T): T? = telegramMediaVenueOrNull() ?.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 BusinessConnection.enabledOrNull(): BusinessConnection.Enabled? = this as? dev.inmo.tgbotapi.types.business_connection.BusinessConnection.Enabled - -public inline fun BusinessConnection.enabledOrThrow(): BusinessConnection.Enabled = this as dev.inmo.tgbotapi.types.business_connection.BusinessConnection.Enabled - -public inline fun BusinessConnection.ifEnabled(block: (BusinessConnection.Enabled) -> T): T? = enabledOrNull() ?.let(block) - -public inline fun BusinessConnection.disabledOrNull(): BusinessConnection.Disabled? = this as? dev.inmo.tgbotapi.types.business_connection.BusinessConnection.Disabled - -public inline fun BusinessConnection.disabledOrThrow(): BusinessConnection.Disabled = this as dev.inmo.tgbotapi.types.business_connection.BusinessConnection.Disabled - -public inline fun BusinessConnection.ifDisabled(block: (BusinessConnection.Disabled) -> T): T? = disabledOrNull() ?.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 Update.guestMessageUpdateOrNull(): GuestMessageUpdate? = this as? dev.inmo.tgbotapi.types.update.GuestMessageUpdate - -public inline fun Update.guestMessageUpdateOrThrow(): GuestMessageUpdate = this as dev.inmo.tgbotapi.types.update.GuestMessageUpdate - -public inline fun Update.ifGuestMessageUpdate(block: (GuestMessageUpdate) -> T): T? = guestMessageUpdateOrNull() ?.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.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.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.chatMessageReactionsCountUpdatedUpdateOrNull(): ChatMessageReactionsCountUpdatedUpdate? = this as? dev.inmo.tgbotapi.types.update.ChatMessageReactionsCountUpdatedUpdate - -public inline fun Update.chatMessageReactionsCountUpdatedUpdateOrThrow(): ChatMessageReactionsCountUpdatedUpdate = this as dev.inmo.tgbotapi.types.update.ChatMessageReactionsCountUpdatedUpdate - -public inline fun Update.ifChatMessageReactionsCountUpdatedUpdate(block: (ChatMessageReactionsCountUpdatedUpdate) -> T): T? = chatMessageReactionsCountUpdatedUpdateOrNull() ?.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.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.deletedBusinessMessageUpdateOrNull(): DeletedBusinessMessageUpdate? = this as? dev.inmo.tgbotapi.types.update.DeletedBusinessMessageUpdate - -public inline fun Update.deletedBusinessMessageUpdateOrThrow(): DeletedBusinessMessageUpdate = this as dev.inmo.tgbotapi.types.update.DeletedBusinessMessageUpdate - -public inline fun Update.ifDeletedBusinessMessageUpdate(block: (DeletedBusinessMessageUpdate) -> T): T? = deletedBusinessMessageUpdateOrNull() ?.let(block) - -public inline fun Update.businessMessageUpdateOrNull(): BusinessMessageUpdate? = this as? dev.inmo.tgbotapi.types.update.BusinessMessageUpdate - -public inline fun Update.businessMessageUpdateOrThrow(): BusinessMessageUpdate = this as dev.inmo.tgbotapi.types.update.BusinessMessageUpdate - -public inline fun Update.ifBusinessMessageUpdate(block: (BusinessMessageUpdate) -> T): T? = businessMessageUpdateOrNull() ?.let(block) - -public inline fun Update.managedBotUpdateOrNull(): ManagedBotUpdate? = this as? dev.inmo.tgbotapi.types.update.ManagedBotUpdate - -public inline fun Update.managedBotUpdateOrThrow(): ManagedBotUpdate = this as dev.inmo.tgbotapi.types.update.ManagedBotUpdate - -public inline fun Update.ifManagedBotUpdate(block: (ManagedBotUpdate) -> T): T? = managedBotUpdateOrNull() ?.let(block) - -public inline fun Update.chatMessageReactionUpdatedUpdateOrNull(): ChatMessageReactionUpdatedUpdate? = this as? dev.inmo.tgbotapi.types.update.ChatMessageReactionUpdatedUpdate - -public inline fun Update.chatMessageReactionUpdatedUpdateOrThrow(): ChatMessageReactionUpdatedUpdate = this as dev.inmo.tgbotapi.types.update.ChatMessageReactionUpdatedUpdate - -public inline fun Update.ifChatMessageReactionUpdatedUpdate(block: (ChatMessageReactionUpdatedUpdate) -> T): T? = chatMessageReactionUpdatedUpdateOrNull() ?.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.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.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.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.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.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.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.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.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.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.chatBoostUpdatedUpdateOrNull(): ChatBoostUpdatedUpdate? = this as? dev.inmo.tgbotapi.types.update.ChatBoostUpdatedUpdate - -public inline fun Update.chatBoostUpdatedUpdateOrThrow(): ChatBoostUpdatedUpdate = this as dev.inmo.tgbotapi.types.update.ChatBoostUpdatedUpdate - -public inline fun Update.ifChatBoostUpdatedUpdate(block: (ChatBoostUpdatedUpdate) -> T): T? = chatBoostUpdatedUpdateOrNull() ?.let(block) - -public inline fun Update.chatBoostRemovedUpdateOrNull(): ChatBoostRemovedUpdate? = this as? dev.inmo.tgbotapi.types.update.ChatBoostRemovedUpdate - -public inline fun Update.chatBoostRemovedUpdateOrThrow(): ChatBoostRemovedUpdate = this as dev.inmo.tgbotapi.types.update.ChatBoostRemovedUpdate - -public inline fun Update.ifChatBoostRemovedUpdate(block: (ChatBoostRemovedUpdate) -> T): T? = chatBoostRemovedUpdateOrNull() ?.let(block) - -public inline fun Update.editBusinessMessageUpdateOrNull(): EditBusinessMessageUpdate? = this as? dev.inmo.tgbotapi.types.update.EditBusinessMessageUpdate - -public inline fun Update.editBusinessMessageUpdateOrThrow(): EditBusinessMessageUpdate = this as dev.inmo.tgbotapi.types.update.EditBusinessMessageUpdate - -public inline fun Update.ifEditBusinessMessageUpdate(block: (EditBusinessMessageUpdate) -> T): T? = editBusinessMessageUpdateOrNull() ?.let(block) - -public inline fun Update.businessConnectionUpdateOrNull(): BusinessConnectionUpdate? = this as? dev.inmo.tgbotapi.types.update.BusinessConnectionUpdate - -public inline fun Update.businessConnectionUpdateOrThrow(): BusinessConnectionUpdate = this as dev.inmo.tgbotapi.types.update.BusinessConnectionUpdate - -public inline fun Update.ifBusinessConnectionUpdate(block: (BusinessConnectionUpdate) -> T): T? = businessConnectionUpdateOrNull() ?.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.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.paidMediaPurchasedUpdateOrNull(): PaidMediaPurchasedUpdate? = this as? dev.inmo.tgbotapi.types.update.PaidMediaPurchasedUpdate - -public inline fun Update.paidMediaPurchasedUpdateOrThrow(): PaidMediaPurchasedUpdate = this as dev.inmo.tgbotapi.types.update.PaidMediaPurchasedUpdate - -public inline fun Update.ifPaidMediaPurchasedUpdate(block: (PaidMediaPurchasedUpdate) -> T): T? = paidMediaPurchasedUpdateOrNull() ?.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.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 ReplyInfo.internalOrNull(): ReplyInfo.Internal? = this as? dev.inmo.tgbotapi.types.ReplyInfo.Internal - -public inline fun ReplyInfo.internalOrThrow(): ReplyInfo.Internal = this as dev.inmo.tgbotapi.types.ReplyInfo.Internal - -public inline fun ReplyInfo.ifInternal(block: (ReplyInfo.Internal) -> T): T? = internalOrNull() ?.let(block) - -public inline fun ReplyInfo.toStoryOrNull(): ReplyInfo.ToStory? = this as? dev.inmo.tgbotapi.types.ReplyInfo.ToStory - -public inline fun ReplyInfo.toStoryOrThrow(): ReplyInfo.ToStory = this as dev.inmo.tgbotapi.types.ReplyInfo.ToStory - -public inline fun ReplyInfo.ifToStory(block: (ReplyInfo.ToStory) -> T): T? = toStoryOrNull() ?.let(block) - -public inline fun ReplyInfo.externalOrNull(): ReplyInfo.External? = this as? dev.inmo.tgbotapi.types.ReplyInfo.External - -public inline fun ReplyInfo.externalOrThrow(): ReplyInfo.External = this as dev.inmo.tgbotapi.types.ReplyInfo.External - -public inline fun ReplyInfo.ifExternal(block: (ReplyInfo.External) -> T): T? = externalOrNull() ?.let(block) - -public inline fun ReplyInfo.externalTextOrNull(): ReplyInfo.External.Text? = this as? dev.inmo.tgbotapi.types.ReplyInfo.External.Text - -public inline fun ReplyInfo.externalTextOrThrow(): ReplyInfo.External.Text = this as dev.inmo.tgbotapi.types.ReplyInfo.External.Text - -public inline fun ReplyInfo.ifExternalText(block: (ReplyInfo.External.Text) -> T): T? = externalTextOrNull() ?.let(block) - -public inline fun ReplyInfo.externalContentOrNull(): ReplyInfo.External.Content? = this as? dev.inmo.tgbotapi.types.ReplyInfo.External.Content - -public inline fun ReplyInfo.externalContentOrThrow(): ReplyInfo.External.Content = this as dev.inmo.tgbotapi.types.ReplyInfo.External.Content - -public inline fun ReplyInfo.ifExternalContent(block: (ReplyInfo.External.Content) -> T): T? = externalContentOrNull() ?.let(block) - -public inline fun ReplyInfo.externalContentSimpleOrNull(): ReplyInfo.External.Content.Simple? = this as? dev.inmo.tgbotapi.types.ReplyInfo.External.Content.Simple - -public inline fun ReplyInfo.externalContentSimpleOrThrow(): ReplyInfo.External.Content.Simple = this as dev.inmo.tgbotapi.types.ReplyInfo.External.Content.Simple - -public inline fun ReplyInfo.ifExternalContentSimple(block: (ReplyInfo.External.Content.Simple) -> T): T? = externalContentSimpleOrNull() ?.let(block) - -public inline fun ReplyInfo.externalContentMediaOrNull(): ReplyInfo.External.Content.Media? = this as? dev.inmo.tgbotapi.types.ReplyInfo.External.Content.Media - -public inline fun ReplyInfo.externalContentMediaOrThrow(): ReplyInfo.External.Content.Media = this as dev.inmo.tgbotapi.types.ReplyInfo.External.Content.Media - -public inline fun ReplyInfo.ifExternalContentMedia(block: (ReplyInfo.External.Content.Media) -> T): T? = externalContentMediaOrNull() ?.let(block) - -public inline fun OptionallyWithUser.locationChosenInlineResultOrNull(): LocationChosenInlineResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult - -public inline fun OptionallyWithUser.locationChosenInlineResultOrThrow(): LocationChosenInlineResult = this as dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult - -public inline fun OptionallyWithUser.ifLocationChosenInlineResult(block: (LocationChosenInlineResult) -> T): T? = locationChosenInlineResultOrNull() ?.let(block) - -public inline fun OptionallyWithUser.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult - -public inline fun OptionallyWithUser.baseChosenInlineResultOrThrow(): BaseChosenInlineResult = this as dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult - -public inline fun OptionallyWithUser.ifBaseChosenInlineResult(block: (BaseChosenInlineResult) -> T): T? = baseChosenInlineResultOrNull() ?.let(block) - -public inline fun OptionallyWithUser.chosenInlineResultOrNull(): ChosenInlineResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult - -public inline fun OptionallyWithUser.chosenInlineResultOrThrow(): ChosenInlineResult = this as dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult - -public inline fun OptionallyWithUser.ifChosenInlineResult(block: (ChosenInlineResult) -> T): T? = chosenInlineResultOrNull() ?.let(block) - -public inline fun OptionallyWithUser.baseInlineQueryOrNull(): BaseInlineQuery? = this as? dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery - -public inline fun OptionallyWithUser.baseInlineQueryOrThrow(): BaseInlineQuery = this as dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery - -public inline fun OptionallyWithUser.ifBaseInlineQuery(block: (BaseInlineQuery) -> T): T? = baseInlineQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.inlineQueryOrNull(): InlineQuery? = this as? dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery - -public inline fun OptionallyWithUser.inlineQueryOrThrow(): InlineQuery = this as dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery - -public inline fun OptionallyWithUser.ifInlineQuery(block: (InlineQuery) -> T): T? = inlineQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.locationInlineQueryOrNull(): LocationInlineQuery? = this as? dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery - -public inline fun OptionallyWithUser.locationInlineQueryOrThrow(): LocationInlineQuery = this as dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery - -public inline fun OptionallyWithUser.ifLocationInlineQuery(block: (LocationInlineQuery) -> T): T? = locationInlineQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.paidMediaPurchasedOrNull(): PaidMediaPurchased? = this as? dev.inmo.tgbotapi.types.message.payments.PaidMediaPurchased - -public inline fun OptionallyWithUser.paidMediaPurchasedOrThrow(): PaidMediaPurchased = this as dev.inmo.tgbotapi.types.message.payments.PaidMediaPurchased - -public inline fun OptionallyWithUser.ifPaidMediaPurchased(block: (PaidMediaPurchased) -> T): T? = paidMediaPurchasedOrNull() ?.let(block) - -public inline fun OptionallyWithUser.commonSupergroupEventMessageOrNull(): CommonSupergroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage - -public inline fun OptionallyWithUser.commonSupergroupEventMessageOrThrow(): CommonSupergroupEventMessage = this as dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage - -public inline fun OptionallyWithUser.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T): T? = commonSupergroupEventMessageOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifPollAnswerAnonymous(block: (PollAnswer.Anonymous) -> T): T? = pollAnswerAnonymousOrNull() ?.let(block) public inline fun OptionallyWithUser.forwardInfoByUserOrNull(): ForwardInfo.ByUser? = this as? dev.inmo.tgbotapi.types.message.ForwardInfo.ByUser @@ -4066,17 +4146,59 @@ public inline fun OptionallyWithUser.forwardInfoByUserOrThrow(): ForwardInfo.ByU public inline fun OptionallyWithUser.ifForwardInfoByUser(block: (ForwardInfo.ByUser) -> T): T? = forwardInfoByUserOrNull() ?.let(block) +public inline fun OptionallyWithUser.paidMediaPurchasedOrNull(): PaidMediaPurchased? = this as? dev.inmo.tgbotapi.types.message.payments.PaidMediaPurchased + +public inline fun OptionallyWithUser.paidMediaPurchasedOrThrow(): PaidMediaPurchased = this as dev.inmo.tgbotapi.types.message.payments.PaidMediaPurchased + +public inline fun OptionallyWithUser.ifPaidMediaPurchased(block: (PaidMediaPurchased) -> T): T? = paidMediaPurchasedOrNull() ?.let(block) + public inline fun OptionallyWithUser.leftChatMemberEventOrNull(): LeftChatMemberEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent public inline fun OptionallyWithUser.leftChatMemberEventOrThrow(): LeftChatMemberEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent public inline fun OptionallyWithUser.ifLeftChatMemberEvent(block: (LeftChatMemberEvent) -> T): T? = leftChatMemberEventOrNull() ?.let(block) -public inline fun OptionallyWithUser.businessContentMessageOrNull(): BusinessContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage +public inline fun OptionallyWithUser.commonChannelDirectMessagesEventMessageOrNull(): CommonChannelDirectMessagesEventMessage? = this as? dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage -public inline fun OptionallyWithUser.businessContentMessageOrThrow(): BusinessContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage +public inline fun OptionallyWithUser.commonChannelDirectMessagesEventMessageOrThrow(): CommonChannelDirectMessagesEventMessage = this as dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage -public inline fun OptionallyWithUser.ifBusinessContentMessage(block: (BusinessContentMessage) -> T): T? = businessContentMessageOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifCommonChannelDirectMessagesEventMessage(block: (CommonChannelDirectMessagesEventMessage) -> T): T? = commonChannelDirectMessagesEventMessageOrNull() ?.let(block) + +public inline fun OptionallyWithUser.passportMessageOrNull(): PassportMessage? = this as? dev.inmo.tgbotapi.types.message.PassportMessage + +public inline fun OptionallyWithUser.passportMessageOrThrow(): PassportMessage = this as dev.inmo.tgbotapi.types.message.PassportMessage + +public inline fun OptionallyWithUser.ifPassportMessage(block: (PassportMessage) -> T): T? = passportMessageOrNull() ?.let(block) + +public inline fun OptionallyWithUser.channelContentMessageOrNull(): ChannelContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage + +public inline fun OptionallyWithUser.channelContentMessageOrThrow(): ChannelContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage + +public inline fun OptionallyWithUser.ifChannelContentMessage(block: (ChannelContentMessage) -> T): T? = channelContentMessageOrNull() ?.let(block) + +public inline fun OptionallyWithUser.channelDirectMessagesEventMessageOrNull(): ChannelDirectMessagesEventMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage + +public inline fun OptionallyWithUser.channelDirectMessagesEventMessageOrThrow(): ChannelDirectMessagesEventMessage = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage + +public inline fun OptionallyWithUser.ifChannelDirectMessagesEventMessage(block: (ChannelDirectMessagesEventMessage) -> T): T? = channelDirectMessagesEventMessageOrNull() ?.let(block) + +public inline fun OptionallyWithUser.privateContentMessageOrNull(): PrivateContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage + +public inline fun OptionallyWithUser.privateContentMessageOrThrow(): PrivateContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage + +public inline fun OptionallyWithUser.ifPrivateContentMessage(block: (PrivateContentMessage) -> T): T? = privateContentMessageOrNull() ?.let(block) + +public inline fun OptionallyWithUser.privateForumContentMessageOrNull(): PrivateForumContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PrivateForumContentMessage + +public inline fun OptionallyWithUser.privateForumContentMessageOrThrow(): PrivateForumContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PrivateForumContentMessage + +public inline fun OptionallyWithUser.ifPrivateForumContentMessage(block: (PrivateForumContentMessage) -> T): T? = privateForumContentMessageOrNull() ?.let(block) + +public inline fun OptionallyWithUser.channelPaidPostOrNull(): ChannelPaidPost? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelPaidPost + +public inline fun OptionallyWithUser.channelPaidPostOrThrow(): ChannelPaidPost = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelPaidPost + +public inline fun OptionallyWithUser.ifChannelPaidPost(block: (ChannelPaidPost) -> T): T? = channelPaidPostOrNull() ?.let(block) public inline fun OptionallyWithUser.optionallyFromUserMessageOrNull(): OptionallyFromUserMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage @@ -4096,42 +4218,6 @@ public inline fun OptionallyWithUser.fromUserChatMessageOrThrow(): FromUserChatM public inline fun OptionallyWithUser.ifFromUserChatMessage(block: (FromUserChatMessage) -> T): T? = fromUserChatMessageOrNull() ?.let(block) -public inline fun OptionallyWithUser.requestGuestContentMessageOrNull(): RequestGuestContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.RequestGuestContentMessage - -public inline fun OptionallyWithUser.requestGuestContentMessageOrThrow(): RequestGuestContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.RequestGuestContentMessage - -public inline fun OptionallyWithUser.ifRequestGuestContentMessage(block: (RequestGuestContentMessage) -> T): T? = requestGuestContentMessageOrNull() ?.let(block) - -public inline fun OptionallyWithUser.supergroupEventMessageOrNull(): SupergroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage - -public inline fun OptionallyWithUser.supergroupEventMessageOrThrow(): SupergroupEventMessage = this as dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage - -public inline fun OptionallyWithUser.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T): T? = supergroupEventMessageOrNull() ?.let(block) - -public inline fun OptionallyWithUser.channelPaidPostOrNull(): ChannelPaidPost? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelPaidPost - -public inline fun OptionallyWithUser.channelPaidPostOrThrow(): ChannelPaidPost = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelPaidPost - -public inline fun OptionallyWithUser.ifChannelPaidPost(block: (ChannelPaidPost) -> T): T? = channelPaidPostOrNull() ?.let(block) - -public inline fun OptionallyWithUser.channelDirectMessagesEventMessageOrNull(): ChannelDirectMessagesEventMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage - -public inline fun OptionallyWithUser.channelDirectMessagesEventMessageOrThrow(): ChannelDirectMessagesEventMessage = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelDirectMessagesEventMessage - -public inline fun OptionallyWithUser.ifChannelDirectMessagesEventMessage(block: (ChannelDirectMessagesEventMessage) -> T): T? = channelDirectMessagesEventMessageOrNull() ?.let(block) - -public inline fun OptionallyWithUser.groupEventMessageOrNull(): GroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage - -public inline fun OptionallyWithUser.groupEventMessageOrThrow(): GroupEventMessage = this as dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage - -public inline fun OptionallyWithUser.ifGroupEventMessage(block: (GroupEventMessage) -> T): T? = groupEventMessageOrNull() ?.let(block) - -public inline fun OptionallyWithUser.privateForumContentMessageOrNull(): PrivateForumContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PrivateForumContentMessage - -public inline fun OptionallyWithUser.privateForumContentMessageOrThrow(): PrivateForumContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PrivateForumContentMessage - -public inline fun OptionallyWithUser.ifPrivateForumContentMessage(block: (PrivateForumContentMessage) -> T): T? = privateForumContentMessageOrNull() ?.let(block) - public inline fun OptionallyWithUser.commonGroupContentMessageOrNull(): CommonGroupContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage public inline fun OptionallyWithUser.commonGroupContentMessageOrThrow(): CommonGroupContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage @@ -4156,29 +4242,29 @@ public inline fun OptionallyWithUser.commonSuggestedChannelDirectMessagesContent public inline fun OptionallyWithUser.ifCommonSuggestedChannelDirectMessagesContentMessage(block: (CommonSuggestedChannelDirectMessagesContentMessage) -> T): T? = commonSuggestedChannelDirectMessagesContentMessageOrNull() ?.let(block) -public inline fun OptionallyWithUser.channelContentMessageOrNull(): ChannelContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage +public inline fun OptionallyWithUser.groupEventMessageOrNull(): GroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage -public inline fun OptionallyWithUser.channelContentMessageOrThrow(): ChannelContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.ChannelContentMessage +public inline fun OptionallyWithUser.groupEventMessageOrThrow(): GroupEventMessage = this as dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage -public inline fun OptionallyWithUser.ifChannelContentMessage(block: (ChannelContentMessage) -> T): T? = channelContentMessageOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifGroupEventMessage(block: (GroupEventMessage) -> T): T? = groupEventMessageOrNull() ?.let(block) -public inline fun OptionallyWithUser.privateContentMessageOrNull(): PrivateContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage +public inline fun OptionallyWithUser.supergroupEventMessageOrNull(): SupergroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage -public inline fun OptionallyWithUser.privateContentMessageOrThrow(): PrivateContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage +public inline fun OptionallyWithUser.supergroupEventMessageOrThrow(): SupergroupEventMessage = this as dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage -public inline fun OptionallyWithUser.ifPrivateContentMessage(block: (PrivateContentMessage) -> T): T? = privateContentMessageOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T): T? = supergroupEventMessageOrNull() ?.let(block) -public inline fun OptionallyWithUser.passportMessageOrNull(): PassportMessage? = this as? dev.inmo.tgbotapi.types.message.PassportMessage +public inline fun OptionallyWithUser.businessContentMessageOrNull(): BusinessContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage -public inline fun OptionallyWithUser.passportMessageOrThrow(): PassportMessage = this as dev.inmo.tgbotapi.types.message.PassportMessage +public inline fun OptionallyWithUser.businessContentMessageOrThrow(): BusinessContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage -public inline fun OptionallyWithUser.ifPassportMessage(block: (PassportMessage) -> T): T? = passportMessageOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifBusinessContentMessage(block: (BusinessContentMessage) -> T): T? = businessContentMessageOrNull() ?.let(block) -public inline fun OptionallyWithUser.commonChannelDirectMessagesEventMessageOrNull(): CommonChannelDirectMessagesEventMessage? = this as? dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage +public inline fun OptionallyWithUser.requestGuestContentMessageOrNull(): RequestGuestContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.RequestGuestContentMessage -public inline fun OptionallyWithUser.commonChannelDirectMessagesEventMessageOrThrow(): CommonChannelDirectMessagesEventMessage = this as dev.inmo.tgbotapi.types.message.CommonChannelDirectMessagesEventMessage +public inline fun OptionallyWithUser.requestGuestContentMessageOrThrow(): RequestGuestContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.RequestGuestContentMessage -public inline fun OptionallyWithUser.ifCommonChannelDirectMessagesEventMessage(block: (CommonChannelDirectMessagesEventMessage) -> T): T? = commonChannelDirectMessagesEventMessageOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifRequestGuestContentMessage(block: (RequestGuestContentMessage) -> T): T? = requestGuestContentMessageOrNull() ?.let(block) public inline fun OptionallyWithUser.commonGroupEventMessageOrNull(): CommonGroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.CommonGroupEventMessage @@ -4186,6 +4272,96 @@ public inline fun OptionallyWithUser.commonGroupEventMessageOrThrow(): CommonGro public inline fun OptionallyWithUser.ifCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T): T? = commonGroupEventMessageOrNull() ?.let(block) +public inline fun OptionallyWithUser.commonSupergroupEventMessageOrNull(): CommonSupergroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage + +public inline fun OptionallyWithUser.commonSupergroupEventMessageOrThrow(): CommonSupergroupEventMessage = this as dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage + +public inline fun OptionallyWithUser.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T): T? = commonSupergroupEventMessageOrNull() ?.let(block) + +public inline fun OptionallyWithUser.inaccessibleMessageDataCallbackQueryOrNull(): InaccessibleMessageDataCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageDataCallbackQuery + +public inline fun OptionallyWithUser.inaccessibleMessageDataCallbackQueryOrThrow(): InaccessibleMessageDataCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageDataCallbackQuery + +public inline fun OptionallyWithUser.ifInaccessibleMessageDataCallbackQuery(block: (InaccessibleMessageDataCallbackQuery) -> T): T? = inaccessibleMessageDataCallbackQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.messageCallbackQueryOrNull(): MessageCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery + +public inline fun OptionallyWithUser.messageCallbackQueryOrThrow(): MessageCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery + +public inline fun OptionallyWithUser.ifMessageCallbackQuery(block: (MessageCallbackQuery) -> T): T? = messageCallbackQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.abstractMessageCallbackQueryOrNull(): AbstractMessageCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.AbstractMessageCallbackQuery + +public inline fun OptionallyWithUser.abstractMessageCallbackQueryOrThrow(): AbstractMessageCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.AbstractMessageCallbackQuery + +public inline fun OptionallyWithUser.ifAbstractMessageCallbackQuery(block: (AbstractMessageCallbackQuery) -> T): T? = abstractMessageCallbackQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.gameShortNameCallbackQueryOrNull(): GameShortNameCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery + +public inline fun OptionallyWithUser.gameShortNameCallbackQueryOrThrow(): GameShortNameCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery + +public inline fun OptionallyWithUser.ifGameShortNameCallbackQuery(block: (GameShortNameCallbackQuery) -> T): T? = gameShortNameCallbackQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.callbackQueryOrNull(): CallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.CallbackQuery + +public inline fun OptionallyWithUser.callbackQueryOrThrow(): CallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.CallbackQuery + +public inline fun OptionallyWithUser.ifCallbackQuery(block: (CallbackQuery) -> T): T? = callbackQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.unknownCallbackQueryTypeOrNull(): UnknownCallbackQueryType? = this as? dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType + +public inline fun OptionallyWithUser.unknownCallbackQueryTypeOrThrow(): UnknownCallbackQueryType = this as dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType + +public inline fun OptionallyWithUser.ifUnknownCallbackQueryType(block: (UnknownCallbackQueryType) -> T): T? = unknownCallbackQueryTypeOrNull() ?.let(block) + +public inline fun OptionallyWithUser.inlineMessageIdGameShortNameCallbackQueryOrNull(): InlineMessageIdGameShortNameCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery + +public inline fun OptionallyWithUser.inlineMessageIdGameShortNameCallbackQueryOrThrow(): InlineMessageIdGameShortNameCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery + +public inline fun OptionallyWithUser.ifInlineMessageIdGameShortNameCallbackQuery(block: (InlineMessageIdGameShortNameCallbackQuery) -> T): T? = inlineMessageIdGameShortNameCallbackQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.inaccessibleMessageGameShortNameCallbackQueryOrNull(): InaccessibleMessageGameShortNameCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageGameShortNameCallbackQuery + +public inline fun OptionallyWithUser.inaccessibleMessageGameShortNameCallbackQueryOrThrow(): InaccessibleMessageGameShortNameCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageGameShortNameCallbackQuery + +public inline fun OptionallyWithUser.ifInaccessibleMessageGameShortNameCallbackQuery(block: (InaccessibleMessageGameShortNameCallbackQuery) -> T): T? = inaccessibleMessageGameShortNameCallbackQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.dataCallbackQueryOrNull(): DataCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery + +public inline fun OptionallyWithUser.dataCallbackQueryOrThrow(): DataCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery + +public inline fun OptionallyWithUser.ifDataCallbackQuery(block: (DataCallbackQuery) -> T): T? = dataCallbackQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.inaccessibleMessageCallbackQueryOrNull(): InaccessibleMessageCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageCallbackQuery + +public inline fun OptionallyWithUser.inaccessibleMessageCallbackQueryOrThrow(): InaccessibleMessageCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageCallbackQuery + +public inline fun OptionallyWithUser.ifInaccessibleMessageCallbackQuery(block: (InaccessibleMessageCallbackQuery) -> T): T? = inaccessibleMessageCallbackQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.inlineMessageIdDataCallbackQueryOrNull(): InlineMessageIdDataCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery + +public inline fun OptionallyWithUser.inlineMessageIdDataCallbackQueryOrThrow(): InlineMessageIdDataCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery + +public inline fun OptionallyWithUser.ifInlineMessageIdDataCallbackQuery(block: (InlineMessageIdDataCallbackQuery) -> T): T? = inlineMessageIdDataCallbackQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.messageDataCallbackQueryOrNull(): MessageDataCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery + +public inline fun OptionallyWithUser.messageDataCallbackQueryOrThrow(): MessageDataCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery + +public inline fun OptionallyWithUser.ifMessageDataCallbackQuery(block: (MessageDataCallbackQuery) -> T): T? = messageDataCallbackQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.messageGameShortNameCallbackQueryOrNull(): MessageGameShortNameCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery + +public inline fun OptionallyWithUser.messageGameShortNameCallbackQueryOrThrow(): MessageGameShortNameCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery + +public inline fun OptionallyWithUser.ifMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T): T? = messageGameShortNameCallbackQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.inlineMessageIdCallbackQueryOrNull(): InlineMessageIdCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery + +public inline fun OptionallyWithUser.inlineMessageIdCallbackQueryOrThrow(): InlineMessageIdCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery + +public inline fun OptionallyWithUser.ifInlineMessageIdCallbackQuery(block: (InlineMessageIdCallbackQuery) -> T): T? = inlineMessageIdCallbackQueryOrNull() ?.let(block) + public inline fun OptionallyWithUser.preCheckoutQueryOrNull(): PreCheckoutQuery? = this as? dev.inmo.tgbotapi.types.payments.PreCheckoutQuery public inline fun OptionallyWithUser.preCheckoutQueryOrThrow(): PreCheckoutQuery = this as dev.inmo.tgbotapi.types.payments.PreCheckoutQuery @@ -4198,24 +4374,6 @@ public inline fun OptionallyWithUser.shippingQueryOrThrow(): ShippingQuery = thi public inline fun OptionallyWithUser.ifShippingQuery(block: (ShippingQuery) -> T): T? = shippingQueryOrNull() ?.let(block) -public inline fun OptionallyWithUser.pollAnswerOrNull(): PollAnswer? = this as? dev.inmo.tgbotapi.types.polls.PollAnswer - -public inline fun OptionallyWithUser.pollAnswerOrThrow(): PollAnswer = this as dev.inmo.tgbotapi.types.polls.PollAnswer - -public inline fun OptionallyWithUser.ifPollAnswer(block: (PollAnswer) -> T): T? = pollAnswerOrNull() ?.let(block) - -public inline fun OptionallyWithUser.pollAnswerPublicOrNull(): PollAnswer.Public? = this as? dev.inmo.tgbotapi.types.polls.PollAnswer.Public - -public inline fun OptionallyWithUser.pollAnswerPublicOrThrow(): PollAnswer.Public = this as dev.inmo.tgbotapi.types.polls.PollAnswer.Public - -public inline fun OptionallyWithUser.ifPollAnswerPublic(block: (PollAnswer.Public) -> T): T? = pollAnswerPublicOrNull() ?.let(block) - -public inline fun OptionallyWithUser.pollAnswerAnonymousOrNull(): PollAnswer.Anonymous? = this as? dev.inmo.tgbotapi.types.polls.PollAnswer.Anonymous - -public inline fun OptionallyWithUser.pollAnswerAnonymousOrThrow(): PollAnswer.Anonymous = this as dev.inmo.tgbotapi.types.polls.PollAnswer.Anonymous - -public inline fun OptionallyWithUser.ifPollAnswerAnonymous(block: (PollAnswer.Anonymous) -> T): T? = pollAnswerAnonymousOrNull() ?.let(block) - public inline fun OptionallyWithUser.chatInviteLinkOrNull(): ChatInviteLink? = this as? dev.inmo.tgbotapi.types.ChatInviteLink public inline fun OptionallyWithUser.chatInviteLinkOrThrow(): ChatInviteLink = this as dev.inmo.tgbotapi.types.ChatInviteLink @@ -4252,17 +4410,53 @@ public inline fun OptionallyWithUser.chatInviteLinkUnlimitedOrThrow(): ChatInvit public inline fun OptionallyWithUser.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T): T? = chatInviteLinkUnlimitedOrNull() ?.let(block) -public inline fun OptionallyWithUser.directMessagesTopicOrNull(): DirectMessagesTopic? = this as? dev.inmo.tgbotapi.types.chat.DirectMessagesTopic +public inline fun OptionallyWithUser.baseInlineQueryOrNull(): BaseInlineQuery? = this as? dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery -public inline fun OptionallyWithUser.directMessagesTopicOrThrow(): DirectMessagesTopic = this as dev.inmo.tgbotapi.types.chat.DirectMessagesTopic +public inline fun OptionallyWithUser.baseInlineQueryOrThrow(): BaseInlineQuery = this as dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery -public inline fun OptionallyWithUser.ifDirectMessagesTopic(block: (DirectMessagesTopic) -> T): T? = directMessagesTopicOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifBaseInlineQuery(block: (BaseInlineQuery) -> T): T? = baseInlineQueryOrNull() ?.let(block) -public inline fun OptionallyWithUser.restrictedChatMemberOrNull(): RestrictedChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember +public inline fun OptionallyWithUser.locationInlineQueryOrNull(): LocationInlineQuery? = this as? dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery -public inline fun OptionallyWithUser.restrictedChatMemberOrThrow(): RestrictedChatMember = this as dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember +public inline fun OptionallyWithUser.locationInlineQueryOrThrow(): LocationInlineQuery = this as dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery -public inline fun OptionallyWithUser.ifRestrictedChatMember(block: (RestrictedChatMember) -> T): T? = restrictedChatMemberOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifLocationInlineQuery(block: (LocationInlineQuery) -> T): T? = locationInlineQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.inlineQueryOrNull(): InlineQuery? = this as? dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery + +public inline fun OptionallyWithUser.inlineQueryOrThrow(): InlineQuery = this as dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery + +public inline fun OptionallyWithUser.ifInlineQuery(block: (InlineQuery) -> T): T? = inlineQueryOrNull() ?.let(block) + +public inline fun OptionallyWithUser.chosenInlineResultOrNull(): ChosenInlineResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult + +public inline fun OptionallyWithUser.chosenInlineResultOrThrow(): ChosenInlineResult = this as dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult + +public inline fun OptionallyWithUser.ifChosenInlineResult(block: (ChosenInlineResult) -> T): T? = chosenInlineResultOrNull() ?.let(block) + +public inline fun OptionallyWithUser.locationChosenInlineResultOrNull(): LocationChosenInlineResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult + +public inline fun OptionallyWithUser.locationChosenInlineResultOrThrow(): LocationChosenInlineResult = this as dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult + +public inline fun OptionallyWithUser.ifLocationChosenInlineResult(block: (LocationChosenInlineResult) -> T): T? = locationChosenInlineResultOrNull() ?.let(block) + +public inline fun OptionallyWithUser.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult + +public inline fun OptionallyWithUser.baseChosenInlineResultOrThrow(): BaseChosenInlineResult = this as dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult + +public inline fun OptionallyWithUser.ifBaseChosenInlineResult(block: (BaseChosenInlineResult) -> T): T? = baseChosenInlineResultOrNull() ?.let(block) + +public inline fun OptionallyWithUser.chatJoinRequestOrNull(): ChatJoinRequest? = this as? dev.inmo.tgbotapi.types.chat.ChatJoinRequest + +public inline fun OptionallyWithUser.chatJoinRequestOrThrow(): ChatJoinRequest = this as dev.inmo.tgbotapi.types.chat.ChatJoinRequest + +public inline fun OptionallyWithUser.ifChatJoinRequest(block: (ChatJoinRequest) -> T): T? = chatJoinRequestOrNull() ?.let(block) + +public inline fun OptionallyWithUser.administratorChatMemberOrNull(): AdministratorChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember + +public inline fun OptionallyWithUser.administratorChatMemberOrThrow(): AdministratorChatMember = this as dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember + +public inline fun OptionallyWithUser.ifAdministratorChatMember(block: (AdministratorChatMember) -> T): T? = administratorChatMemberOrNull() ?.let(block) public inline fun OptionallyWithUser.leftChatMemberOrNull(): LeftChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.LeftChatMember @@ -4270,11 +4464,17 @@ public inline fun OptionallyWithUser.leftChatMemberOrThrow(): LeftChatMember = t public inline fun OptionallyWithUser.ifLeftChatMember(block: (LeftChatMember) -> T): T? = leftChatMemberOrNull() ?.let(block) -public inline fun OptionallyWithUser.administratorChatMemberOrNull(): AdministratorChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember +public inline fun OptionallyWithUser.chatMemberUpdatedOrNull(): ChatMemberUpdated? = this as? dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated -public inline fun OptionallyWithUser.administratorChatMemberOrThrow(): AdministratorChatMember = this as dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember +public inline fun OptionallyWithUser.chatMemberUpdatedOrThrow(): ChatMemberUpdated = this as dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated -public inline fun OptionallyWithUser.ifAdministratorChatMember(block: (AdministratorChatMember) -> T): T? = administratorChatMemberOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifChatMemberUpdated(block: (ChatMemberUpdated) -> T): T? = chatMemberUpdatedOrNull() ?.let(block) + +public inline fun OptionallyWithUser.restrictedChatMemberOrNull(): RestrictedChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember + +public inline fun OptionallyWithUser.restrictedChatMemberOrThrow(): RestrictedChatMember = this as dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember + +public inline fun OptionallyWithUser.ifRestrictedChatMember(block: (RestrictedChatMember) -> T): T? = restrictedChatMemberOrNull() ?.let(block) public inline fun OptionallyWithUser.specialRightsChatMemberOrNull(): SpecialRightsChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember @@ -4288,11 +4488,17 @@ public inline fun OptionallyWithUser.memberChatMemberOrThrow(): MemberChatMember public inline fun OptionallyWithUser.ifMemberChatMember(block: (MemberChatMember) -> T): T? = memberChatMemberOrNull() ?.let(block) -public inline fun OptionallyWithUser.chatMemberUpdatedOrNull(): ChatMemberUpdated? = this as? dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated +public inline fun OptionallyWithUser.subscriptionMemberChatMemberOrNull(): SubscriptionMemberChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.SubscriptionMemberChatMember -public inline fun OptionallyWithUser.chatMemberUpdatedOrThrow(): ChatMemberUpdated = this as dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated +public inline fun OptionallyWithUser.subscriptionMemberChatMemberOrThrow(): SubscriptionMemberChatMember = this as dev.inmo.tgbotapi.types.chat.member.SubscriptionMemberChatMember -public inline fun OptionallyWithUser.ifChatMemberUpdated(block: (ChatMemberUpdated) -> T): T? = chatMemberUpdatedOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifSubscriptionMemberChatMember(block: (SubscriptionMemberChatMember) -> T): T? = subscriptionMemberChatMemberOrNull() ?.let(block) + +public inline fun OptionallyWithUser.chatMemberOrNull(): ChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.ChatMember + +public inline fun OptionallyWithUser.chatMemberOrThrow(): ChatMember = this as dev.inmo.tgbotapi.types.chat.member.ChatMember + +public inline fun OptionallyWithUser.ifChatMember(block: (ChatMember) -> T): T? = chatMemberOrNull() ?.let(block) public inline fun OptionallyWithUser.restrictedMemberChatMemberOrNull(): RestrictedMemberChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.RestrictedMemberChatMember @@ -4306,113 +4512,17 @@ public inline fun OptionallyWithUser.ownerChatMemberOrThrow(): OwnerChatMember = public inline fun OptionallyWithUser.ifOwnerChatMember(block: (OwnerChatMember) -> T): T? = ownerChatMemberOrNull() ?.let(block) -public inline fun OptionallyWithUser.subscriptionMemberChatMemberOrNull(): SubscriptionMemberChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.SubscriptionMemberChatMember - -public inline fun OptionallyWithUser.subscriptionMemberChatMemberOrThrow(): SubscriptionMemberChatMember = this as dev.inmo.tgbotapi.types.chat.member.SubscriptionMemberChatMember - -public inline fun OptionallyWithUser.ifSubscriptionMemberChatMember(block: (SubscriptionMemberChatMember) -> T): T? = subscriptionMemberChatMemberOrNull() ?.let(block) - public inline fun OptionallyWithUser.kickedChatMemberOrNull(): KickedChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.KickedChatMember public inline fun OptionallyWithUser.kickedChatMemberOrThrow(): KickedChatMember = this as dev.inmo.tgbotapi.types.chat.member.KickedChatMember public inline fun OptionallyWithUser.ifKickedChatMember(block: (KickedChatMember) -> T): T? = kickedChatMemberOrNull() ?.let(block) -public inline fun OptionallyWithUser.chatMemberOrNull(): ChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.ChatMember +public inline fun OptionallyWithUser.directMessagesTopicOrNull(): DirectMessagesTopic? = this as? dev.inmo.tgbotapi.types.chat.DirectMessagesTopic -public inline fun OptionallyWithUser.chatMemberOrThrow(): ChatMember = this as dev.inmo.tgbotapi.types.chat.member.ChatMember +public inline fun OptionallyWithUser.directMessagesTopicOrThrow(): DirectMessagesTopic = this as dev.inmo.tgbotapi.types.chat.DirectMessagesTopic -public inline fun OptionallyWithUser.ifChatMember(block: (ChatMember) -> T): T? = chatMemberOrNull() ?.let(block) - -public inline fun OptionallyWithUser.chatJoinRequestOrNull(): ChatJoinRequest? = this as? dev.inmo.tgbotapi.types.chat.ChatJoinRequest - -public inline fun OptionallyWithUser.chatJoinRequestOrThrow(): ChatJoinRequest = this as dev.inmo.tgbotapi.types.chat.ChatJoinRequest - -public inline fun OptionallyWithUser.ifChatJoinRequest(block: (ChatJoinRequest) -> T): T? = chatJoinRequestOrNull() ?.let(block) - -public inline fun OptionallyWithUser.inlineMessageIdDataCallbackQueryOrNull(): InlineMessageIdDataCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery - -public inline fun OptionallyWithUser.inlineMessageIdDataCallbackQueryOrThrow(): InlineMessageIdDataCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery - -public inline fun OptionallyWithUser.ifInlineMessageIdDataCallbackQuery(block: (InlineMessageIdDataCallbackQuery) -> T): T? = inlineMessageIdDataCallbackQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.abstractMessageCallbackQueryOrNull(): AbstractMessageCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.AbstractMessageCallbackQuery - -public inline fun OptionallyWithUser.abstractMessageCallbackQueryOrThrow(): AbstractMessageCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.AbstractMessageCallbackQuery - -public inline fun OptionallyWithUser.ifAbstractMessageCallbackQuery(block: (AbstractMessageCallbackQuery) -> T): T? = abstractMessageCallbackQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.inlineMessageIdGameShortNameCallbackQueryOrNull(): InlineMessageIdGameShortNameCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery - -public inline fun OptionallyWithUser.inlineMessageIdGameShortNameCallbackQueryOrThrow(): InlineMessageIdGameShortNameCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery - -public inline fun OptionallyWithUser.ifInlineMessageIdGameShortNameCallbackQuery(block: (InlineMessageIdGameShortNameCallbackQuery) -> T): T? = inlineMessageIdGameShortNameCallbackQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.inaccessibleMessageDataCallbackQueryOrNull(): InaccessibleMessageDataCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageDataCallbackQuery - -public inline fun OptionallyWithUser.inaccessibleMessageDataCallbackQueryOrThrow(): InaccessibleMessageDataCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageDataCallbackQuery - -public inline fun OptionallyWithUser.ifInaccessibleMessageDataCallbackQuery(block: (InaccessibleMessageDataCallbackQuery) -> T): T? = inaccessibleMessageDataCallbackQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.gameShortNameCallbackQueryOrNull(): GameShortNameCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery - -public inline fun OptionallyWithUser.gameShortNameCallbackQueryOrThrow(): GameShortNameCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery - -public inline fun OptionallyWithUser.ifGameShortNameCallbackQuery(block: (GameShortNameCallbackQuery) -> T): T? = gameShortNameCallbackQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.callbackQueryOrNull(): CallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.CallbackQuery - -public inline fun OptionallyWithUser.callbackQueryOrThrow(): CallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.CallbackQuery - -public inline fun OptionallyWithUser.ifCallbackQuery(block: (CallbackQuery) -> T): T? = callbackQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.unknownCallbackQueryTypeOrNull(): UnknownCallbackQueryType? = this as? dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType - -public inline fun OptionallyWithUser.unknownCallbackQueryTypeOrThrow(): UnknownCallbackQueryType = this as dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType - -public inline fun OptionallyWithUser.ifUnknownCallbackQueryType(block: (UnknownCallbackQueryType) -> T): T? = unknownCallbackQueryTypeOrNull() ?.let(block) - -public inline fun OptionallyWithUser.inaccessibleMessageCallbackQueryOrNull(): InaccessibleMessageCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageCallbackQuery - -public inline fun OptionallyWithUser.inaccessibleMessageCallbackQueryOrThrow(): InaccessibleMessageCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageCallbackQuery - -public inline fun OptionallyWithUser.ifInaccessibleMessageCallbackQuery(block: (InaccessibleMessageCallbackQuery) -> T): T? = inaccessibleMessageCallbackQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.messageGameShortNameCallbackQueryOrNull(): MessageGameShortNameCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery - -public inline fun OptionallyWithUser.messageGameShortNameCallbackQueryOrThrow(): MessageGameShortNameCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery - -public inline fun OptionallyWithUser.ifMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T): T? = messageGameShortNameCallbackQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.inaccessibleMessageGameShortNameCallbackQueryOrNull(): InaccessibleMessageGameShortNameCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageGameShortNameCallbackQuery - -public inline fun OptionallyWithUser.inaccessibleMessageGameShortNameCallbackQueryOrThrow(): InaccessibleMessageGameShortNameCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageGameShortNameCallbackQuery - -public inline fun OptionallyWithUser.ifInaccessibleMessageGameShortNameCallbackQuery(block: (InaccessibleMessageGameShortNameCallbackQuery) -> T): T? = inaccessibleMessageGameShortNameCallbackQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.dataCallbackQueryOrNull(): DataCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery - -public inline fun OptionallyWithUser.dataCallbackQueryOrThrow(): DataCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery - -public inline fun OptionallyWithUser.ifDataCallbackQuery(block: (DataCallbackQuery) -> T): T? = dataCallbackQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.inlineMessageIdCallbackQueryOrNull(): InlineMessageIdCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery - -public inline fun OptionallyWithUser.inlineMessageIdCallbackQueryOrThrow(): InlineMessageIdCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery - -public inline fun OptionallyWithUser.ifInlineMessageIdCallbackQuery(block: (InlineMessageIdCallbackQuery) -> T): T? = inlineMessageIdCallbackQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.messageCallbackQueryOrNull(): MessageCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery - -public inline fun OptionallyWithUser.messageCallbackQueryOrThrow(): MessageCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery - -public inline fun OptionallyWithUser.ifMessageCallbackQuery(block: (MessageCallbackQuery) -> T): T? = messageCallbackQueryOrNull() ?.let(block) - -public inline fun OptionallyWithUser.messageDataCallbackQueryOrNull(): MessageDataCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery - -public inline fun OptionallyWithUser.messageDataCallbackQueryOrThrow(): MessageDataCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery - -public inline fun OptionallyWithUser.ifMessageDataCallbackQuery(block: (MessageDataCallbackQuery) -> T): T? = messageDataCallbackQueryOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifDirectMessagesTopic(block: (DirectMessagesTopic) -> T): T? = directMessagesTopicOrNull() ?.let(block) public inline fun OptionallyWithUser.withUserOrNull(): WithUser? = this as? dev.inmo.tgbotapi.abstracts.WithUser @@ -4431,99 +4541,3 @@ public inline fun OptionallyWithUser.fromUserOrNull(): FromUser? = this as? dev. public inline fun OptionallyWithUser.fromUserOrThrow(): FromUser = this as dev.inmo.tgbotapi.abstracts.FromUser public inline fun OptionallyWithUser.ifFromUser(block: (FromUser) -> T): T? = fromUserOrNull() ?.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.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.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 BotException.commonBotExceptionOrNull(): CommonBotException? = this as? dev.inmo.tgbotapi.bot.exceptions.CommonBotException - -public inline fun BotException.commonBotExceptionOrThrow(): CommonBotException = this as dev.inmo.tgbotapi.bot.exceptions.CommonBotException - -public inline fun BotException.ifCommonBotException(block: (CommonBotException) -> T): T? = commonBotExceptionOrNull() ?.let(block) - -public inline fun BotException.apiExceptionOrNull(): ApiException? = this as? dev.inmo.tgbotapi.bot.exceptions.ApiException - -public inline fun BotException.apiExceptionOrThrow(): ApiException = this as dev.inmo.tgbotapi.bot.exceptions.ApiException - -public inline fun BotException.ifApiException(block: (ApiException) -> T): T? = apiExceptionOrNull() ?.let(block) - -public inline fun BotException.requestExceptionOrNull(): RequestException? = this as? dev.inmo.tgbotapi.bot.exceptions.RequestException - -public inline fun BotException.requestExceptionOrThrow(): RequestException = this as dev.inmo.tgbotapi.bot.exceptions.RequestException - -public inline fun BotException.ifRequestException(block: (RequestException) -> T): T? = requestExceptionOrNull() ?.let(block) - -public inline fun BotException.commonRequestExceptionOrNull(): CommonRequestException? = this as? dev.inmo.tgbotapi.bot.exceptions.CommonRequestException - -public inline fun BotException.commonRequestExceptionOrThrow(): CommonRequestException = this as dev.inmo.tgbotapi.bot.exceptions.CommonRequestException - -public inline fun BotException.ifCommonRequestException(block: (CommonRequestException) -> T): T? = commonRequestExceptionOrNull() ?.let(block) - -public inline fun BotException.unauthorizedExceptionOrNull(): UnauthorizedException? = this as? dev.inmo.tgbotapi.bot.exceptions.UnauthorizedException - -public inline fun BotException.unauthorizedExceptionOrThrow(): UnauthorizedException = this as dev.inmo.tgbotapi.bot.exceptions.UnauthorizedException - -public inline fun BotException.ifUnauthorizedException(block: (UnauthorizedException) -> T): T? = unauthorizedExceptionOrNull() ?.let(block) - -public inline fun BotException.replyMessageNotFoundExceptionOrNull(): ReplyMessageNotFoundException? = this as? dev.inmo.tgbotapi.bot.exceptions.ReplyMessageNotFoundException - -public inline fun BotException.replyMessageNotFoundExceptionOrThrow(): ReplyMessageNotFoundException = this as dev.inmo.tgbotapi.bot.exceptions.ReplyMessageNotFoundException - -public inline fun BotException.ifReplyMessageNotFoundException(block: (ReplyMessageNotFoundException) -> T): T? = replyMessageNotFoundExceptionOrNull() ?.let(block) - -public inline fun BotException.messageIsNotModifiedExceptionOrNull(): MessageIsNotModifiedException? = this as? dev.inmo.tgbotapi.bot.exceptions.MessageIsNotModifiedException - -public inline fun BotException.messageIsNotModifiedExceptionOrThrow(): MessageIsNotModifiedException = this as dev.inmo.tgbotapi.bot.exceptions.MessageIsNotModifiedException - -public inline fun BotException.ifMessageIsNotModifiedException(block: (MessageIsNotModifiedException) -> T): T? = messageIsNotModifiedExceptionOrNull() ?.let(block) - -public inline fun BotException.messageToEditNotFoundExceptionOrNull(): MessageToEditNotFoundException? = this as? dev.inmo.tgbotapi.bot.exceptions.MessageToEditNotFoundException - -public inline fun BotException.messageToEditNotFoundExceptionOrThrow(): MessageToEditNotFoundException = this as dev.inmo.tgbotapi.bot.exceptions.MessageToEditNotFoundException - -public inline fun BotException.ifMessageToEditNotFoundException(block: (MessageToEditNotFoundException) -> T): T? = messageToEditNotFoundExceptionOrNull() ?.let(block) - -public inline fun BotException.invalidPhotoDimensionsExceptionOrNull(): InvalidPhotoDimensionsException? = this as? dev.inmo.tgbotapi.bot.exceptions.InvalidPhotoDimensionsException - -public inline fun BotException.invalidPhotoDimensionsExceptionOrThrow(): InvalidPhotoDimensionsException = this as dev.inmo.tgbotapi.bot.exceptions.InvalidPhotoDimensionsException - -public inline fun BotException.ifInvalidPhotoDimensionsException(block: (InvalidPhotoDimensionsException) -> T): T? = invalidPhotoDimensionsExceptionOrNull() ?.let(block) - -public inline fun BotException.wrongFileIdentifierExceptionOrNull(): WrongFileIdentifierException? = this as? dev.inmo.tgbotapi.bot.exceptions.WrongFileIdentifierException - -public inline fun BotException.wrongFileIdentifierExceptionOrThrow(): WrongFileIdentifierException = this as dev.inmo.tgbotapi.bot.exceptions.WrongFileIdentifierException - -public inline fun BotException.ifWrongFileIdentifierException(block: (WrongFileIdentifierException) -> T): T? = wrongFileIdentifierExceptionOrNull() ?.let(block) - -public inline fun BotException.tooMuchRequestsExceptionOrNull(): TooMuchRequestsException? = this as? dev.inmo.tgbotapi.bot.exceptions.TooMuchRequestsException - -public inline fun BotException.tooMuchRequestsExceptionOrThrow(): TooMuchRequestsException = this as dev.inmo.tgbotapi.bot.exceptions.TooMuchRequestsException - -public inline fun BotException.ifTooMuchRequestsException(block: (TooMuchRequestsException) -> T): T? = tooMuchRequestsExceptionOrNull() ?.let(block) - -public inline fun BotException.getUpdatesConflictOrNull(): GetUpdatesConflict? = this as? dev.inmo.tgbotapi.bot.exceptions.GetUpdatesConflict - -public inline fun BotException.getUpdatesConflictOrThrow(): GetUpdatesConflict = this as dev.inmo.tgbotapi.bot.exceptions.GetUpdatesConflict - -public inline fun BotException.ifGetUpdatesConflict(block: (GetUpdatesConflict) -> T): T? = getUpdatesConflictOrNull() ?.let(block) - -public inline fun BotException.commonBotExceptionDefaultOrNull(): CommonBotException.Default? = this as? dev.inmo.tgbotapi.bot.exceptions.CommonBotException.Default - -public inline fun BotException.commonBotExceptionDefaultOrThrow(): CommonBotException.Default = this as dev.inmo.tgbotapi.bot.exceptions.CommonBotException.Default - -public inline fun BotException.ifCommonBotExceptionDefault(block: (CommonBotException.Default) -> T): T? = commonBotExceptionDefaultOrNull() ?.let(block) From f6d5b3ea7184edb5eafc45ed63d55e99185e16f8 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 19 Jun 2026 17:03:26 +0600 Subject: [PATCH 03/27] Add Bot API 10.1 Join Request Queries support Adds: - ChatJoinRequestQueryId value class and ChatJoinRequest.queryId field - ExtendedBot.supportsJoinRequestQueries (User.supports_join_request_queries) - ExtendedChat.guardBot (ChatFullInfo.guard_bot), parsed for public chats - AnswerChatJoinRequestQuery request + ChatJoinRequestQueryResult enum - SendChatJoinRequestWebApp request - answerChatJoinRequestQuery / sendChatJoinRequestWebApp TelegramBot extensions Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 9 + tgbotapi.api/api/tgbotapi.api.api | 12 + .../AnswerChatJoinRequestQuery.kt | 28 +++ .../invite_links/SendChatJoinRequestWebApp.kt | 27 +++ tgbotapi.core/api/tgbotapi.core.api | 219 +++++++++++++++--- .../AnswerChatJoinRequestQuery.kt | 58 +++++ .../invite_links/SendChatJoinRequestWebApp.kt | 34 +++ .../tgbotapi/types/ChatJoinRequestQueryId.kt | 19 ++ .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 5 + .../tgbotapi/types/chat/ChatJoinRequest.kt | 4 +- .../dev/inmo/tgbotapi/types/chat/Extended.kt | 22 +- .../tgbotapi/types/chat/ExtendedAbstracts.kt | 8 + .../utils/extensions/raw/ChatJoinRequest.kt | 5 + 13 files changed, 407 insertions(+), 43 deletions(-) create mode 100644 tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/AnswerChatJoinRequestQuery.kt create mode 100644 tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/SendChatJoinRequestWebApp.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatJoinRequestQueryId.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d51604f3a..7857b69f55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,15 @@ * (`Polls`) Added `Link` type (`dev.inmo.tgbotapi.types.Link`) implementing `PollMedia`, carrying the `url` of a link attached to a poll option * (`Polls`) Added `link` field parsing to `PollMedia` deserialization/serialization * (`Polls`) Added `TelegramMediaLink` (`InputMediaLink`) implementing `InputPollOptionMedia`, usable as a poll option media + * (`Join Request Queries`) Added `ChatJoinRequestQueryId` value class and `queryId` field to `ChatJoinRequest` + * (`Join Request Queries`) Added `supportsJoinRequestQueries` flag to `ExtendedBot` (`User.supports_join_request_queries`) + * (`Join Request Queries`) Added `guardBot` field to `ExtendedChat` (`ChatFullInfo.guard_bot`), parsed for public chats + * (`Join Request Queries`) Added `AnswerChatJoinRequestQuery` request and `ChatJoinRequestQueryResult` enum (`Approve`/`Decline`/`Queue`) + * (`Join Request Queries`) Added `SendChatJoinRequestWebApp` request +* `API`: + * (`Join Request Queries`) Added `answerChatJoinRequestQuery` and `sendChatJoinRequestWebApp` `TelegramBot` extensions +* `Utils`: + * (`Join Request Queries`) Added `ChatJoinRequest.query_id` raw accessor ## 34.0.0 diff --git a/tgbotapi.api/api/tgbotapi.api.api b/tgbotapi.api/api/tgbotapi.api.api index a24a1f5819..2792404b17 100644 --- a/tgbotapi.api/api/tgbotapi.api.api +++ b/tgbotapi.api/api/tgbotapi.api.api @@ -562,6 +562,12 @@ public final class dev/inmo/tgbotapi/extensions/api/chat/get/GetForumTopicIconSt public static final fun getForumTopicIconStickers (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } +public final class dev/inmo/tgbotapi/extensions/api/chat/invite_links/AnswerChatJoinRequestQueryKt { + public static final fun answerChatJoinRequestQuery (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest;Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun answerChatJoinRequestQuery (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/update/ChatJoinRequestUpdate;Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun answerChatJoinRequestQuery-Vwi-J50 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + public final class dev/inmo/tgbotapi/extensions/api/chat/invite_links/ApproveChatJoinRequestKt { public static final fun approve (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun approveChatJoinRequest (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -687,6 +693,12 @@ public final class dev/inmo/tgbotapi/extensions/api/chat/invite_links/RevokeChat public static final fun revokeChatInviteLink (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } +public final class dev/inmo/tgbotapi/extensions/api/chat/invite_links/SendChatJoinRequestWebAppKt { + public static final fun sendChatJoinRequestWebApp (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun sendChatJoinRequestWebApp (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/update/ChatJoinRequestUpdate;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun sendChatJoinRequestWebApp-Vwi-J50 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + public final class dev/inmo/tgbotapi/extensions/api/chat/members/BanChatMemberKt { public static final fun banChatMember (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/lang/Boolean;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun banChatMember (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/lang/Boolean;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/AnswerChatJoinRequestQuery.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/AnswerChatJoinRequestQuery.kt new file mode 100644 index 0000000000..89d2aebcca --- /dev/null +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/AnswerChatJoinRequestQuery.kt @@ -0,0 +1,28 @@ +package dev.inmo.tgbotapi.extensions.api.chat.invite_links + +import dev.inmo.tgbotapi.bot.TelegramBot +import dev.inmo.tgbotapi.requests.chat.invite_links.AnswerChatJoinRequestQuery +import dev.inmo.tgbotapi.requests.chat.invite_links.ChatJoinRequestQueryResult +import dev.inmo.tgbotapi.types.ChatJoinRequestQueryId +import dev.inmo.tgbotapi.types.chat.ChatJoinRequest +import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate + +public suspend fun TelegramBot.answerChatJoinRequestQuery( + chatJoinRequestQueryId: ChatJoinRequestQueryId, + result: ChatJoinRequestQueryResult +): Unit = execute(AnswerChatJoinRequestQuery(chatJoinRequestQueryId, result)) + +public suspend fun TelegramBot.answerChatJoinRequestQuery( + chatJoinRequest: ChatJoinRequest, + result: ChatJoinRequestQueryResult +): Unit = answerChatJoinRequestQuery( + requireNotNull(chatJoinRequest.queryId) { + "ChatJoinRequest.queryId is null, this request can't be answered with answerChatJoinRequestQuery" + }, + result +) + +public suspend fun TelegramBot.answerChatJoinRequestQuery( + chatJoinRequestUpdate: ChatJoinRequestUpdate, + result: ChatJoinRequestQueryResult +): Unit = answerChatJoinRequestQuery(chatJoinRequestUpdate.data, result) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/SendChatJoinRequestWebApp.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/SendChatJoinRequestWebApp.kt new file mode 100644 index 0000000000..77c860d1b4 --- /dev/null +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/SendChatJoinRequestWebApp.kt @@ -0,0 +1,27 @@ +package dev.inmo.tgbotapi.extensions.api.chat.invite_links + +import dev.inmo.tgbotapi.bot.TelegramBot +import dev.inmo.tgbotapi.requests.chat.invite_links.SendChatJoinRequestWebApp +import dev.inmo.tgbotapi.types.ChatJoinRequestQueryId +import dev.inmo.tgbotapi.types.chat.ChatJoinRequest +import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate + +public suspend fun TelegramBot.sendChatJoinRequestWebApp( + chatJoinRequestQueryId: ChatJoinRequestQueryId, + webAppUrl: String +): Unit = execute(SendChatJoinRequestWebApp(chatJoinRequestQueryId, webAppUrl)) + +public suspend fun TelegramBot.sendChatJoinRequestWebApp( + chatJoinRequest: ChatJoinRequest, + webAppUrl: String +): Unit = sendChatJoinRequestWebApp( + requireNotNull(chatJoinRequest.queryId) { + "ChatJoinRequest.queryId is null, this request can't be processed with sendChatJoinRequestWebApp" + }, + webAppUrl +) + +public suspend fun TelegramBot.sendChatJoinRequestWebApp( + chatJoinRequestUpdate: ChatJoinRequestUpdate, + webAppUrl: String +): Unit = sendChatJoinRequestWebApp(chatJoinRequestUpdate.data, webAppUrl) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 53efbf6cce..7dd9b0e601 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -3327,6 +3327,38 @@ public final class dev/inmo/tgbotapi/requests/chat/get/GetForumTopicIconStickers public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery : dev/inmo/tgbotapi/requests/abstracts/SimpleRequest { + public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery$Companion; + public synthetic fun (Ljava/lang/String;Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1-t8Qe7NA ()Ljava/lang/String; + public final fun component2 ()Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult; + public final fun copy-IADO17I (Ljava/lang/String;Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult;)Ldev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery; + public static synthetic fun copy-IADO17I$default (Ldev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery; + public fun equals (Ljava/lang/Object;)Z + public final fun getChatJoinRequestQueryId-t8Qe7NA ()Ljava/lang/String; + public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy; + public final fun getResult ()Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult; + public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy; + public fun hashCode ()I + public fun method ()Ljava/lang/String; + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/requests/chat/invite_links/ApproveChatJoinRequest : dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestAnswer { public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/ApproveChatJoinRequest$Companion; public fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/IdChatIdentifier;)V @@ -3369,6 +3401,20 @@ public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestA public static fun getResultDeserializer (Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestAnswer;)Lkotlinx/serialization/DeserializationStrategy; } +public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult : java/lang/Enum { + public static final field Approve Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult; + public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Companion; + public static final field Decline Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult; + public static final field Queue Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static fun valueOf (Ljava/lang/String;)Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult; + public static fun values ()[Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult; +} + +public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public abstract interface class dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink : dev/inmo/tgbotapi/requests/chat/abstracts/EditChatInviteLinkRequest { public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink$Companion; public abstract fun getExpirationUnixTimeStamp ()Ldev/inmo/tgbotapi/types/TelegramDate; @@ -3815,6 +3861,38 @@ public final class dev/inmo/tgbotapi/requests/chat/invite_links/RevokeChatInvite public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp : dev/inmo/tgbotapi/requests/abstracts/SimpleRequest { + public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp$Companion; + public synthetic fun (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1-t8Qe7NA ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun copy-IADO17I (Ljava/lang/String;Ljava/lang/String;)Ldev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp; + public static synthetic fun copy-IADO17I$default (Ldev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp; + public fun equals (Ljava/lang/Object;)Z + public final fun getChatJoinRequestQueryId-t8Qe7NA ()Ljava/lang/String; + public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy; + public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy; + public final fun getWebAppUrl ()Ljava/lang/String; + public fun hashCode ()I + public fun method ()Ljava/lang/String; + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/requests/chat/members/BanChatMember : dev/inmo/tgbotapi/abstracts/types/UntilDate, dev/inmo/tgbotapi/requests/chat/abstracts/ChatMemberRequest { public static final field Companion Ldev/inmo/tgbotapi/requests/chat/members/BanChatMember$Companion; public fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/lang/Boolean;)V @@ -10807,6 +10885,36 @@ public final class dev/inmo/tgbotapi/types/ChatInviteLinkWithLimitedMembers$Comp public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/types/ChatJoinRequestQueryId { + public static final field Companion Ldev/inmo/tgbotapi/types/ChatJoinRequestQueryId$Companion; + public static final synthetic fun box-impl (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/ChatJoinRequestQueryId; + public static fun constructor-impl (Ljava/lang/String;)Ljava/lang/String; + public fun equals (Ljava/lang/Object;)Z + public static fun equals-impl (Ljava/lang/String;Ljava/lang/Object;)Z + public static final fun equals-impl0 (Ljava/lang/String;Ljava/lang/String;)Z + public final fun getString ()Ljava/lang/String; + public fun hashCode ()I + public static fun hashCode-impl (Ljava/lang/String;)I + public fun toString ()Ljava/lang/String; + public static fun toString-impl (Ljava/lang/String;)Ljava/lang/String; + public final synthetic fun unbox-impl ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/ChatJoinRequestQueryId$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/ChatJoinRequestQueryId$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize-dsFNv7A (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/String; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize-D96dDxI (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/String;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/ChatJoinRequestQueryId$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/types/ChatLocation { public static final field Companion Ldev/inmo/tgbotapi/types/ChatLocation$Companion; public fun (Ldev/inmo/tgbotapi/types/location/StaticLocation;Ljava/lang/String;)V @@ -11006,6 +11114,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field chatIsChannelField Ljava/lang/String; public static final field chatIsCreatedField Ljava/lang/String; public static final field chatIsForumField Ljava/lang/String; + public static final field chatJoinRequestQueryIdField Ljava/lang/String; public static final field chatTypeField Ljava/lang/String; public static final field chatsField Ljava/lang/String; public static final field checklistField Ljava/lang/String; @@ -11133,6 +11242,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field giveawayMessageIdField Ljava/lang/String; public static final field googlePlaceIdField Ljava/lang/String; public static final field googlePlaceTypeField Ljava/lang/String; + public static final field guardBotField Ljava/lang/String; public static final field guestQueryIdField Ljava/lang/String; public static final field hasAggressiveAntiSpamEnabledField Ljava/lang/String; public static final field hasColorsField Ljava/lang/String; @@ -11355,6 +11465,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field publisherChatField Ljava/lang/String; public static final field qualitiesField Ljava/lang/String; public static final field queryField Ljava/lang/String; + public static final field queryIdField Ljava/lang/String; public static final field questionEntitiesField Ljava/lang/String; public static final field questionField Ljava/lang/String; public static final field questionParseModeField Ljava/lang/String; @@ -11467,6 +11578,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field supportInlineQueriesField Ljava/lang/String; public static final field supportStreamingField Ljava/lang/String; public static final field supportsGuestQueriesField Ljava/lang/String; + public static final field supportsJoinRequestQueriesField Ljava/lang/String; public static final field supportsStreamingField Ljava/lang/String; public static final field switchInlineQueryChosenChatField Ljava/lang/String; public static final field switchInlineQueryCurrentChatField Ljava/lang/String; @@ -11554,6 +11666,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field webAppField Ljava/lang/String; public static final field webAppNameField Ljava/lang/String; public static final field webAppQueryIdField Ljava/lang/String; + public static final field webAppUrlField Ljava/lang/String; public static final field webmStickerField Ljava/lang/String; public static final field widthField Ljava/lang/String; public static final field widthPercentageField Ljava/lang/String; @@ -17807,16 +17920,17 @@ public final class dev/inmo/tgbotapi/types/chat/ChatBackground$Companion { public final class dev/inmo/tgbotapi/types/chat/ChatJoinRequest : dev/inmo/tgbotapi/abstracts/FromUser { public static final field Companion Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest$Companion; - public fun (Ldev/inmo/tgbotapi/types/chat/PublicChat;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/TelegramDate;Ldev/inmo/tgbotapi/types/ChatInviteLink;Ljava/lang/String;)V - public synthetic fun (Ldev/inmo/tgbotapi/types/chat/PublicChat;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/TelegramDate;Ldev/inmo/tgbotapi/types/ChatInviteLink;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/chat/PublicChat;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/TelegramDate;Ldev/inmo/tgbotapi/types/ChatInviteLink;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/chat/PublicChat;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/TelegramDate;Ldev/inmo/tgbotapi/types/ChatInviteLink;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/chat/PublicChat; public final fun component2 ()Ldev/inmo/tgbotapi/types/chat/User; public final fun component3 ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; public final fun component4 ()Ldev/inmo/tgbotapi/types/TelegramDate; public final fun component5 ()Ldev/inmo/tgbotapi/types/ChatInviteLink; public final fun component6 ()Ljava/lang/String; - public final fun copy (Ldev/inmo/tgbotapi/types/chat/PublicChat;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/TelegramDate;Ldev/inmo/tgbotapi/types/ChatInviteLink;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest; - public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest;Ldev/inmo/tgbotapi/types/chat/PublicChat;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/TelegramDate;Ldev/inmo/tgbotapi/types/ChatInviteLink;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest; + public final fun component7-0K4P_8U ()Ljava/lang/String; + public final fun copy--nkamgI (Ldev/inmo/tgbotapi/types/chat/PublicChat;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/TelegramDate;Ldev/inmo/tgbotapi/types/ChatInviteLink;Ljava/lang/String;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest; + public static synthetic fun copy--nkamgI$default (Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest;Ldev/inmo/tgbotapi/types/chat/PublicChat;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/TelegramDate;Ldev/inmo/tgbotapi/types/ChatInviteLink;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest; public fun equals (Ljava/lang/Object;)Z public final fun getBio ()Ljava/lang/String; public final fun getChat ()Ldev/inmo/tgbotapi/types/chat/PublicChat; @@ -17824,6 +17938,7 @@ public final class dev/inmo/tgbotapi/types/chat/ChatJoinRequest : dev/inmo/tgbot public final fun getDateTime-Wg0KzQs ()D public fun getFrom ()Ldev/inmo/tgbotapi/types/chat/User; public final fun getInviteLink ()Ldev/inmo/tgbotapi/types/ChatInviteLink; + public final fun getQueryId-0K4P_8U ()Ljava/lang/String; public fun getUser ()Ldev/inmo/tgbotapi/types/chat/User; public final fun getUserChatId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; public fun hashCode ()I @@ -18389,22 +18504,23 @@ public final class dev/inmo/tgbotapi/types/chat/DirectMessagesTopic$Companion { public final class dev/inmo/tgbotapi/types/chat/ExtendedBot : dev/inmo/tgbotapi/types/chat/Bot, dev/inmo/tgbotapi/types/chat/ExtendedChat { public static final field Companion Ldev/inmo/tgbotapi/types/chat/ExtendedBot$Companion; - public synthetic fun (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IZZZLdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IZZZLdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ZLkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IZZZLdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IZZZLdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ZLkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; - public final fun component10 ()Ldev/inmo/tgbotapi/types/ChatPhoto; - public final fun component11-f3WtEc0 ()I - public final fun component12-mg_h9nU ()Ldev/inmo/tgbotapi/types/colors/ColorId; - public final fun component13-GbmMWyQ ()Ljava/lang/String; + public final fun component10 ()Z + public final fun component11 ()Ldev/inmo/tgbotapi/types/ChatPhoto; + public final fun component12-f3WtEc0 ()I + public final fun component13-mg_h9nU ()Ldev/inmo/tgbotapi/types/colors/ColorId; public final fun component14-GbmMWyQ ()Ljava/lang/String; - public final fun component15 ()I - public final fun component16 ()Z + public final fun component15-GbmMWyQ ()Ljava/lang/String; + public final fun component16 ()I public final fun component17 ()Z public final fun component18 ()Z - public final fun component19 ()Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes; + public final fun component19 ()Z public final fun component2 ()Ljava/lang/String; - public final fun component20 ()Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors; - public final fun component21 ()Z + public final fun component20 ()Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes; + public final fun component21 ()Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors; + public final fun component22 ()Z public final fun component3 ()Ljava/lang/String; public final fun component4-san03mo ()Ljava/lang/String; public final fun component5 ()Z @@ -18412,8 +18528,8 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedBot : dev/inmo/tgbotapi/ public final fun component7 ()Z public final fun component8 ()Z public final fun component9 ()Z - public final fun copy-PETKox0 (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IZZZLdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Z)Ldev/inmo/tgbotapi/types/chat/ExtendedBot; - public static synthetic fun copy-PETKox0$default (Ldev/inmo/tgbotapi/types/chat/ExtendedBot;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IZZZLdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedBot; + public final fun copy-lMQq6mg (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IZZZLdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Z)Ldev/inmo/tgbotapi/types/chat/ExtendedBot; + public static synthetic fun copy-lMQq6mg$default (Ldev/inmo/tgbotapi/types/chat/ExtendedBot;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZZZZZLdev/inmo/tgbotapi/types/ChatPhoto;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;IZZZLdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedBot; public fun equals (Ljava/lang/Object;)Z public fun getAccentColorId-f3WtEc0 ()I public fun getAcceptedGiftTypes ()Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes; @@ -18426,6 +18542,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedBot : dev/inmo/tgbotapi/ public fun getCanReceiveGifts ()Z public fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto; public fun getFirstName ()Ljava/lang/String; + public fun getGuardBot ()Ldev/inmo/tgbotapi/types/chat/User; public final fun getHasMainWebApp ()Z public final fun getHasTopicsEnabled ()Z public fun getId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; @@ -18435,6 +18552,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedBot : dev/inmo/tgbotapi/ public fun getProfileBackgroundCustomEmojiId-GbmMWyQ ()Ljava/lang/String; public final fun getSupportsGuestQueries ()Z public final fun getSupportsInlineQueries ()Z + public final fun getSupportsJoinRequestQueries ()Z public fun getUniqueGiftColors ()Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors; public fun getUsername-san03mo ()Ljava/lang/String; public fun hashCode ()I @@ -18467,6 +18585,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedBusinessChat$Companion { public final class dev/inmo/tgbotapi/types/chat/ExtendedBusinessChat$DefaultImpls { public static fun getCanReceiveGifts (Ldev/inmo/tgbotapi/types/chat/ExtendedBusinessChat;)Z + public static fun getGuardBot (Ldev/inmo/tgbotapi/types/chat/ExtendedBusinessChat;)Ldev/inmo/tgbotapi/types/chat/User; public static fun isDirectMessages (Ldev/inmo/tgbotapi/types/chat/ExtendedBusinessChat;)Z } @@ -18483,6 +18602,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedBusinessChatImpl : dev/i public fun getBackgroundCustomEmojiId-GbmMWyQ ()Ljava/lang/String; public fun getCanReceiveGifts ()Z public fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto; + public fun getGuardBot ()Ldev/inmo/tgbotapi/types/chat/User; public synthetic fun getId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; public fun getId-y8AA8dk ()Lkotlin/Pair; public fun getMaxReactionsCount ()I @@ -18523,13 +18643,14 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedChannelChat$Companion { public final class dev/inmo/tgbotapi/types/chat/ExtendedChannelChat$DefaultImpls { public static fun getCanReceiveGifts (Ldev/inmo/tgbotapi/types/chat/ExtendedChannelChat;)Z + public static fun getGuardBot (Ldev/inmo/tgbotapi/types/chat/ExtendedChannelChat;)Ldev/inmo/tgbotapi/types/chat/User; public static fun isDirectMessages (Ldev/inmo/tgbotapi/types/chat/ExtendedChannelChat;)Z } public final class dev/inmo/tgbotapi/types/chat/ExtendedChannelChatImpl : dev/inmo/tgbotapi/types/chat/ExtendedChannelChat { public static final field Companion Ldev/inmo/tgbotapi/types/chat/ExtendedChannelChatImpl$Companion; - public synthetic fun (JLjava/lang/String;Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (JLjava/lang/String;Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLjava/lang/String;Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLjava/lang/String;Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1-tHkBKVM ()J public final fun component10 ()Z public final fun component11 ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; @@ -18545,6 +18666,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedChannelChatImpl : dev/in public final fun component20 ()Z public final fun component21 ()I public final fun component22 ()Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors; + public final fun component23 ()Ldev/inmo/tgbotapi/types/chat/User; public final fun component3 ()Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes; public final fun component4-san03mo ()Ljava/lang/String; public final fun component5 ()Ljava/util/List; @@ -18552,8 +18674,8 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedChannelChatImpl : dev/in public final fun component7 ()Ljava/lang/String; public final fun component8 ()Ljava/lang/String; public final fun component9 ()Ldev/inmo/tgbotapi/types/message/abstracts/Message; - public final fun copy-3EBDVfg (JLjava/lang/String;Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;)Ldev/inmo/tgbotapi/types/chat/ExtendedChannelChatImpl; - public static synthetic fun copy-3EBDVfg$default (Ldev/inmo/tgbotapi/types/chat/ExtendedChannelChatImpl;JLjava/lang/String;Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedChannelChatImpl; + public final fun copy-vmsuRI8 (JLjava/lang/String;Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;)Ldev/inmo/tgbotapi/types/chat/ExtendedChannelChatImpl; + public static synthetic fun copy-vmsuRI8$default (Ldev/inmo/tgbotapi/types/chat/ExtendedChannelChatImpl;JLjava/lang/String;Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedChannelChatImpl; public fun equals (Ljava/lang/Object;)Z public fun getAccentColorId-f3WtEc0 ()I public fun getAcceptedGiftTypes ()Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes; @@ -18564,6 +18686,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedChannelChatImpl : dev/in public fun getCanSendPaidMedia ()Z public fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto; public fun getDescription ()Ljava/lang/String; + public fun getGuardBot ()Ldev/inmo/tgbotapi/types/chat/User; public synthetic fun getId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; public fun getId-tHkBKVM ()J public fun getInviteLink ()Ljava/lang/String; @@ -18610,13 +18733,14 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesCha public final class dev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChat$DefaultImpls { public static fun getCanReceiveGifts (Ldev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChat;)Z + public static fun getGuardBot (Ldev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChat;)Ldev/inmo/tgbotapi/types/chat/User; public static fun isDirectMessages (Ldev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChat;)Z } public final class dev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChatImpl : dev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChat { public static final field Companion Ldev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChatImpl$Companion; - public synthetic fun (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;IILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;IILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; public final fun component10 ()Ldev/inmo/tgbotapi/types/message/abstracts/Message; public final fun component11-eaLzeK0 ()Ljava/lang/String; @@ -18644,14 +18768,15 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesCha public final fun component31 ()Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes; public final fun component32 ()Ljava/lang/Integer; public final fun component33 ()Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors; + public final fun component34 ()Ldev/inmo/tgbotapi/types/chat/User; public final fun component4-san03mo ()Ljava/lang/String; public final fun component5 ()Ljava/util/List; public final fun component6 ()Ldev/inmo/tgbotapi/types/ChatPhoto; public final fun component7 ()Ldev/inmo/tgbotapi/types/chat/ChatPermissions; public final fun component8 ()Ljava/lang/String; public final fun component9 ()Ljava/lang/String; - public final fun copy-9X6KYPg (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;)Ldev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChatImpl; - public static synthetic fun copy-9X6KYPg$default (Ldev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChatImpl;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;IILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChatImpl; + public final fun copy-uSdo8-E (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;)Ldev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChatImpl; + public static synthetic fun copy-uSdo8-E$default (Ldev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChatImpl;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;IILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesChatImpl; public fun equals (Ljava/lang/Object;)Z public fun getAccentColorId-f3WtEc0 ()I public fun getAcceptedGiftTypes ()Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes; @@ -18664,6 +18789,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedChannelDirectMessagesCha public fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto; public fun getCustomEmojiStickerSetName-eaLzeK0 ()Ljava/lang/String; public fun getDescription ()Ljava/lang/String; + public fun getGuardBot ()Ldev/inmo/tgbotapi/types/chat/User; public fun getId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; public fun getInviteLink ()Ljava/lang/String; public fun getLinkedChannelChatId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; @@ -18714,6 +18840,7 @@ public abstract interface class dev/inmo/tgbotapi/types/chat/ExtendedChat : dev/ public abstract fun getBackgroundCustomEmojiId-GbmMWyQ ()Ljava/lang/String; public fun getCanReceiveGifts ()Z public abstract fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto; + public fun getGuardBot ()Ldev/inmo/tgbotapi/types/chat/User; public abstract fun getMaxReactionsCount ()I public abstract fun getProfileAccentColorId-mg_h9nU ()Ldev/inmo/tgbotapi/types/colors/ColorId; public abstract fun getProfileBackgroundCustomEmojiId-GbmMWyQ ()Ljava/lang/String; @@ -18726,6 +18853,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedChat$Companion { public final class dev/inmo/tgbotapi/types/chat/ExtendedChat$DefaultImpls { public static fun getCanReceiveGifts (Ldev/inmo/tgbotapi/types/chat/ExtendedChat;)Z + public static fun getGuardBot (Ldev/inmo/tgbotapi/types/chat/ExtendedChat;)Ldev/inmo/tgbotapi/types/chat/User; public static fun isDirectMessages (Ldev/inmo/tgbotapi/types/chat/ExtendedChat;)Z } @@ -18764,6 +18892,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedChatWithUsername$Compani public final class dev/inmo/tgbotapi/types/chat/ExtendedChatWithUsername$DefaultImpls { public static fun getCanReceiveGifts (Ldev/inmo/tgbotapi/types/chat/ExtendedChatWithUsername;)Z + public static fun getGuardBot (Ldev/inmo/tgbotapi/types/chat/ExtendedChatWithUsername;)Ldev/inmo/tgbotapi/types/chat/User; public static fun isDirectMessages (Ldev/inmo/tgbotapi/types/chat/ExtendedChatWithUsername;)Z } @@ -18777,13 +18906,14 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedForumChat$Companion { public final class dev/inmo/tgbotapi/types/chat/ExtendedForumChat$DefaultImpls { public static fun getCanReceiveGifts (Ldev/inmo/tgbotapi/types/chat/ExtendedForumChat;)Z + public static fun getGuardBot (Ldev/inmo/tgbotapi/types/chat/ExtendedForumChat;)Ldev/inmo/tgbotapi/types/chat/User; public static fun isDirectMessages (Ldev/inmo/tgbotapi/types/chat/ExtendedForumChat;)Z } public final class dev/inmo/tgbotapi/types/chat/ExtendedForumChatImpl : dev/inmo/tgbotapi/types/chat/ExtendedForumChat { public static final field Companion Ldev/inmo/tgbotapi/types/chat/ExtendedForumChatImpl$Companion; - public synthetic fun (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;IILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; public final fun component10-eaLzeK0 ()Ljava/lang/String; public final fun component11 ()Ljava/lang/Long; @@ -18810,14 +18940,15 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedForumChatImpl : dev/inmo public final fun component30 ()Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes; public final fun component31 ()Ljava/lang/Integer; public final fun component32 ()Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors; + public final fun component33 ()Ldev/inmo/tgbotapi/types/chat/User; public final fun component4 ()Ljava/util/List; public final fun component5 ()Ldev/inmo/tgbotapi/types/ChatPhoto; public final fun component6 ()Ldev/inmo/tgbotapi/types/chat/ChatPermissions; public final fun component7 ()Ljava/lang/String; public final fun component8 ()Ljava/lang/String; public final fun component9 ()Ldev/inmo/tgbotapi/types/message/abstracts/Message; - public final fun copy-UyUmtDw (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;)Ldev/inmo/tgbotapi/types/chat/ExtendedForumChatImpl; - public static synthetic fun copy-UyUmtDw$default (Ldev/inmo/tgbotapi/types/chat/ExtendedForumChatImpl;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedForumChatImpl; + public final fun copy--DA4r_U (Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;)Ldev/inmo/tgbotapi/types/chat/ExtendedForumChatImpl; + public static synthetic fun copy--DA4r_U$default (Ldev/inmo/tgbotapi/types/chat/ExtendedForumChatImpl;Ldev/inmo/tgbotapi/types/IdChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;IILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedForumChatImpl; public fun equals (Ljava/lang/Object;)Z public fun getAccentColorId-f3WtEc0 ()I public fun getAcceptedGiftTypes ()Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes; @@ -18829,6 +18960,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedForumChatImpl : dev/inmo public fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto; public fun getCustomEmojiStickerSetName-eaLzeK0 ()Ljava/lang/String; public fun getDescription ()Ljava/lang/String; + public fun getGuardBot ()Ldev/inmo/tgbotapi/types/chat/User; public fun getId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; public fun getInviteLink ()Ljava/lang/String; public fun getLinkedChannelChatId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; @@ -18883,13 +19015,14 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedGroupChat$Companion { public final class dev/inmo/tgbotapi/types/chat/ExtendedGroupChat$DefaultImpls { public static fun getCanReceiveGifts (Ldev/inmo/tgbotapi/types/chat/ExtendedGroupChat;)Z + public static fun getGuardBot (Ldev/inmo/tgbotapi/types/chat/ExtendedGroupChat;)Ldev/inmo/tgbotapi/types/chat/User; public static fun isDirectMessages (Ldev/inmo/tgbotapi/types/chat/ExtendedGroupChat;)Z } public final class dev/inmo/tgbotapi/types/chat/ExtendedGroupChatImpl : dev/inmo/tgbotapi/types/chat/ExtendedGroupChat { public static final field Companion Ldev/inmo/tgbotapi/types/chat/ExtendedGroupChatImpl$Companion; - public synthetic fun (JLjava/lang/String;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (JLjava/lang/String;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLjava/lang/String;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLjava/lang/String;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1-tHkBKVM ()J public final fun component10-GbmMWyQ ()Ljava/lang/String; public final fun component11 ()Ldev/inmo/tgbotapi/types/TelegramDate; @@ -18903,6 +19036,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedGroupChatImpl : dev/inmo public final fun component19 ()Ljava/lang/Integer; public final fun component2 ()Ljava/lang/String; public final fun component20 ()Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors; + public final fun component21 ()Ldev/inmo/tgbotapi/types/chat/User; public final fun component3 ()Ldev/inmo/tgbotapi/types/ChatPhoto; public final fun component4 ()Ldev/inmo/tgbotapi/types/chat/ChatPermissions; public final fun component5 ()Ljava/lang/String; @@ -18910,8 +19044,8 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedGroupChatImpl : dev/inmo public final fun component7 ()Ldev/inmo/tgbotapi/types/message/abstracts/Message; public final fun component8 ()Z public final fun component9 ()Ljava/util/List; - public final fun copy-aMIY_bc (JLjava/lang/String;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;)Ldev/inmo/tgbotapi/types/chat/ExtendedGroupChatImpl; - public static synthetic fun copy-aMIY_bc$default (Ldev/inmo/tgbotapi/types/chat/ExtendedGroupChatImpl;JLjava/lang/String;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedGroupChatImpl; + public final fun copy-q1FCaLs (JLjava/lang/String;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;)Ldev/inmo/tgbotapi/types/chat/ExtendedGroupChatImpl; + public static synthetic fun copy-q1FCaLs$default (Ldev/inmo/tgbotapi/types/chat/ExtendedGroupChatImpl;JLjava/lang/String;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;ZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedGroupChatImpl; public fun equals (Ljava/lang/Object;)Z public fun getAccentColorId-f3WtEc0 ()I public fun getAcceptedGiftTypes ()Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes; @@ -18920,6 +19054,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedGroupChatImpl : dev/inmo public fun getCanReceiveGifts ()Z public fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto; public fun getDescription ()Ljava/lang/String; + public fun getGuardBot ()Ldev/inmo/tgbotapi/types/chat/User; public synthetic fun getId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; public fun getId-tHkBKVM ()J public fun getInviteLink ()Ljava/lang/String; @@ -18967,6 +19102,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedNonBotChat$Companion { public final class dev/inmo/tgbotapi/types/chat/ExtendedNonBotChat$DefaultImpls { public static fun getCanReceiveGifts (Ldev/inmo/tgbotapi/types/chat/ExtendedNonBotChat;)Z + public static fun getGuardBot (Ldev/inmo/tgbotapi/types/chat/ExtendedNonBotChat;)Ldev/inmo/tgbotapi/types/chat/User; public static fun isDirectMessages (Ldev/inmo/tgbotapi/types/chat/ExtendedNonBotChat;)Z } @@ -18992,6 +19128,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedPrivateChat$Companion { public final class dev/inmo/tgbotapi/types/chat/ExtendedPrivateChat$DefaultImpls { public static fun getAllowCreateUserIdLink (Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChat;)Z public static fun getCanReceiveGifts (Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChat;)Z + public static fun getGuardBot (Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChat;)Ldev/inmo/tgbotapi/types/chat/User; public static fun isDirectMessages (Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateChat;)Z } @@ -19042,6 +19179,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedPrivateChatImpl : dev/in public fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto; public fun getFirstName ()Ljava/lang/String; public fun getFirstProfileAudio ()Ldev/inmo/tgbotapi/types/files/AudioFile; + public fun getGuardBot ()Ldev/inmo/tgbotapi/types/chat/User; public fun getHasPrivateForwards ()Z public fun getHasRestrictedVoiceAndVideoMessages ()Z public fun getId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; @@ -19087,6 +19225,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedPrivateForumChat$Compani public final class dev/inmo/tgbotapi/types/chat/ExtendedPrivateForumChat$DefaultImpls { public static fun getAllowCreateUserIdLink (Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateForumChat;)Z public static fun getCanReceiveGifts (Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateForumChat;)Z + public static fun getGuardBot (Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateForumChat;)Ldev/inmo/tgbotapi/types/chat/User; public static fun isDirectMessages (Ldev/inmo/tgbotapi/types/chat/ExtendedPrivateForumChat;)Z } @@ -19137,6 +19276,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedPrivateForumChatImpl : d public fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto; public fun getFirstName ()Ljava/lang/String; public fun getFirstProfileAudio ()Ldev/inmo/tgbotapi/types/files/AudioFile; + public fun getGuardBot ()Ldev/inmo/tgbotapi/types/chat/User; public fun getHasPrivateForwards ()Z public fun getHasRestrictedVoiceAndVideoMessages ()Z public fun getId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; @@ -19182,6 +19322,7 @@ public abstract interface class dev/inmo/tgbotapi/types/chat/ExtendedPublicChat public final class dev/inmo/tgbotapi/types/chat/ExtendedPublicChat$DefaultImpls { public static fun getCanReceiveGifts (Ldev/inmo/tgbotapi/types/chat/ExtendedPublicChat;)Z + public static fun getGuardBot (Ldev/inmo/tgbotapi/types/chat/ExtendedPublicChat;)Ldev/inmo/tgbotapi/types/chat/User; public static fun isDirectMessages (Ldev/inmo/tgbotapi/types/chat/ExtendedPublicChat;)Z } @@ -19205,13 +19346,14 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedSupergroupChat$Companion public final class dev/inmo/tgbotapi/types/chat/ExtendedSupergroupChat$DefaultImpls { public static fun getCanReceiveGifts (Ldev/inmo/tgbotapi/types/chat/ExtendedSupergroupChat;)Z + public static fun getGuardBot (Ldev/inmo/tgbotapi/types/chat/ExtendedSupergroupChat;)Ldev/inmo/tgbotapi/types/chat/User; public static fun isDirectMessages (Ldev/inmo/tgbotapi/types/chat/ExtendedSupergroupChat;)Z } public final class dev/inmo/tgbotapi/types/chat/ExtendedSupergroupChatImpl : dev/inmo/tgbotapi/types/chat/ExtendedSupergroupChat { public static final field Companion Ldev/inmo/tgbotapi/types/chat/ExtendedSupergroupChatImpl$Companion; - public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;IILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLjava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;Lkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1-tHkBKVM ()J public final fun component10-eaLzeK0 ()Ljava/lang/String; public final fun component11 ()Ljava/lang/Long; @@ -19238,14 +19380,15 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedSupergroupChatImpl : dev public final fun component30 ()Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes; public final fun component31 ()Ljava/lang/Integer; public final fun component32 ()Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors; + public final fun component33 ()Ldev/inmo/tgbotapi/types/chat/User; public final fun component4 ()Ljava/util/List; public final fun component5 ()Ldev/inmo/tgbotapi/types/ChatPhoto; public final fun component6 ()Ldev/inmo/tgbotapi/types/chat/ChatPermissions; public final fun component7 ()Ljava/lang/String; public final fun component8 ()Ljava/lang/String; public final fun component9 ()Ldev/inmo/tgbotapi/types/message/abstracts/Message; - public final fun copy-rfXQ_Kc (JLjava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;)Ldev/inmo/tgbotapi/types/chat/ExtendedSupergroupChatImpl; - public static synthetic fun copy-rfXQ_Kc$default (Ldev/inmo/tgbotapi/types/chat/ExtendedSupergroupChatImpl;JLjava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedSupergroupChatImpl; + public final fun copy-aJDgC-Y (JLjava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;)Ldev/inmo/tgbotapi/types/chat/ExtendedSupergroupChatImpl; + public static synthetic fun copy-aJDgC-Y$default (Ldev/inmo/tgbotapi/types/chat/ExtendedSupergroupChatImpl;JLjava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/ChatPhoto;Ldev/inmo/tgbotapi/types/chat/ChatPermissions;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/abstracts/Message;Ljava/lang/String;Ljava/lang/Long;ZLdev/inmo/tgbotapi/types/IdChatIdentifier;Ldev/inmo/tgbotapi/types/ChatLocation;ZZZZLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILdev/inmo/tgbotapi/types/colors/ColorId;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/String;ILdev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes;Ljava/lang/Integer;Ldev/inmo/tgbotapi/types/gifts/unique/UniqueGiftColors;Ldev/inmo/tgbotapi/types/chat/User;IILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/ExtendedSupergroupChatImpl; public fun equals (Ljava/lang/Object;)Z public fun getAccentColorId-f3WtEc0 ()I public fun getAcceptedGiftTypes ()Ldev/inmo/tgbotapi/types/gifts/AcceptedGiftTypes; @@ -19257,6 +19400,7 @@ public final class dev/inmo/tgbotapi/types/chat/ExtendedSupergroupChatImpl : dev public fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto; public fun getCustomEmojiStickerSetName-eaLzeK0 ()Ljava/lang/String; public fun getDescription ()Ljava/lang/String; + public fun getGuardBot ()Ldev/inmo/tgbotapi/types/chat/User; public synthetic fun getId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; public fun getId-tHkBKVM ()J public fun getInviteLink ()Ljava/lang/String; @@ -19793,6 +19937,7 @@ public final class dev/inmo/tgbotapi/types/chat/UnknownExtendedChat : dev/inmo/t public fun getBackgroundCustomEmojiId-GbmMWyQ ()Ljava/lang/String; public fun getCanReceiveGifts ()Z public fun getChatPhoto ()Ldev/inmo/tgbotapi/types/ChatPhoto; + public fun getGuardBot ()Ldev/inmo/tgbotapi/types/chat/User; public fun getId ()Ldev/inmo/tgbotapi/types/IdChatIdentifier; public fun getMaxReactionsCount ()I public fun getProfileAccentColorId-mg_h9nU ()Ldev/inmo/tgbotapi/types/colors/ColorId; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery.kt new file mode 100644 index 0000000000..157647774b --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery.kt @@ -0,0 +1,58 @@ +package dev.inmo.tgbotapi.requests.chat.invite_links + +import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest +import dev.inmo.tgbotapi.types.ChatJoinRequestQueryId +import dev.inmo.tgbotapi.types.chatJoinRequestQueryIdField +import dev.inmo.tgbotapi.types.resultField +import dev.inmo.tgbotapi.utils.serializers.UnitFromBooleanSerializer +import kotlinx.serialization.DeserializationStrategy +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerializationStrategy + +/** + * Result of an [AnswerChatJoinRequestQuery]. + * + * @see answerChatJoinRequestQuery + */ +@Serializable +enum class ChatJoinRequestQueryResult { + /** + * Allow the user to join the chat. + */ + @SerialName("approve") + Approve, + + /** + * Disallow the user to join the chat. + */ + @SerialName("decline") + Decline, + + /** + * Leave the decision to other administrators. + */ + @SerialName("queue") + Queue +} + +/** + * Use this method to process a received chat join request query. + * + * @see answerChatJoinRequestQuery + */ +@Serializable +data class AnswerChatJoinRequestQuery( + @SerialName(chatJoinRequestQueryIdField) + val chatJoinRequestQueryId: ChatJoinRequestQueryId, + @SerialName(resultField) + val result: ChatJoinRequestQueryResult +) : SimpleRequest { + override val requestSerializer: SerializationStrategy<*> + get() = serializer() + + override val resultDeserializer: DeserializationStrategy + get() = UnitFromBooleanSerializer + + override fun method(): String = "answerChatJoinRequestQuery" +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp.kt new file mode 100644 index 0000000000..c90d7cf515 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/SendChatJoinRequestWebApp.kt @@ -0,0 +1,34 @@ +package dev.inmo.tgbotapi.requests.chat.invite_links + +import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest +import dev.inmo.tgbotapi.types.ChatJoinRequestQueryId +import dev.inmo.tgbotapi.types.chatJoinRequestQueryIdField +import dev.inmo.tgbotapi.types.webAppUrlField +import dev.inmo.tgbotapi.utils.serializers.UnitFromBooleanSerializer +import kotlinx.serialization.DeserializationStrategy +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerializationStrategy + +/** + * Use this method to process a received chat join request query by showing a Mini App to the user before deciding the + * outcome. Call [AnswerChatJoinRequestQuery] to resolve the join request query based on the user interaction with the + * Mini App. + * + * @see sendChatJoinRequestWebApp + */ +@Serializable +data class SendChatJoinRequestWebApp( + @SerialName(chatJoinRequestQueryIdField) + val chatJoinRequestQueryId: ChatJoinRequestQueryId, + @SerialName(webAppUrlField) + val webAppUrl: String +) : SimpleRequest { + override val requestSerializer: SerializationStrategy<*> + get() = serializer() + + override val resultDeserializer: DeserializationStrategy + get() = UnitFromBooleanSerializer + + override fun method(): String = "sendChatJoinRequestWebApp" +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatJoinRequestQueryId.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatJoinRequestQueryId.kt new file mode 100644 index 0000000000..cee30ae4bf --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatJoinRequestQueryId.kt @@ -0,0 +1,19 @@ +package dev.inmo.tgbotapi.types + +import kotlinx.serialization.Serializable +import kotlin.jvm.JvmInline + +/** + * Identifier of a join request query. + * + * @see ChatJoinRequest.query_id + */ +@Serializable +@JvmInline +value class ChatJoinRequestQueryId( + val string: String +) { + override fun toString(): String { + return string + } +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index b338f45c2f..2d6775e714 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -568,6 +568,11 @@ const val payloadField = "payload" const val vcardField = "vcard" const val resultsField = "results" const val resultField = "result" +const val guardBotField = "guard_bot" +const val supportsJoinRequestQueriesField = "supports_join_request_queries" +const val queryIdField = "query_id" +const val chatJoinRequestQueryIdField = "chat_join_request_query_id" +const val webAppUrlField = "web_app_url" const val certificateField = "certificate" const val questionField = "question" const val questionEntitiesField = "question_entities" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ChatJoinRequest.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ChatJoinRequest.kt index 76a62f6ad5..333758dbd1 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ChatJoinRequest.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ChatJoinRequest.kt @@ -24,7 +24,9 @@ data class ChatJoinRequest( @SerialName(inviteLinkField) val inviteLink: ChatInviteLink? = null, @SerialName(bioField) - val bio: String? = null + val bio: String? = null, + @SerialName(queryIdField) + val queryId: ChatJoinRequestQueryId? = null ) : FromUser { @Suppress("unused") val dateTime: DateTime diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt index f144ed7e9b..1bd10dbea9 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt @@ -69,7 +69,9 @@ data class ExtendedChannelChatImpl( @SerialName(maxReactionCountField) override val maxReactionsCount: Int = 3, @SerialName(uniqueGiftColorsField) - override val uniqueGiftColors: UniqueGiftColors? = null + override val uniqueGiftColors: UniqueGiftColors? = null, + @SerialName(guardBotField) + override val guardBot: User? = null ) : ExtendedChannelChat @Serializable @@ -116,7 +118,9 @@ data class ExtendedGroupChatImpl( @SerialName(paidMessageStarCountField) override val paidMessageStarCount: Int? = null, @SerialName(uniqueGiftColorsField) - override val uniqueGiftColors: UniqueGiftColors? = null + override val uniqueGiftColors: UniqueGiftColors? = null, + @SerialName(guardBotField) + override val guardBot: User? = null ) : ExtendedGroupChat @Serializable @@ -316,7 +320,9 @@ data class ExtendedSupergroupChatImpl( @SerialName(paidMessageStarCountField) override val paidMessageStarCount: Int? = null, @SerialName(uniqueGiftColorsField) - override val uniqueGiftColors: UniqueGiftColors? = null + override val uniqueGiftColors: UniqueGiftColors? = null, + @SerialName(guardBotField) + override val guardBot: User? = null ) : ExtendedSupergroupChat @Serializable @@ -390,7 +396,9 @@ data class ExtendedForumChatImpl( @SerialName(paidMessageStarCountField) override val paidMessageStarCount: Int? = null, @SerialName(uniqueGiftColorsField) - override val uniqueGiftColors: UniqueGiftColors? = null + override val uniqueGiftColors: UniqueGiftColors? = null, + @SerialName(guardBotField) + override val guardBot: User? = null ) : ExtendedForumChat @Serializable @@ -467,7 +475,9 @@ data class ExtendedChannelDirectMessagesChatImpl( @SerialName(paidMessageStarCountField) override val paidMessageStarCount: Int? = null, @SerialName(uniqueGiftColorsField) - override val uniqueGiftColors: UniqueGiftColors? = null + override val uniqueGiftColors: UniqueGiftColors? = null, + @SerialName(guardBotField) + override val guardBot: User? = null ) : ExtendedChannelDirectMessagesChat { @OptIn(ExperimentalSerializationApi::class) @SerialName(isDirectMessagesField) @@ -495,6 +505,8 @@ data class ExtendedBot( val supportsInlineQueries: Boolean = false, @SerialName(supportsGuestQueriesField) val supportsGuestQueries: Boolean = false, + @SerialName(supportsJoinRequestQueriesField) + val supportsJoinRequestQueries: Boolean = false, @SerialName(canConnectToBusinessField) val canConnectToBusiness: Boolean = false, @SerialName(photoField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt index ebeb2a03ec..6932b5fdab 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt @@ -27,6 +27,14 @@ sealed interface ExtendedChat : Chat { val uniqueGiftColors: UniqueGiftColors? + /** + * The bot that processes join request queries in the chat. The field is only available to chat administrators. + * + * @see ChatFullInfo.guard_bot + */ + val guardBot: User? + get() = null + @Deprecated( message = "Telegram Bot API v9.0 introduced the new field, `acceptedGiftTypes`, to allow granular" + " control over which types of gifts user, bot, or chat can accept.", diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChatJoinRequest.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChatJoinRequest.kt index 3ddb0f9da1..f15a92fda6 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChatJoinRequest.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChatJoinRequest.kt @@ -1,9 +1,14 @@ package dev.inmo.tgbotapi.extensions.utils.extensions.raw import dev.inmo.tgbotapi.types.ChatInviteLink +import dev.inmo.tgbotapi.types.ChatJoinRequestQueryId import dev.inmo.tgbotapi.types.chat.ChatJoinRequest import dev.inmo.tgbotapi.utils.RiskFeature @RiskFeature(RawFieldsUsageWarning) val ChatJoinRequest.invite_link: ChatInviteLink? get() = inviteLink + +@RiskFeature(RawFieldsUsageWarning) +val ChatJoinRequest.query_id: ChatJoinRequestQueryId? + get() = queryId From 6bdd217530eef63230d5cf324daea09d997adb2b Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 19 Jun 2026 17:32:56 +0600 Subject: [PATCH 04/27] Add Bot API 10.1 Rich Messages support Adds the full Rich Messages type system and methods: - RichText hierarchy: RichTextPlain, RichTextGroup, RichTextEntity and all 24 RichText* entity types, with a recursive serializer handling plain strings, arrays and typed objects - RichBlock hierarchy: all 21 RichBlock* types plus RichBlockCaption, RichBlockTableCell and RichBlockListItem (JsonContentPolymorphic by type) - RichMessage type and RichMessageContent message content; rich_message parsed in RawMessage; RichMessageContentMessage typealias - InputRichMessage (internal constructor + InputRichMessageHTML / InputRichMessageMarkdown factories) and InputRichMessageContent usable as InputMessageContent - SendRichMessage and SendRichMessageDraft requests with API bindings - richMessage parameter on EditChatMessageText - Serialization round-trip test for RichMessage/RichText/RichBlock Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 7 + tgbotapi.api/api/tgbotapi.api.api | 12 + .../extensions/api/send/SendRichMessage.kt | 70 + .../api/send/SendRichMessageDraft.kt | 21 + tgbotapi.core/api/tgbotapi.core.api | 1876 ++++++++++++++++- .../requests/edit/text/EditChatMessageText.kt | 5 +- .../tgbotapi/requests/send/SendRichMessage.kt | 65 + .../requests/send/SendRichMessageDraft.kt | 51 + .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 34 + .../InputRichMessageContent.kt | 17 + .../InputMessageContentSerializer.kt | 1 + .../inmo/tgbotapi/types/message/RawMessage.kt | 7 + .../types/message/content/Abstracts.kt | 1 + .../message/content/RichMessageContent.kt | 44 + .../types/message/content/Typealiases.kt | 2 + .../tgbotapi/types/rich/InputRichMessage.kt | 65 + .../dev/inmo/tgbotapi/types/rich/RichBlock.kt | 50 + .../tgbotapi/types/rich/RichBlockParts.kt | 75 + .../inmo/tgbotapi/types/rich/RichBlocks.kt | 490 +++++ .../inmo/tgbotapi/types/rich/RichMessage.kt | 19 + .../dev/inmo/tgbotapi/types/rich/RichText.kt | 104 + .../tgbotapi/types/rich/RichTextEntities.kt | 531 +++++ .../types/RichMessageSerializationTest.kt | 72 + tgbotapi.utils/api/tgbotapi.utils.api | 154 ++ .../extensions/utils/ClassCastsNew.kt | 359 ++++ 25 files changed, 4130 insertions(+), 2 deletions(-) create mode 100644 tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendRichMessage.kt create mode 100644 tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendRichMessageDraft.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendRichMessage.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendRichMessageDraft.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/InputRichMessage.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlock.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockParts.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichMessage.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt create mode 100644 tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/RichMessageSerializationTest.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 7857b69f55..37541a76a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ **THIS UPDATE CONTAINS SUPPORT OF [TELEGRAM BOTS API 10.1](https://core.telegram.org/bots/api-changelog#june-11-2026)** * `Core`: + * (`Rich Messages`) Added `RichText` (`RichTextPlain`, `RichTextGroup`, `RichTextEntity`) hierarchy with all 24 `RichText*` entity types and a recursive serializer supporting plain strings, arrays and typed objects + * (`Rich Messages`) Added `RichBlock` hierarchy with all 21 `RichBlock*` types plus `RichBlockCaption`, `RichBlockTableCell` and `RichBlockListItem` + * (`Rich Messages`) Added `RichMessage` type and `RichMessageContent` message content; parsed `rich_message` in `RawMessage`; added `RichMessageContentMessage` typealias + * (`Rich Messages`) Added `InputRichMessage` (internal constructor with `InputRichMessageHTML`/`InputRichMessageMarkdown` factories) and `InputRichMessageContent` usable as `InputMessageContent` + * (`Rich Messages`) Added `SendRichMessage` and `SendRichMessageDraft` requests + * (`Rich Messages`) Added `richMessage` parameter to `EditChatMessageText` * (`Polls`) Added `Link` type (`dev.inmo.tgbotapi.types.Link`) implementing `PollMedia`, carrying the `url` of a link attached to a poll option * (`Polls`) Added `link` field parsing to `PollMedia` deserialization/serialization * (`Polls`) Added `TelegramMediaLink` (`InputMediaLink`) implementing `InputPollOptionMedia`, usable as a poll option media @@ -14,6 +20,7 @@ * (`Join Request Queries`) Added `AnswerChatJoinRequestQuery` request and `ChatJoinRequestQueryResult` enum (`Approve`/`Decline`/`Queue`) * (`Join Request Queries`) Added `SendChatJoinRequestWebApp` request * `API`: + * (`Rich Messages`) Added `sendRichMessage` and `sendRichMessageDraft` `TelegramBot` extensions * (`Join Request Queries`) Added `answerChatJoinRequestQuery` and `sendChatJoinRequestWebApp` `TelegramBot` extensions * `Utils`: * (`Join Request Queries`) Added `ChatJoinRequest.query_id` raw accessor diff --git a/tgbotapi.api/api/tgbotapi.api.api b/tgbotapi.api/api/tgbotapi.api.api index 2792404b17..7055f5520f 100644 --- a/tgbotapi.api/api/tgbotapi.api.api +++ b/tgbotapi.api/api/tgbotapi.api.api @@ -1962,6 +1962,18 @@ public final class dev/inmo/tgbotapi/extensions/api/send/SendMessageKt { public static synthetic fun sendTextMessage-kPvWKIg$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ldev/inmo/tgbotapi/types/LinkPreviewOptions;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } +public final class dev/inmo/tgbotapi/extensions/api/send/SendRichMessageDraftKt { + public static final fun sendRichMessageDraft-tvXF6p8 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JJLdev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendRichMessageDraft-tvXF6p8$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JJLdev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; +} + +public final class dev/inmo/tgbotapi/extensions/api/send/SendRichMessageKt { + public static final fun sendRichMessage-mNzvAxs (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun sendRichMessage-mNzvAxs (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;Ldev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendRichMessage-mNzvAxs$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun sendRichMessage-mNzvAxs$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;Ldev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; +} + public final class dev/inmo/tgbotapi/extensions/api/send/SendStaticLocationKt { public static final fun sendLocation-Z2YO6e4 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun sendLocation-Z2YO6e4 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/Chat;DDLdev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendRichMessage.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendRichMessage.kt new file mode 100644 index 0000000000..28601f124b --- /dev/null +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendRichMessage.kt @@ -0,0 +1,70 @@ +package dev.inmo.tgbotapi.extensions.api.send + +import dev.inmo.tgbotapi.bot.TelegramBot +import dev.inmo.tgbotapi.requests.send.SendRichMessage +import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId +import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup +import dev.inmo.tgbotapi.types.chat.Chat +import dev.inmo.tgbotapi.types.message.SuggestedPostParameters +import dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage +import dev.inmo.tgbotapi.types.message.content.RichMessageContent +import dev.inmo.tgbotapi.types.rich.InputRichMessage + +public suspend fun TelegramBot.sendRichMessage( + chatId: ChatIdentifier, + richMessage: InputRichMessage, + threadId: MessageThreadId? = chatId.threadId, + directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId, + businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, + disableNotification: Boolean = false, + protectContent: Boolean = false, + allowPaidBroadcast: Boolean = false, + effectId: EffectId? = null, + suggestedPostParameters: SuggestedPostParameters? = null, + replyParameters: ReplyParameters? = null, + replyMarkup: KeyboardMarkup? = null +): ChatContentMessage = execute( + SendRichMessage( + chatId = chatId, + richMessage = richMessage, + threadId = threadId, + directMessageThreadId = directMessageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + allowPaidBroadcast = allowPaidBroadcast, + effectId = effectId, + suggestedPostParameters = suggestedPostParameters, + replyParameters = replyParameters, + replyMarkup = replyMarkup + ) +) + +public suspend fun TelegramBot.sendRichMessage( + chat: Chat, + richMessage: InputRichMessage, + threadId: MessageThreadId? = chat.id.threadId, + directMessageThreadId: DirectMessageThreadId? = chat.id.directMessageThreadId, + businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId, + disableNotification: Boolean = false, + protectContent: Boolean = false, + allowPaidBroadcast: Boolean = false, + effectId: EffectId? = null, + suggestedPostParameters: SuggestedPostParameters? = null, + replyParameters: ReplyParameters? = null, + replyMarkup: KeyboardMarkup? = null +): ChatContentMessage = sendRichMessage( + chatId = chat.id, + richMessage = richMessage, + threadId = threadId, + directMessageThreadId = directMessageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + allowPaidBroadcast = allowPaidBroadcast, + effectId = effectId, + suggestedPostParameters = suggestedPostParameters, + replyParameters = replyParameters, + replyMarkup = replyMarkup +) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendRichMessageDraft.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendRichMessageDraft.kt new file mode 100644 index 0000000000..5f3c7a0257 --- /dev/null +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendRichMessageDraft.kt @@ -0,0 +1,21 @@ +package dev.inmo.tgbotapi.extensions.api.send + +import dev.inmo.tgbotapi.bot.TelegramBot +import dev.inmo.tgbotapi.requests.send.SendRichMessageDraft +import dev.inmo.tgbotapi.types.ChatId +import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.rich.InputRichMessage + +public suspend fun TelegramBot.sendRichMessageDraft( + chatId: ChatId, + draftId: Long, + richMessage: InputRichMessage, + threadId: MessageThreadId? = null +): Unit = execute( + SendRichMessageDraft( + chatId = chatId, + draftId = draftId, + richMessage = richMessage, + threadId = threadId + ) +) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 7dd9b0e601..5b0ac9c364 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -5150,7 +5150,7 @@ public final class dev/inmo/tgbotapi/requests/edit/reply_markup/EditInlineMessag public final class dev/inmo/tgbotapi/requests/edit/text/EditChatMessageText : dev/inmo/tgbotapi/requests/edit/abstracts/EditChatMessage, dev/inmo/tgbotapi/requests/edit/abstracts/EditLinkPreviewOptionsContainer, dev/inmo/tgbotapi/requests/edit/abstracts/EditReplyMessage, dev/inmo/tgbotapi/requests/edit/abstracts/EditTextChatMessage { public static final field Companion Ldev/inmo/tgbotapi/requests/edit/text/EditChatMessageText$Companion; - public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/LinkPreviewOptions;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/LinkPreviewOptions;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/rich/InputRichMessage;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier; public final fun component2-APLFQys ()J public final fun component3 ()Ljava/lang/String; @@ -5158,6 +5158,7 @@ public final class dev/inmo/tgbotapi/requests/edit/text/EditChatMessageText : de public final fun component6-nXr5wdE ()Ljava/lang/String; public final fun component7 ()Ldev/inmo/tgbotapi/types/LinkPreviewOptions; public final fun component8 ()Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup; + public final fun component9 ()Ldev/inmo/tgbotapi/types/rich/InputRichMessage; public fun equals (Ljava/lang/Object;)Z public fun getBusinessConnectionId-nXr5wdE ()Ljava/lang/String; public fun getChatId ()Ldev/inmo/tgbotapi/types/ChatIdentifier; @@ -5170,6 +5171,7 @@ public final class dev/inmo/tgbotapi/requests/edit/text/EditChatMessageText : de public synthetic fun getReplyMarkup ()Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup; public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy; public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy; + public final fun getRichMessage ()Ldev/inmo/tgbotapi/types/rich/InputRichMessage; public fun getText ()Ljava/lang/String; public fun getTextSources ()Ljava/util/List; public fun hashCode ()I @@ -6690,6 +6692,98 @@ public final class dev/inmo/tgbotapi/requests/send/SendMessageKt { public static synthetic fun SendTextMessage-CbXiHO4$default (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/util/List;Ldev/inmo/tgbotapi/types/LinkPreviewOptions;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/SendTextMessage; } +public final class dev/inmo/tgbotapi/requests/send/SendRichMessage : dev/inmo/tgbotapi/requests/send/abstracts/ReplyingMarkupSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/SendContentMessageRequest { + public static final field Companion Ldev/inmo/tgbotapi/requests/send/SendRichMessage$Companion; + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier; + public final fun component10 ()Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters; + public final fun component11 ()Ldev/inmo/tgbotapi/types/ReplyParameters; + public final fun component12 ()Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup; + public final fun component2 ()Ldev/inmo/tgbotapi/types/rich/InputRichMessage; + public final fun component3-S3HF-10 ()Ldev/inmo/tgbotapi/types/MessageThreadId; + public final fun component4-1osv_qQ ()Ldev/inmo/tgbotapi/types/DirectMessageThreadId; + public final fun component5-nXr5wdE ()Ljava/lang/String; + public final fun component6 ()Z + public final fun component7 ()Z + public final fun component8 ()Z + public final fun component9-Ts0V7ak ()Ljava/lang/String; + public final fun copy-y-pL7hE (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/send/SendRichMessage; + public static synthetic fun copy-y-pL7hE$default (Ldev/inmo/tgbotapi/requests/send/SendRichMessage;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/SendRichMessage; + public fun equals (Ljava/lang/Object;)Z + public fun getAllowPaidBroadcast ()Z + public fun getAllowSendingWithoutReply ()Ljava/lang/Boolean; + public fun getBusinessConnectionId-nXr5wdE ()Ljava/lang/String; + public fun getChatId ()Ldev/inmo/tgbotapi/types/ChatIdentifier; + public fun getDirectMessageThreadId-1osv_qQ ()Ldev/inmo/tgbotapi/types/DirectMessageThreadId; + public fun getDisableNotification ()Z + public fun getEffectId-Ts0V7ak ()Ljava/lang/String; + public fun getProtectContent ()Z + public fun getReplyMarkup ()Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup; + public fun getReplyParameters ()Ldev/inmo/tgbotapi/types/ReplyParameters; + public fun getReplyToMessageId-CigXjpw ()Ldev/inmo/tgbotapi/types/MessageId; + public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy; + public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy; + public final fun getRichMessage ()Ldev/inmo/tgbotapi/types/rich/InputRichMessage; + public fun getSuggestedPostParameters ()Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters; + public fun getThreadId-S3HF-10 ()Ldev/inmo/tgbotapi/types/MessageThreadId; + public fun hashCode ()I + public fun method ()Ljava/lang/String; + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/requests/send/SendRichMessage$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/requests/send/SendRichMessage$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/send/SendRichMessage; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/send/SendRichMessage;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/requests/send/SendRichMessage$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/requests/send/SendRichMessageDraft : dev/inmo/tgbotapi/requests/abstracts/SimpleRequest { + public static final field Companion Ldev/inmo/tgbotapi/requests/send/SendRichMessageDraft$Companion; + public synthetic fun (JJLdev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JJLdev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1-tHkBKVM ()J + public final fun component2 ()J + public final fun component3 ()Ldev/inmo/tgbotapi/types/rich/InputRichMessage; + public final fun component4-S3HF-10 ()Ldev/inmo/tgbotapi/types/MessageThreadId; + public final fun copy-fgQnCZU (JJLdev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;)Ldev/inmo/tgbotapi/requests/send/SendRichMessageDraft; + public static synthetic fun copy-fgQnCZU$default (Ldev/inmo/tgbotapi/requests/send/SendRichMessageDraft;JJLdev/inmo/tgbotapi/types/rich/InputRichMessage;Ldev/inmo/tgbotapi/types/MessageThreadId;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/SendRichMessageDraft; + public fun equals (Ljava/lang/Object;)Z + public final fun getChatId-tHkBKVM ()J + public final fun getDraftId ()J + public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy; + public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy; + public final fun getRichMessage ()Ldev/inmo/tgbotapi/types/rich/InputRichMessage; + public final fun getThreadId-S3HF-10 ()Ldev/inmo/tgbotapi/types/MessageThreadId; + public fun hashCode ()I + public fun method ()Ljava/lang/String; + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/requests/send/SendRichMessageDraft$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/requests/send/SendRichMessageDraft$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/send/SendRichMessageDraft; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/send/SendRichMessageDraft;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/requests/send/SendRichMessageDraft$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/requests/send/SendTextMessage : dev/inmo/tgbotapi/abstracts/types/LinkPreviewOptionsContainer, dev/inmo/tgbotapi/requests/send/abstracts/ReplyingMarkupSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/SendContentMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/TextableSendMessageRequest { public static final field Companion Ldev/inmo/tgbotapi/requests/send/SendTextMessage$Companion; public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;Ldev/inmo/tgbotapi/types/LinkPreviewOptions;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -10997,6 +11091,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field affiliateChatField Ljava/lang/String; public static final field affiliateField Ljava/lang/String; public static final field affiliateUserField Ljava/lang/String; + public static final field alignField Ljava/lang/String; public static final field allowAddingOptionsField Ljava/lang/String; public static final field allowBotChatsField Ljava/lang/String; public static final field allowChannelChatsField Ljava/lang/String; @@ -11009,7 +11104,9 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field allowsMultipleAnswersField Ljava/lang/String; public static final field allowsRevotingField Ljava/lang/String; public static final field allowsWriteToPMField Ljava/lang/String; + public static final field alternativeTextField Ljava/lang/String; public static final field amountField Ljava/lang/String; + public static final field anchorNameField Ljava/lang/String; public static final field animationField Ljava/lang/String; public static final field areasField Ljava/lang/String; public static final field audioDurationField Ljava/lang/String; @@ -11023,6 +11120,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field backgroundColorField Ljava/lang/String; public static final field backgroundCustomEmojiIdField Ljava/lang/String; public static final field backgroundField Ljava/lang/String; + public static final field bankCardNumberField Ljava/lang/String; public static final field bankStatementField Ljava/lang/String; public static final field baseColorField Ljava/lang/String; public static final field baseNameField Ljava/lang/String; @@ -11030,6 +11128,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field bigFileUniqueIdField Ljava/lang/String; public static final field bioField Ljava/lang/String; public static final field birthdateField Ljava/lang/String; + public static final field blocksField Ljava/lang/String; public static final field boostCountField Ljava/lang/String; public static final field boostField Ljava/lang/String; public static final field boostIdField Ljava/lang/String; @@ -11106,6 +11205,8 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field canViewGiftsAndStarsField Ljava/lang/String; public static final field captionEntitiesField Ljava/lang/String; public static final field captionField Ljava/lang/String; + public static final field cashtagField Ljava/lang/String; + public static final field cellsField Ljava/lang/String; public static final field centerColorField Ljava/lang/String; public static final field certificateField Ljava/lang/String; public static final field chatField Ljava/lang/String; @@ -11126,6 +11227,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field codecField Ljava/lang/String; public static final field colorField Ljava/lang/String; public static final field colorsField Ljava/lang/String; + public static final field colspanField Ljava/lang/String; public static final field commentField Ljava/lang/String; public static final field commissionPerMilleField Ljava/lang/String; public static final field completedByChatField Ljava/lang/String; @@ -11146,6 +11248,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field createsJoinRequestField Ljava/lang/String; public static final field creatorField Ljava/lang/String; public static final field credentialsField Ljava/lang/String; + public static final field creditField Ljava/lang/String; public static final field currencyField Ljava/lang/String; public static final field currentLevelRatingField Ljava/lang/String; public static final field customDescriptionField Ljava/lang/String; @@ -11160,6 +11263,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field dataField Ljava/lang/String; public static final field dataHashField Ljava/lang/String; public static final field dateField Ljava/lang/String; + public static final field dateTimeFormatField Ljava/lang/String; public static final field dayField Ljava/lang/String; public static final field descriptionEntitiesField Ljava/lang/String; public static final field descriptionField Ljava/lang/String; @@ -11177,6 +11281,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field dropPendingUpdatesField Ljava/lang/String; public static final field durationField Ljava/lang/String; public static final field edgeColorField Ljava/lang/String; + public static final field emailAddressField Ljava/lang/String; public static final field emailField Ljava/lang/String; public static final field emojiField Ljava/lang/String; public static final field emojiListField Ljava/lang/String; @@ -11200,6 +11305,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field explanationField Ljava/lang/String; public static final field explanationMediaField Ljava/lang/String; public static final field explanationParseModeField Ljava/lang/String; + public static final field expressionField Ljava/lang/String; public static final field fieldNameField Ljava/lang/String; public static final field fileDateField Ljava/lang/String; public static final field fileField Ljava/lang/String; @@ -11245,6 +11351,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field guardBotField Ljava/lang/String; public static final field guestQueryIdField Ljava/lang/String; public static final field hasAggressiveAntiSpamEnabledField Ljava/lang/String; + public static final field hasCheckboxField Ljava/lang/String; public static final field hasColorsField Ljava/lang/String; public static final field hasCustomCertificateField Ljava/lang/String; public static final field hasHiddenMembersField Ljava/lang/String; @@ -11256,12 +11363,14 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field hasTopicsEnabledField Ljava/lang/String; public static final field hasVisibleHistoryField Ljava/lang/String; public static final field hashField Ljava/lang/String; + public static final field hashtagField Ljava/lang/String; public static final field headingField Ljava/lang/String; public static final field heightField Ljava/lang/String; public static final field heightPercentageField Ljava/lang/String; public static final field hideResultsUntilClosesField Ljava/lang/String; public static final field hideUrlField Ljava/lang/String; public static final field horizontalAccuracyField Ljava/lang/String; + public static final field htmlField Ljava/lang/String; public static final field iconColorField Ljava/lang/String; public static final field iconCustomEmojiIdField Ljava/lang/String; public static final field idField Ljava/lang/String; @@ -11282,9 +11391,11 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field isAnonymousField Ljava/lang/String; public static final field isBigField Ljava/lang/String; public static final field isBlurredField Ljava/lang/String; + public static final field isBorderedField Ljava/lang/String; public static final field isBotField Ljava/lang/String; public static final field isBurnedField Ljava/lang/String; public static final field isCanceledField Ljava/lang/String; + public static final field isCheckedField Ljava/lang/String; public static final field isClosedField Ljava/lang/String; public static final field isDarkField Ljava/lang/String; public static final field isDirectMessagesField Ljava/lang/String; @@ -11294,11 +11405,13 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field isFlippedField Ljava/lang/String; public static final field isForumField Ljava/lang/String; public static final field isFromBlockchainField Ljava/lang/String; + public static final field isHeaderField Ljava/lang/String; public static final field isInvertedField Ljava/lang/String; public static final field isManualField Ljava/lang/String; public static final field isMemberField Ljava/lang/String; public static final field isMovingField Ljava/lang/String; public static final field isNameImplicitField Ljava/lang/String; + public static final field isOpenField Ljava/lang/String; public static final field isPaidPostField Ljava/lang/String; public static final field isPersistentField Ljava/lang/String; public static final field isPersonalField Ljava/lang/String; @@ -11308,17 +11421,21 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field isPublicField Ljava/lang/String; public static final field isRecurringField Ljava/lang/String; public static final field isRevokedField Ljava/lang/String; + public static final field isRtlField Ljava/lang/String; public static final field isSavedField Ljava/lang/String; public static final field isStarGiveawayField Ljava/lang/String; + public static final field isStripedField Ljava/lang/String; public static final field isUnclaimedField Ljava/lang/String; public static final field isUpgradeSeparateField Ljava/lang/String; public static final field isVideoField Ljava/lang/String; + public static final field itemsField Ljava/lang/String; public static final field joinByRequestField Ljava/lang/String; public static final field joinToSendMessagesField Ljava/lang/String; public static final field keepOriginalDetailsField Ljava/lang/String; public static final field keywordsField Ljava/lang/String; public static final field labelField Ljava/lang/String; public static final field languageCodeField Ljava/lang/String; + public static final field languageField Ljava/lang/String; public static final field lastErrorDateField Ljava/lang/String; public static final field lastErrorMessageField Ljava/lang/String; public static final field lastNameField Ljava/lang/String; @@ -11343,6 +11460,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field loginUrlField Ljava/lang/String; public static final field longitudeField Ljava/lang/String; public static final field mainFrameTimestampField Ljava/lang/String; + public static final field markdownField Ljava/lang/String; public static final field markedAsDoneTaskIdsField Ljava/lang/String; public static final field markedAsNotDoneTaskIdsField Ljava/lang/String; public static final field maskPositionField Ljava/lang/String; @@ -11483,6 +11601,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field reactionsField Ljava/lang/String; public static final field reasonField Ljava/lang/String; public static final field receiverField Ljava/lang/String; + public static final field referenceNameField Ljava/lang/String; public static final field regularPollType Ljava/lang/String; public static final field remainingCountField Ljava/lang/String; public static final field removeCaptionField Ljava/lang/String; @@ -11516,8 +11635,10 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field returnBotsField Ljava/lang/String; public static final field reverseSideField Ljava/lang/String; public static final field revokeMessagesField Ljava/lang/String; + public static final field richMessageField Ljava/lang/String; public static final field rightsField Ljava/lang/String; public static final field rotationAngleField Ljava/lang/String; + public static final field rowspanField Ljava/lang/String; public static final field scaleField Ljava/lang/String; public static final field scopeField Ljava/lang/String; public static final field scoreField Ljava/lang/String; @@ -11544,6 +11665,8 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field showCaptionAboveMediaField Ljava/lang/String; public static final field showGiftButtonField Ljava/lang/String; public static final field shuffleOptionsField Ljava/lang/String; + public static final field sizeField Ljava/lang/String; + public static final field skipEntityDetectionField Ljava/lang/String; public static final field slowModeDelayField Ljava/lang/String; public static final field smallFileIdField Ljava/lang/String; public static final field smallFileUniqueIdField Ljava/lang/String; @@ -11575,6 +11698,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field suggestedPostParametersField Ljava/lang/String; public static final field suggestedTipAmountsField Ljava/lang/String; public static final field suggestedUsernameField Ljava/lang/String; + public static final field summaryField Ljava/lang/String; public static final field supportInlineQueriesField Ljava/lang/String; public static final field supportStreamingField Ljava/lang/String; public static final field supportsGuestQueriesField Ljava/lang/String; @@ -11625,6 +11749,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field uniqueGiftNumberField Ljava/lang/String; public static final field uniqueGiftVariantCountField Ljava/lang/String; public static final field uniqueGiftsField Ljava/lang/String; + public static final field unixTimeField Ljava/lang/String; public static final field unlimitedGiftsField Ljava/lang/String; public static final field unrestrictBoostsCountField Ljava/lang/String; public static final field unspecifiedField Ljava/lang/String; @@ -11643,6 +11768,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field usernameField Ljava/lang/String; public static final field usersField Ljava/lang/String; public static final field utilityBillField Ljava/lang/String; + public static final field valignField Ljava/lang/String; public static final field valueField Ljava/lang/String; public static final field vcardField Ljava/lang/String; public static final field venueField Ljava/lang/String; @@ -11659,6 +11785,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field voiceDurationField Ljava/lang/String; public static final field voiceField Ljava/lang/String; public static final field voiceFileIdField Ljava/lang/String; + public static final field voiceNoteField Ljava/lang/String; public static final field voiceUrlField Ljava/lang/String; public static final field voterChatField Ljava/lang/String; public static final field votesCountField Ljava/lang/String; @@ -11679,6 +11806,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field yPercentageField Ljava/lang/String; public static final field yShiftField Ljava/lang/String; public static final field yearField Ljava/lang/String; + public static final field zoomField Ljava/lang/String; public static final fun getAllowedConnectionsLength ()Lkotlin/ranges/IntRange; public static final fun getAllowedConnectionsWithLocalServerLength ()Lkotlin/ranges/IntRange; public static final fun getAllowedToSavePreparedKeyboardButtons ()Ljava/util/Set; @@ -13628,6 +13756,33 @@ public final class dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/Inp public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent : dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent { + public static final field Companion Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent$Companion; + public fun (Ldev/inmo/tgbotapi/types/rich/InputRichMessage;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/InputRichMessage; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/InputRichMessage;)Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent;Ldev/inmo/tgbotapi/types/rich/InputRichMessage;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent; + public fun equals (Ljava/lang/Object;)Z + public final fun getRichMessage ()Ldev/inmo/tgbotapi/types/rich/InputRichMessage; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputTextMessageContent : dev/inmo/tgbotapi/abstracts/TextedOutput, dev/inmo/tgbotapi/abstracts/types/LinkPreviewOptionsContainer, dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent { public static final field Companion Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputTextMessageContent$Companion; public final fun component1 ()Ljava/lang/String; @@ -29004,6 +29159,35 @@ public final class dev/inmo/tgbotapi/types/message/content/ResendableContent$Def public static synthetic fun createResend-eUDkMIk$default (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/abstracts/Request; } +public final class dev/inmo/tgbotapi/types/message/content/RichMessageContent : dev/inmo/tgbotapi/types/message/content/MessageContent { + public static final field Companion Ldev/inmo/tgbotapi/types/message/content/RichMessageContent$Companion; + public synthetic fun (Ldev/inmo/tgbotapi/types/chat/Chat;JLdev/inmo/tgbotapi/types/rich/RichMessage;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component3 ()Ldev/inmo/tgbotapi/types/rich/RichMessage; + public final fun copy-HkzWJnM (Ldev/inmo/tgbotapi/types/chat/Chat;JLdev/inmo/tgbotapi/types/rich/RichMessage;)Ldev/inmo/tgbotapi/types/message/content/RichMessageContent; + public static synthetic fun copy-HkzWJnM$default (Ldev/inmo/tgbotapi/types/message/content/RichMessageContent;Ldev/inmo/tgbotapi/types/chat/Chat;JLdev/inmo/tgbotapi/types/rich/RichMessage;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/message/content/RichMessageContent; + public fun createResend-QiyHKDI (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/abstracts/Request; + public fun createResend-eUDkMIk (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/abstracts/Request; + public fun equals (Ljava/lang/Object;)Z + public final fun getRichMessage ()Ldev/inmo/tgbotapi/types/rich/RichMessage; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/message/content/RichMessageContent$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/message/content/RichMessageContent$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/message/content/RichMessageContent; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/message/content/RichMessageContent;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/message/content/RichMessageContent$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public abstract interface class dev/inmo/tgbotapi/types/message/content/SpoilerableMediaContent : dev/inmo/tgbotapi/abstracts/SpoilerableData, dev/inmo/tgbotapi/types/message/content/MediaContent { } @@ -34203,6 +34387,1696 @@ public final class dev/inmo/tgbotapi/types/request/UsersShared$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/types/rich/InputRichMessage { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/InputRichMessage$Companion; + public fun ()V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()Ljava/lang/Boolean; + public final fun component4 ()Ljava/lang/Boolean; + public fun equals (Ljava/lang/Object;)Z + public final fun getHtml ()Ljava/lang/String; + public final fun getMarkdown ()Ljava/lang/String; + public final fun getSkipEntityDetection ()Ljava/lang/Boolean; + public fun hashCode ()I + public final fun isRtl ()Ljava/lang/Boolean; + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/InputRichMessage$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/InputRichMessage$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/InputRichMessage; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/InputRichMessage;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/InputRichMessage$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/InputRichMessageKt { + public static final fun InputRichMessageHTML (Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;)Ldev/inmo/tgbotapi/types/rich/InputRichMessage; + public static synthetic fun InputRichMessageHTML$default (Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/InputRichMessage; + public static final fun InputRichMessageMarkdown (Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;)Ldev/inmo/tgbotapi/types/rich/InputRichMessage; + public static synthetic fun InputRichMessageMarkdown$default (Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/InputRichMessage; +} + +public abstract interface class dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlock$Companion; + public abstract fun getType ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlock$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockAnchor : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockAnchor$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichBlockAnchor; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockAnchor;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockAnchor; + public fun equals (Ljava/lang/Object;)Z + public final fun getName ()Ljava/lang/String; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockAnchor$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockAnchor$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockAnchor; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockAnchor;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockAnchor$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockAnimation : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockAnimation$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/files/AnimationFile; + public final fun component2 ()Ljava/lang/Boolean; + public final fun component3 ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public final fun copy (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ldev/inmo/tgbotapi/types/rich/RichBlockAnimation; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockAnimation;Ldev/inmo/tgbotapi/types/files/AnimationFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockAnimation; + public fun equals (Ljava/lang/Object;)Z + public final fun getAnimation ()Ldev/inmo/tgbotapi/types/files/AnimationFile; + public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public final fun getHasSpoiler ()Ljava/lang/Boolean; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockAnimation$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockAnimation$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockAnimation; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockAnimation;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockAnimation$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockAudio : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockAudio$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/files/AudioFile; + public final fun component2 ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public final fun copy (Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ldev/inmo/tgbotapi/types/rich/RichBlockAudio; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockAudio;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockAudio; + public fun equals (Ljava/lang/Object;)Z + public final fun getAudio ()Ldev/inmo/tgbotapi/types/files/AudioFile; + public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockAudio$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockAudio$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockAudio; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockAudio;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockAudio$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichText;)V + public synthetic fun (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichText;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/util/List; + public final fun component2 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation;Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation; + public fun equals (Ljava/lang/Object;)Z + public final fun getBlocks ()Ljava/util/List; + public final fun getCredit ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockCaption { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockCaption$Companion; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/rich/RichText;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/rich/RichText;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun equals (Ljava/lang/Object;)Z + public final fun getCredit ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockCaption$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockCaption$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockCaption$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockCollage : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockCollage$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)V + public synthetic fun (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/util/List; + public final fun component2 ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public final fun copy (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ldev/inmo/tgbotapi/types/rich/RichBlockCollage; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockCollage;Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockCollage; + public fun equals (Ljava/lang/Object;)Z + public final fun getBlocks ()Ljava/util/List; + public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockCollage$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockCollage$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockCollage; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockCollage;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockCollage$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockDetails : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockDetails$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/util/List;Ljava/lang/Boolean;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/util/List;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Ljava/lang/Boolean; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/util/List;Ljava/lang/Boolean;)Ldev/inmo/tgbotapi/types/rich/RichBlockDetails; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockDetails;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/util/List;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockDetails; + public fun equals (Ljava/lang/Object;)Z + public final fun getBlocks ()Ljava/util/List; + public final fun getSummary ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public final fun isOpen ()Ljava/lang/Boolean; + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockDetails$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockDetails$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockDetails; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockDetails;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockDetails$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockDivider : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockDivider$Companion; + public static final field TYPE Ljava/lang/String; + public fun ()V + public fun equals (Ljava/lang/Object;)Z + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockDivider$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockDivider$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockDivider; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockDivider;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockDivider$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockFooter : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockFooter$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichBlockFooter; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockFooter;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockFooter; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockFooter$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockFooter$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockFooter; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockFooter;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockFooter$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockList : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockList$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ljava/util/List;)V + public final fun component1 ()Ljava/util/List; + public final fun copy (Ljava/util/List;)Ldev/inmo/tgbotapi/types/rich/RichBlockList; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockList;Ljava/util/List;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockList; + public fun equals (Ljava/lang/Object;)Z + public final fun getItems ()Ljava/util/List; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockList$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockList$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockList; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockList;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockList$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockListItem { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockListItem$Companion; + public fun (Ljava/lang/String;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;)V + public synthetic fun (Ljava/lang/String;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Ljava/lang/Boolean; + public final fun component4 ()Ljava/lang/Boolean; + public final fun component5 ()Ljava/lang/Integer; + public final fun component6 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichBlockListItem; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockListItem;Ljava/lang/String;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockListItem; + public fun equals (Ljava/lang/Object;)Z + public final fun getBlocks ()Ljava/util/List; + public final fun getHasCheckbox ()Ljava/lang/Boolean; + public final fun getLabel ()Ljava/lang/String; + public final fun getLabelType ()Ljava/lang/String; + public final fun getValue ()Ljava/lang/Integer; + public fun hashCode ()I + public final fun isChecked ()Ljava/lang/Boolean; + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockListItem$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockListItem$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockListItem; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockListItem;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockListItem$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockMap : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockMap$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/location/StaticLocation;IIILdev/inmo/tgbotapi/types/rich/RichBlockCaption;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/location/StaticLocation;IIILdev/inmo/tgbotapi/types/rich/RichBlockCaption;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/location/StaticLocation; + public final fun component2 ()I + public final fun component3 ()I + public final fun component4 ()I + public final fun component5 ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public final fun copy (Ldev/inmo/tgbotapi/types/location/StaticLocation;IIILdev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ldev/inmo/tgbotapi/types/rich/RichBlockMap; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockMap;Ldev/inmo/tgbotapi/types/location/StaticLocation;IIILdev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockMap; + public fun equals (Ljava/lang/Object;)Z + public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public final fun getHeight ()I + public final fun getLocation ()Ldev/inmo/tgbotapi/types/location/StaticLocation; + public fun getType ()Ljava/lang/String; + public final fun getWidth ()I + public final fun getZoom ()I + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockMap$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockMap$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockMap; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockMap;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockMap$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression; + public fun equals (Ljava/lang/Object;)Z + public final fun getExpression ()Ljava/lang/String; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockParagraph : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockParagraph$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockParagraph$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockPhoto : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto$Companion; + public static final field TYPE Ljava/lang/String; + public synthetic fun (Ljava/util/List;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ljava/util/List;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1-bGlShw4 ()Ljava/util/List; + public final fun component2 ()Ljava/lang/Boolean; + public final fun component3 ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public final fun copy-OKnyJrA (Ljava/util/List;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto; + public static synthetic fun copy-OKnyJrA$default (Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto;Ljava/util/List;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto; + public fun equals (Ljava/lang/Object;)Z + public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public final fun getHasSpoiler ()Ljava/lang/Boolean; + public final fun getPhoto-bGlShw4 ()Ljava/util/List; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockPhoto$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockPhoto$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockPreformatted : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockPreformatted$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichBlockPreformatted; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockPreformatted;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockPreformatted; + public fun equals (Ljava/lang/Object;)Z + public final fun getLanguage ()Ljava/lang/String; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockPreformatted$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockPreformatted$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockPreformatted; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockPreformatted;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockPreformatted$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockPullQuotation : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockPullQuotation$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/rich/RichText;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/rich/RichText;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichBlockPullQuotation; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockPullQuotation;Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockPullQuotation; + public fun equals (Ljava/lang/Object;)Z + public final fun getCredit ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockPullQuotation$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockPullQuotation$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockPullQuotation; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockPullQuotation;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockPullQuotation$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockSectionHeading : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;I)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()I + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;I)Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading;Ldev/inmo/tgbotapi/types/rich/RichText;IILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading; + public fun equals (Ljava/lang/Object;)Z + public final fun getSize ()I + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockSectionHeading$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockSectionHeading$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockSerializer : kotlinx/serialization/json/JsonContentPolymorphicSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockSlideshow : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockSlideshow$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)V + public synthetic fun (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/util/List; + public final fun component2 ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public final fun copy (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ldev/inmo/tgbotapi/types/rich/RichBlockSlideshow; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockSlideshow;Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockSlideshow; + public fun equals (Ljava/lang/Object;)Z + public final fun getBlocks ()Ljava/util/List; + public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockSlideshow$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockSlideshow$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockSlideshow; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockSlideshow;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockSlideshow$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockTable : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockTable$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichText;)V + public synthetic fun (Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichText;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/util/List; + public final fun component2 ()Ljava/lang/Boolean; + public final fun component3 ()Ljava/lang/Boolean; + public final fun component4 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichBlockTable; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockTable;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockTable; + public fun equals (Ljava/lang/Object;)Z + public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun getCells ()Ljava/util/List; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public final fun isBordered ()Ljava/lang/Boolean; + public final fun isStriped ()Ljava/lang/Boolean; + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockTable$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockTable$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockTable; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockTable;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockTable$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockTableCell { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockTableCell$Companion; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/lang/Boolean; + public final fun component3 ()Ljava/lang/Integer; + public final fun component4 ()Ljava/lang/Integer; + public final fun component5 ()Ljava/lang/String; + public final fun component6 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichBlockTableCell; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockTableCell;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockTableCell; + public fun equals (Ljava/lang/Object;)Z + public final fun getAlign ()Ljava/lang/String; + public final fun getColspan ()Ljava/lang/Integer; + public final fun getRowspan ()Ljava/lang/Integer; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun getValign ()Ljava/lang/String; + public fun hashCode ()I + public final fun isHeader ()Ljava/lang/Boolean; + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockTableCell$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockTableCell$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockTableCell; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockTableCell;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockTableCell$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockThinking : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockThinking$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichBlockThinking; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockThinking;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockThinking; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockThinking$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockThinking$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockThinking; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockThinking;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockThinking$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockVideo : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockVideo$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/files/VideoFile; + public final fun component2 ()Ljava/lang/Boolean; + public final fun component3 ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public final fun copy (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ldev/inmo/tgbotapi/types/rich/RichBlockVideo; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockVideo;Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockVideo; + public fun equals (Ljava/lang/Object;)Z + public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public final fun getHasSpoiler ()Ljava/lang/Boolean; + public fun getType ()Ljava/lang/String; + public final fun getVideo ()Ldev/inmo/tgbotapi/types/files/VideoFile; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockVideo$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockVideo$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockVideo; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockVideo;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockVideo$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockVoiceNote : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/files/VoiceFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/files/VoiceFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/files/VoiceFile; + public final fun component2 ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public final fun copy (Ldev/inmo/tgbotapi/types/files/VoiceFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote;Ldev/inmo/tgbotapi/types/files/VoiceFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote; + public fun equals (Ljava/lang/Object;)Z + public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun getType ()Ljava/lang/String; + public final fun getVoiceNote ()Ldev/inmo/tgbotapi/types/files/VoiceFile; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockVoiceNote$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockVoiceNote$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichMessage { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichMessage$Companion; + public fun (Ljava/util/List;Ljava/lang/Boolean;)V + public synthetic fun (Ljava/util/List;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/util/List; + public final fun component2 ()Ljava/lang/Boolean; + public final fun copy (Ljava/util/List;Ljava/lang/Boolean;)Ldev/inmo/tgbotapi/types/rich/RichMessage; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichMessage;Ljava/util/List;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichMessage; + public fun equals (Ljava/lang/Object;)Z + public final fun getBlocks ()Ljava/util/List; + public fun hashCode ()I + public final fun isRtl ()Ljava/lang/Boolean; + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichMessage$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichMessage$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichMessage; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichMessage;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichMessage$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public abstract interface class dev/inmo/tgbotapi/types/rich/RichText { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichText$Companion; +} + +public final class dev/inmo/tgbotapi/types/rich/RichText$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextAnchor : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextAnchor$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextAnchor; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextAnchor;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextAnchor; + public fun equals (Ljava/lang/Object;)Z + public final fun getName ()Ljava/lang/String; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextAnchor$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextAnchor$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextAnchor; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextAnchor;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextAnchor$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextAnchorLink : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextAnchorLink$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextAnchorLink; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextAnchorLink;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextAnchorLink; + public fun equals (Ljava/lang/Object;)Z + public final fun getAnchorName ()Ljava/lang/String; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextAnchorLink$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextAnchorLink$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextAnchorLink; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextAnchorLink;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextAnchorLink$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextBankCardNumber : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextBankCardNumber$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextBankCardNumber; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextBankCardNumber;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextBankCardNumber; + public fun equals (Ljava/lang/Object;)Z + public final fun getBankCardNumber ()Ljava/lang/String; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextBankCardNumber$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextBankCardNumber$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextBankCardNumber; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextBankCardNumber;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextBankCardNumber$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextBold : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextBold$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextBold; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextBold;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextBold; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextBold$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextBold$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextBold; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextBold;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextBold$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextBotCommand : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextBotCommand$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextBotCommand; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextBotCommand;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextBotCommand; + public fun equals (Ljava/lang/Object;)Z + public final fun getBotCommand ()Ljava/lang/String; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextBotCommand$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextBotCommand$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextBotCommand; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextBotCommand;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextBotCommand$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextCashtag : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextCashtag$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextCashtag; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextCashtag;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextCashtag; + public fun equals (Ljava/lang/Object;)Z + public final fun getCashtag ()Ljava/lang/String; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextCashtag$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextCashtag$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextCashtag; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextCashtag;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextCashtag$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextCode : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextCode$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextCode; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextCode;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextCode; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextCode$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextCode$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextCode; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextCode;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextCode$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextCustomEmoji : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextCustomEmoji$Companion; + public static final field TYPE Ljava/lang/String; + public synthetic fun (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1-dDnjveI ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun copy-R1fjqgo (Ljava/lang/String;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextCustomEmoji; + public static synthetic fun copy-R1fjqgo$default (Ldev/inmo/tgbotapi/types/rich/RichTextCustomEmoji;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextCustomEmoji; + public fun equals (Ljava/lang/Object;)Z + public final fun getAlternativeText ()Ljava/lang/String; + public final fun getCustomEmojiId-dDnjveI ()Ljava/lang/String; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextCustomEmoji$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextCustomEmoji$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextCustomEmoji; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextCustomEmoji;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextCustomEmoji$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextDateTime : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextDateTime$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;JLjava/lang/String;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()J + public final fun component3 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;JLjava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextDateTime; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextDateTime;Ldev/inmo/tgbotapi/types/rich/RichText;JLjava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextDateTime; + public fun equals (Ljava/lang/Object;)Z + public final fun getDateTimeFormat ()Ljava/lang/String; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public final fun getUnixTime ()J + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextDateTime$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextDateTime$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextDateTime; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextDateTime;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextDateTime$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextEmailAddress : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextEmailAddress$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextEmailAddress; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextEmailAddress;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextEmailAddress; + public fun equals (Ljava/lang/Object;)Z + public final fun getEmailAddress ()Ljava/lang/String; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextEmailAddress$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextEmailAddress$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextEmailAddress; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextEmailAddress;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextEmailAddress$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public abstract interface class dev/inmo/tgbotapi/types/rich/RichTextEntity : dev/inmo/tgbotapi/types/rich/RichText { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextEntity$Companion; + public abstract fun getType ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextEntity$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextEntitySerializer : kotlinx/serialization/json/JsonContentPolymorphicSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextEntitySerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextGroup : dev/inmo/tgbotapi/types/rich/RichText { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextGroup$Companion; + public fun (Ljava/util/List;)V + public final fun component1 ()Ljava/util/List; + public final fun copy (Ljava/util/List;)Ldev/inmo/tgbotapi/types/rich/RichTextGroup; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextGroup;Ljava/util/List;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextGroup; + public fun equals (Ljava/lang/Object;)Z + public final fun getParts ()Ljava/util/List; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextGroup$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextGroup$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextGroup; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextGroup;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextGroup$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextHashtag : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextHashtag$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextHashtag; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextHashtag;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextHashtag; + public fun equals (Ljava/lang/Object;)Z + public final fun getHashtag ()Ljava/lang/String; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextHashtag$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextHashtag$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextHashtag; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextHashtag;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextHashtag$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextItalic : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextItalic$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextItalic; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextItalic;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextItalic; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextItalic$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextItalic$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextItalic; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextItalic;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextItalic$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextMarked : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextMarked$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextMarked; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextMarked;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextMarked; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextMarked$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextMarked$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextMarked; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextMarked;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextMarked$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression; + public fun equals (Ljava/lang/Object;)Z + public final fun getExpression ()Ljava/lang/String; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextMention : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextMention$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextMention; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextMention;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextMention; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public final fun getUsername ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextMention$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextMention$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextMention; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextMention;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextMention$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextPhoneNumber : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextPhoneNumber$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextPhoneNumber; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextPhoneNumber;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextPhoneNumber; + public fun equals (Ljava/lang/Object;)Z + public final fun getPhoneNumber ()Ljava/lang/String; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextPhoneNumber$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextPhoneNumber$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextPhoneNumber; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextPhoneNumber;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextPhoneNumber$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextPlain : dev/inmo/tgbotapi/types/rich/RichText { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextPlain$Companion; + public fun (Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextPlain; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextPlain;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextPlain; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextPlain$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextPlain$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextPlain; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextPlain;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextPlain$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextReference : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextReference$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextReference; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextReference;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextReference; + public fun equals (Ljava/lang/Object;)Z + public final fun getName ()Ljava/lang/String; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextReference$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextReference$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextReference; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextReference;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextReference$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextReferenceLink : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextReferenceLink$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextReferenceLink; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextReferenceLink;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextReferenceLink; + public fun equals (Ljava/lang/Object;)Z + public final fun getReferenceName ()Ljava/lang/String; + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextReferenceLink$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextReferenceLink$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextReferenceLink; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextReferenceLink;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextReferenceLink$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextSerializer : kotlinx/serialization/KSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextSerializer; + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichText; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichText;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextSpoiler : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextSpoiler$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextSpoiler; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextSpoiler;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextSpoiler; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextSpoiler$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextSpoiler$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextSpoiler; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextSpoiler;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextSpoiler$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextStrikethrough : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextStrikethrough$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextStrikethrough; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextStrikethrough;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextStrikethrough; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextStrikethrough$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextStrikethrough$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextStrikethrough; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextStrikethrough;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextStrikethrough$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextSubscript : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextSubscript$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextSubscript; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextSubscript;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextSubscript; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextSubscript$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextSubscript$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextSubscript; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextSubscript;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextSubscript$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextSuperscript : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextSuperscript$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextSuperscript; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextSuperscript;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextSuperscript; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextSuperscript$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextSuperscript$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextSuperscript; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextSuperscript;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextSuperscript$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextTextMention : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextTextMention$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/chat/User;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ldev/inmo/tgbotapi/types/chat/User; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/chat/User;)Ldev/inmo/tgbotapi/types/rich/RichTextTextMention; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextTextMention;Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/chat/User;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextTextMention; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public final fun getUser ()Ldev/inmo/tgbotapi/types/chat/User; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextTextMention$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextTextMention$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextTextMention; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextTextMention;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextTextMention$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextUnderline : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextUnderline$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextUnderline; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextUnderline;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextUnderline; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextUnderline$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextUnderline$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextUnderline; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextUnderline;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextUnderline$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextUrl : dev/inmo/tgbotapi/types/rich/RichTextEntity { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextUrl$Companion; + public static final field TYPE Ljava/lang/String; + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextUrl; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextUrl;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextUrl; + public fun equals (Ljava/lang/Object;)Z + public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getType ()Ljava/lang/String; + public final fun getUrl ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextUrl$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextUrl$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextUrl; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextUrl;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextUrl$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/types/stickers/CustomEmojiStickerSet : dev/inmo/tgbotapi/types/stickers/StickerSet { public static final field Companion Ldev/inmo/tgbotapi/types/stickers/CustomEmojiStickerSet$Companion; public synthetic fun (Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/PhotoSize;ILkotlin/jvm/internal/DefaultConstructorMarker;)V diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/text/EditChatMessageText.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/text/EditChatMessageText.kt index 47420bf48d..5b2123ae6b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/text/EditChatMessageText.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/text/EditChatMessageText.kt @@ -13,6 +13,7 @@ import dev.inmo.tgbotapi.types.message.RawMessageEntity import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.TextContent import dev.inmo.tgbotapi.types.message.toRawMessageEntities +import dev.inmo.tgbotapi.types.rich.InputRichMessage import dev.inmo.tgbotapi.utils.extensions.makeString import kotlinx.serialization.* @@ -73,7 +74,9 @@ data class EditChatMessageText internal constructor( @SerialName(linkPreviewOptionsField) override val linkPreviewOptions: LinkPreviewOptions? = null, @SerialName(replyMarkupField) - override val replyMarkup: InlineKeyboardMarkup? = null + override val replyMarkup: InlineKeyboardMarkup? = null, + @SerialName(richMessageField) + val richMessage: InputRichMessage? = null ) : EditChatMessage, EditTextChatMessage, EditReplyMessage, EditLinkPreviewOptionsContainer { override val textSources: TextSourcesList? by lazy { rawEntities ?.asTextSources(text) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendRichMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendRichMessage.kt new file mode 100644 index 0000000000..985bc21b52 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendRichMessage.kt @@ -0,0 +1,65 @@ +package dev.inmo.tgbotapi.requests.send + +import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest +import dev.inmo.tgbotapi.requests.send.abstracts.SendContentMessageRequest +import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId +import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup +import dev.inmo.tgbotapi.types.message.* +import dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage +import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass +import dev.inmo.tgbotapi.types.message.content.RichMessageContent +import dev.inmo.tgbotapi.types.rich.InputRichMessage +import kotlinx.serialization.DeserializationStrategy +import kotlinx.serialization.EncodeDefault +import kotlinx.serialization.ExperimentalSerializationApi +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerializationStrategy + +internal val RichMessageContentMessageResultDeserializer: DeserializationStrategy> + = TelegramBotAPIMessageDeserializationStrategyClass() + +/** + * Use this method to send rich messages. + * + * @see sendRichMessage + */ +@Serializable +data class SendRichMessage( + @SerialName(chatIdField) + override val chatId: ChatIdentifier, + @SerialName(richMessageField) + val richMessage: InputRichMessage, + @OptIn(ExperimentalSerializationApi::class) + @SerialName(messageThreadIdField) + @EncodeDefault + override val threadId: MessageThreadId? = chatId.threadId, + @OptIn(ExperimentalSerializationApi::class) + @EncodeDefault + @SerialName(directMessagesTopicIdField) + override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId, + @SerialName(businessConnectionIdField) + override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, + @SerialName(disableNotificationField) + override val disableNotification: Boolean = false, + @SerialName(protectContentField) + override val protectContent: Boolean = false, + @SerialName(allowPaidBroadcastField) + override val allowPaidBroadcast: Boolean = false, + @SerialName(messageEffectIdField) + override val effectId: EffectId? = null, + @SerialName(suggestedPostParametersField) + override val suggestedPostParameters: SuggestedPostParameters? = null, + @SerialName(replyParametersField) + override val replyParameters: ReplyParameters? = null, + @SerialName(replyMarkupField) + override val replyMarkup: KeyboardMarkup? = null +) : SendContentMessageRequest>, + ReplyingMarkupSendMessageRequest> { + override fun method(): String = "sendRichMessage" + override val resultDeserializer: DeserializationStrategy> + get() = RichMessageContentMessageResultDeserializer + override val requestSerializer: SerializationStrategy<*> + get() = serializer() +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendRichMessageDraft.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendRichMessageDraft.kt new file mode 100644 index 0000000000..8d0e842d89 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendRichMessageDraft.kt @@ -0,0 +1,51 @@ +package dev.inmo.tgbotapi.requests.send + +import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest +import dev.inmo.tgbotapi.types.ChatId +import dev.inmo.tgbotapi.types.MessageThreadId +import dev.inmo.tgbotapi.types.chatIdField +import dev.inmo.tgbotapi.types.draftIdField +import dev.inmo.tgbotapi.types.messageThreadIdField +import dev.inmo.tgbotapi.types.richMessageField +import dev.inmo.tgbotapi.types.rich.InputRichMessage +import dev.inmo.tgbotapi.utils.serializers.UnitFromBooleanSerializer +import kotlinx.serialization.DeserializationStrategy +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerializationStrategy + +/** + * Use this method to stream a partial rich message to a user while the message is being generated. The streamed draft is + * ephemeral and acts as a temporary 30-second preview - once the output is finalized, [SendRichMessage] must be called + * with the complete message to persist it in the user's chat. + * + * @see sendRichMessageDraft + */ +@Serializable +data class SendRichMessageDraft( + @SerialName(chatIdField) + val chatId: ChatId, + /** + * Unique identifier of the message draft; must be non-zero. Changes to drafts with the same identifier are animated. + */ + @SerialName(draftIdField) + val draftId: Long, + @SerialName(richMessageField) + val richMessage: InputRichMessage, + @SerialName(messageThreadIdField) + val threadId: MessageThreadId? = null +) : SimpleRequest { + init { + require(draftId != 0L) { + "draftId of SendRichMessageDraft must be non-zero" + } + } + + override val requestSerializer: SerializationStrategy<*> + get() = serializer() + + override val resultDeserializer: DeserializationStrategy + get() = UnitFromBooleanSerializer + + override fun method(): String = "sendRichMessageDraft" +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 2d6775e714..085a3deb8b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -573,6 +573,40 @@ const val supportsJoinRequestQueriesField = "supports_join_request_queries" const val queryIdField = "query_id" const val chatJoinRequestQueryIdField = "chat_join_request_query_id" const val webAppUrlField = "web_app_url" +const val richMessageField = "rich_message" +const val isRtlField = "is_rtl" +const val skipEntityDetectionField = "skip_entity_detection" +const val markdownField = "markdown" +const val htmlField = "html" +const val unixTimeField = "unix_time" +const val dateTimeFormatField = "date_time_format" +const val alternativeTextField = "alternative_text" +const val expressionField = "expression" +const val emailAddressField = "email_address" +const val hashtagField = "hashtag" +const val cashtagField = "cashtag" +const val bankCardNumberField = "bank_card_number" +const val anchorNameField = "anchor_name" +const val referenceNameField = "reference_name" +const val blocksField = "blocks" +const val itemsField = "items" +const val summaryField = "summary" +const val sizeField = "size" +const val languageField = "language" +const val creditField = "credit" +const val cellsField = "cells" +const val isHeaderField = "is_header" +const val colspanField = "colspan" +const val rowspanField = "rowspan" +const val alignField = "align" +const val valignField = "valign" +const val zoomField = "zoom" +const val voiceNoteField = "voice_note" +const val hasCheckboxField = "has_checkbox" +const val isCheckedField = "is_checked" +const val isOpenField = "is_open" +const val isBorderedField = "is_bordered" +const val isStripedField = "is_striped" const val certificateField = "certificate" const val questionField = "question" const val questionEntitiesField = "question_entities" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent.kt new file mode 100644 index 0000000000..671db75b0e --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent.kt @@ -0,0 +1,17 @@ +package dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent + +import dev.inmo.tgbotapi.types.richMessageField +import dev.inmo.tgbotapi.types.rich.InputRichMessage +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +/** + * Represents the content of a rich message to be sent as the result of an inline query. + * + * @see InputRichMessageContent + */ +@Serializable +data class InputRichMessageContent( + @SerialName(richMessageField) + val richMessage: InputRichMessage +) : InputMessageContent diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InputMessageContentSerializer.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InputMessageContentSerializer.kt index 8e0796fa64..7f4e3a7358 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InputMessageContentSerializer.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InputMessageContentSerializer.kt @@ -22,6 +22,7 @@ object InputMessageContentSerializer : KSerializer { is InputTextMessageContent -> InputTextMessageContent.serializer().serialize(encoder, value) is InputVenueMessageContent -> InputVenueMessageContent.serializer().serialize(encoder, value) is InputInvoiceMessageContent -> InputInvoiceMessageContent.serializer().serialize(encoder, value) + is InputRichMessageContent -> InputRichMessageContent.serializer().serialize(encoder, value) } } 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 379df3a347..9a55bfc893 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 @@ -50,6 +50,7 @@ import dev.inmo.tgbotapi.types.polls.Poll import dev.inmo.tgbotapi.types.polls.PollOptionPersistentId import dev.inmo.tgbotapi.types.request.ChatShared import dev.inmo.tgbotapi.types.request.UsersShared +import dev.inmo.tgbotapi.types.rich.RichMessage import dev.inmo.tgbotapi.types.stories.Story import dev.inmo.tgbotapi.types.venue.Venue import dev.inmo.tgbotapi.utils.isFakeTelegramUser @@ -92,6 +93,7 @@ internal data class RawMessage( private val caption_entities: RawMessageEntities? = null, private val has_media_spoiler: Boolean? = null, private val story: Story? = null, + private val rich_message: RichMessage? = null, private val audio: AudioFile? = null, private val document: DocumentFile? = null, private val paid_media: PaidMediaInfo? = null, @@ -230,6 +232,11 @@ internal data class RawMessage( } ?: emptyList() when { + rich_message != null -> RichMessageContent( + chat, + messageId, + rich_message + ) story != null -> StoryContent( chat, messageId, 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 2161505d99..a6231626ba 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 @@ -55,6 +55,7 @@ sealed interface MessageContent: ResendableContent { subclass(StoryContent::class) subclass(GiveawayPublicResultsContent::class) subclass(GiveawayContent::class) + subclass(RichMessageContent::class) additionalBuilder() } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt new file mode 100644 index 0000000000..8e53080231 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt @@ -0,0 +1,44 @@ +package dev.inmo.tgbotapi.types.message.content + +import dev.inmo.tgbotapi.requests.ForwardMessage +import dev.inmo.tgbotapi.requests.abstracts.Request +import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId +import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup +import dev.inmo.tgbotapi.types.chat.Chat +import dev.inmo.tgbotapi.types.message.SuggestedPostParameters +import dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage +import dev.inmo.tgbotapi.types.rich.RichMessage +import kotlinx.serialization.Serializable + +@Serializable +data class RichMessageContent( + private val chat: Chat, + private val messageId: MessageId, + val richMessage: RichMessage +) : MessageContent { + override fun createResend( + chatId: ChatIdentifier, + messageThreadId: MessageThreadId?, + directMessageThreadId: DirectMessageThreadId?, + businessConnectionId: BusinessConnectionId?, + disableNotification: Boolean, + protectContent: Boolean, + allowPaidBroadcast: Boolean, + effectId: EffectId?, + suggestedPostParameters: SuggestedPostParameters?, + replyParameters: ReplyParameters?, + replyMarkup: KeyboardMarkup? + ): Request> { + @Suppress("UNCHECKED_CAST") + return ForwardMessage( + chat.id, + toChatId = chatId, + messageId = messageId, + threadId = messageThreadId, + directMessageThreadId = directMessageThreadId, + disableNotification = disableNotification, + protectContent = protectContent + ) as Request> + } +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Typealiases.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Typealiases.kt index 2e9a4b91d7..0bfbaef79e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Typealiases.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/Typealiases.kt @@ -13,6 +13,8 @@ typealias PollMessage = ChatContentMessage typealias TextMessage = ChatContentMessage typealias StoryMessage = ChatContentMessage +typealias RichMessageContentMessage = ChatContentMessage + typealias LocationMessage = ChatContentMessage typealias LiveLocationMessage = ChatContentMessage typealias StaticLocationMessage = ChatContentMessage diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/InputRichMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/InputRichMessage.kt new file mode 100644 index 0000000000..5495f9d57f --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/InputRichMessage.kt @@ -0,0 +1,65 @@ +package dev.inmo.tgbotapi.types.rich + +import dev.inmo.tgbotapi.types.htmlField +import dev.inmo.tgbotapi.types.isRtlField +import dev.inmo.tgbotapi.types.markdownField +import dev.inmo.tgbotapi.types.skipEntityDetectionField +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +/** + * Describes a rich message to be sent. Exactly one of the fields [html] or [markdown] must be used. Use the + * [InputRichMessageHTML] and [InputRichMessageMarkdown] factories to build an instance. + * + * @see InputRichMessage + */ +@ConsistentCopyVisibility +@Serializable +data class InputRichMessage internal constructor( + @SerialName(htmlField) + val html: String? = null, + @SerialName(markdownField) + val markdown: String? = null, + @SerialName(isRtlField) + val isRtl: Boolean? = null, + @SerialName(skipEntityDetectionField) + val skipEntityDetection: Boolean? = null +) { + init { + require((html == null) != (markdown == null)) { + "Exactly one of the fields html or markdown must be used in InputRichMessage" + } + } +} + +/** + * Creates an [InputRichMessage] with the content described using HTML formatting. + * + * @see InputRichMessage + */ +fun InputRichMessageHTML( + html: String, + isRtl: Boolean? = null, + skipEntityDetection: Boolean? = null +): InputRichMessage = InputRichMessage( + html = html, + markdown = null, + isRtl = isRtl, + skipEntityDetection = skipEntityDetection +) + +/** + * Creates an [InputRichMessage] with the content described using Markdown formatting. + * + * @see InputRichMessage + */ +fun InputRichMessageMarkdown( + markdown: String, + isRtl: Boolean? = null, + skipEntityDetection: Boolean? = null +): InputRichMessage = InputRichMessage( + html = null, + markdown = markdown, + isRtl = isRtl, + skipEntityDetection = skipEntityDetection +) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlock.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlock.kt new file mode 100644 index 0000000000..847003b0b2 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlock.kt @@ -0,0 +1,50 @@ +package dev.inmo.tgbotapi.types.rich + +import dev.inmo.tgbotapi.types.typeField +import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded +import kotlinx.serialization.DeserializationStrategy +import kotlinx.serialization.Serializable +import kotlinx.serialization.json.JsonContentPolymorphicSerializer +import kotlinx.serialization.json.JsonElement +import kotlinx.serialization.json.jsonObject +import kotlinx.serialization.json.jsonPrimitive + +/** + * Represents a block in a rich formatted message. + * + * @see RichBlock + */ +@Serializable(RichBlockSerializer::class) +@ClassCastsIncluded +sealed interface RichBlock { + val type: String +} + +object RichBlockSerializer : JsonContentPolymorphicSerializer(RichBlock::class) { + override fun selectDeserializer(element: JsonElement): DeserializationStrategy { + return when (val type = element.jsonObject[typeField]?.jsonPrimitive?.content) { + RichBlockParagraph.TYPE -> RichBlockParagraph.serializer() + RichBlockSectionHeading.TYPE -> RichBlockSectionHeading.serializer() + RichBlockPreformatted.TYPE -> RichBlockPreformatted.serializer() + RichBlockFooter.TYPE -> RichBlockFooter.serializer() + RichBlockDivider.TYPE -> RichBlockDivider.serializer() + RichBlockMathematicalExpression.TYPE -> RichBlockMathematicalExpression.serializer() + RichBlockAnchor.TYPE -> RichBlockAnchor.serializer() + RichBlockList.TYPE -> RichBlockList.serializer() + RichBlockBlockQuotation.TYPE -> RichBlockBlockQuotation.serializer() + RichBlockPullQuotation.TYPE -> RichBlockPullQuotation.serializer() + RichBlockCollage.TYPE -> RichBlockCollage.serializer() + RichBlockSlideshow.TYPE -> RichBlockSlideshow.serializer() + RichBlockTable.TYPE -> RichBlockTable.serializer() + RichBlockDetails.TYPE -> RichBlockDetails.serializer() + RichBlockMap.TYPE -> RichBlockMap.serializer() + RichBlockAnimation.TYPE -> RichBlockAnimation.serializer() + RichBlockAudio.TYPE -> RichBlockAudio.serializer() + RichBlockPhoto.TYPE -> RichBlockPhoto.serializer() + RichBlockVideo.TYPE -> RichBlockVideo.serializer() + RichBlockVoiceNote.TYPE -> RichBlockVoiceNote.serializer() + RichBlockThinking.TYPE -> RichBlockThinking.serializer() + else -> error("Unknown RichBlock type: $type") + } + } +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockParts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockParts.kt new file mode 100644 index 0000000000..79c8d6bec9 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockParts.kt @@ -0,0 +1,75 @@ +package dev.inmo.tgbotapi.types.rich + +import dev.inmo.tgbotapi.types.alignField +import dev.inmo.tgbotapi.types.blocksField +import dev.inmo.tgbotapi.types.colspanField +import dev.inmo.tgbotapi.types.creditField +import dev.inmo.tgbotapi.types.hasCheckboxField +import dev.inmo.tgbotapi.types.isCheckedField +import dev.inmo.tgbotapi.types.isHeaderField +import dev.inmo.tgbotapi.types.labelField +import dev.inmo.tgbotapi.types.rowspanField +import dev.inmo.tgbotapi.types.textField +import dev.inmo.tgbotapi.types.typeField +import dev.inmo.tgbotapi.types.valignField +import dev.inmo.tgbotapi.types.valueField +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +/** + * Caption of a rich formatted block. + * + * @see RichBlockCaption + */ +@Serializable +data class RichBlockCaption( + @SerialName(textField) + val text: RichText, + @SerialName(creditField) + val credit: RichText? = null +) + +/** + * A cell in a [RichBlockTable]. + * + * @see RichBlockTableCell + */ +@Serializable +data class RichBlockTableCell( + @SerialName(textField) + val text: RichText? = null, + @SerialName(isHeaderField) + val isHeader: Boolean? = null, + @SerialName(colspanField) + val colspan: Int? = null, + @SerialName(rowspanField) + val rowspan: Int? = null, + @SerialName(alignField) + val align: String, + @SerialName(valignField) + val valign: String +) + +/** + * An item of a [RichBlockList]. + * + * @see RichBlockListItem + */ +@Serializable +data class RichBlockListItem( + @SerialName(labelField) + val label: String, + @SerialName(blocksField) + val blocks: List, + @SerialName(hasCheckboxField) + val hasCheckbox: Boolean? = null, + @SerialName(isCheckedField) + val isChecked: Boolean? = null, + @SerialName(valueField) + val value: Int? = null, + /** + * For ordered lists, the type of the item label; must be one of "a", "A", "i", "I" or "1". + */ + @SerialName(typeField) + val labelType: String? = null +) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt new file mode 100644 index 0000000000..ddf293aff2 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt @@ -0,0 +1,490 @@ +package dev.inmo.tgbotapi.types.rich + +import dev.inmo.tgbotapi.types.animationField +import dev.inmo.tgbotapi.types.audioField +import dev.inmo.tgbotapi.types.blocksField +import dev.inmo.tgbotapi.types.captionField +import dev.inmo.tgbotapi.types.cellsField +import dev.inmo.tgbotapi.types.creditField +import dev.inmo.tgbotapi.types.expressionField +import dev.inmo.tgbotapi.types.files.AnimationFile +import dev.inmo.tgbotapi.types.files.AudioFile +import dev.inmo.tgbotapi.types.files.PhotoFile +import dev.inmo.tgbotapi.types.files.VideoFile +import dev.inmo.tgbotapi.types.files.VoiceFile +import dev.inmo.tgbotapi.types.hasSpoilerField +import dev.inmo.tgbotapi.types.heightField +import dev.inmo.tgbotapi.types.isBorderedField +import dev.inmo.tgbotapi.types.isOpenField +import dev.inmo.tgbotapi.types.isStripedField +import dev.inmo.tgbotapi.types.itemsField +import dev.inmo.tgbotapi.types.languageField +import dev.inmo.tgbotapi.types.location.StaticLocation +import dev.inmo.tgbotapi.types.locationField +import dev.inmo.tgbotapi.types.nameField +import dev.inmo.tgbotapi.types.photoField +import dev.inmo.tgbotapi.types.sizeField +import dev.inmo.tgbotapi.types.summaryField +import dev.inmo.tgbotapi.types.textField +import dev.inmo.tgbotapi.types.typeField +import dev.inmo.tgbotapi.types.videoField +import dev.inmo.tgbotapi.types.voiceNoteField +import dev.inmo.tgbotapi.types.widthField +import dev.inmo.tgbotapi.types.zoomField +import kotlinx.serialization.EncodeDefault +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +/** + * A text paragraph. + * + * @see RichBlockParagraph + */ +@Serializable +data class RichBlockParagraph( + @SerialName(textField) + val text: RichText +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "paragraph" + } +} + +/** + * A section heading. + * + * @see RichBlockSectionHeading + */ +@Serializable +data class RichBlockSectionHeading( + @SerialName(textField) + val text: RichText, + /** + * Relative size of the text font; 1-6, 1 is the largest, 6 is the smallest. + */ + @SerialName(sizeField) + val size: Int +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "heading" + } +} + +/** + * A preformatted text block. + * + * @see RichBlockPreformatted + */ +@Serializable +data class RichBlockPreformatted( + @SerialName(textField) + val text: RichText, + @SerialName(languageField) + val language: String? = null +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "pre" + } +} + +/** + * A footer. + * + * @see RichBlockFooter + */ +@Serializable +data class RichBlockFooter( + @SerialName(textField) + val text: RichText +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "footer" + } +} + +/** + * A divider. + * + * @see RichBlockDivider + */ +@Serializable +class RichBlockDivider : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + override fun equals(other: Any?): Boolean = other is RichBlockDivider + + override fun hashCode(): Int = TYPE.hashCode() + + override fun toString(): String = "RichBlockDivider" + + companion object { + const val TYPE = "divider" + } +} + +/** + * A block with a mathematical expression in LaTeX format. + * + * @see RichBlockMathematicalExpression + */ +@Serializable +data class RichBlockMathematicalExpression( + @SerialName(expressionField) + val expression: String +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "mathematical_expression" + } +} + +/** + * A block with an anchor. + * + * @see RichBlockAnchor + */ +@Serializable +data class RichBlockAnchor( + @SerialName(nameField) + val name: String +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "anchor" + } +} + +/** + * A list of blocks. + * + * @see RichBlockList + */ +@Serializable +data class RichBlockList( + @SerialName(itemsField) + val items: List +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "list" + } +} + +/** + * A block quotation. + * + * @see RichBlockBlockQuotation + */ +@Serializable +data class RichBlockBlockQuotation( + @SerialName(blocksField) + val blocks: List, + @SerialName(creditField) + val credit: RichText? = null +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "blockquote" + } +} + +/** + * A quotation with centered text. + * + * @see RichBlockPullQuotation + */ +@Serializable +data class RichBlockPullQuotation( + @SerialName(textField) + val text: RichText, + @SerialName(creditField) + val credit: RichText? = null +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "pullquote" + } +} + +/** + * A collage. + * + * @see RichBlockCollage + */ +@Serializable +data class RichBlockCollage( + @SerialName(blocksField) + val blocks: List, + @SerialName(captionField) + val caption: RichBlockCaption? = null +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "collage" + } +} + +/** + * A slideshow. + * + * @see RichBlockSlideshow + */ +@Serializable +data class RichBlockSlideshow( + @SerialName(blocksField) + val blocks: List, + @SerialName(captionField) + val caption: RichBlockCaption? = null +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "slideshow" + } +} + +/** + * A table. + * + * @see RichBlockTable + */ +@Serializable +data class RichBlockTable( + @SerialName(cellsField) + val cells: List>, + @SerialName(isBorderedField) + val isBordered: Boolean? = null, + @SerialName(isStripedField) + val isStriped: Boolean? = null, + @SerialName(captionField) + val caption: RichText? = null +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "table" + } +} + +/** + * An expandable block for details disclosure. + * + * @see RichBlockDetails + */ +@Serializable +data class RichBlockDetails( + @SerialName(summaryField) + val summary: RichText, + @SerialName(blocksField) + val blocks: List, + @SerialName(isOpenField) + val isOpen: Boolean? = null +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "details" + } +} + +/** + * A block with a map. + * + * @see RichBlockMap + */ +@Serializable +data class RichBlockMap( + @SerialName(locationField) + val location: StaticLocation, + /** + * Map zoom level; 13-20. + */ + @SerialName(zoomField) + val zoom: Int, + @SerialName(widthField) + val width: Int, + @SerialName(heightField) + val height: Int, + @SerialName(captionField) + val caption: RichBlockCaption? = null +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "map" + } +} + +/** + * A block with an animation. + * + * @see RichBlockAnimation + */ +@Serializable +data class RichBlockAnimation( + @SerialName(animationField) + val animation: AnimationFile, + @SerialName(hasSpoilerField) + val hasSpoiler: Boolean? = null, + @SerialName(captionField) + val caption: RichBlockCaption? = null +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "animation" + } +} + +/** + * A block with a music file. + * + * @see RichBlockAudio + */ +@Serializable +data class RichBlockAudio( + @SerialName(audioField) + val audio: AudioFile, + @SerialName(captionField) + val caption: RichBlockCaption? = null +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "audio" + } +} + +/** + * A block with a photo. + * + * @see RichBlockPhoto + */ +@Serializable +data class RichBlockPhoto( + @SerialName(photoField) + val photo: PhotoFile, + @SerialName(hasSpoilerField) + val hasSpoiler: Boolean? = null, + @SerialName(captionField) + val caption: RichBlockCaption? = null +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "photo" + } +} + +/** + * A block with a video. + * + * @see RichBlockVideo + */ +@Serializable +data class RichBlockVideo( + @SerialName(videoField) + val video: VideoFile, + @SerialName(hasSpoilerField) + val hasSpoiler: Boolean? = null, + @SerialName(captionField) + val caption: RichBlockCaption? = null +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "video" + } +} + +/** + * A block with a voice note. + * + * @see RichBlockVoiceNote + */ +@Serializable +data class RichBlockVoiceNote( + @SerialName(voiceNoteField) + val voiceNote: VoiceFile, + @SerialName(captionField) + val caption: RichBlockCaption? = null +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "voice_note" + } +} + +/** + * A block with a "Thinking…" placeholder. May be used only in sendRichMessageDraft. + * + * @see RichBlockThinking + */ +@Serializable +data class RichBlockThinking( + @SerialName(textField) + val text: RichText +) : RichBlock { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "thinking" + } +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichMessage.kt new file mode 100644 index 0000000000..55bb419788 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichMessage.kt @@ -0,0 +1,19 @@ +package dev.inmo.tgbotapi.types.rich + +import dev.inmo.tgbotapi.types.blocksField +import dev.inmo.tgbotapi.types.isRtlField +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +/** + * Rich formatted message. + * + * @see RichMessage + */ +@Serializable +data class RichMessage( + @SerialName(blocksField) + val blocks: List, + @SerialName(isRtlField) + val isRtl: Boolean? = null +) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt new file mode 100644 index 0000000000..d81064de88 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt @@ -0,0 +1,104 @@ +package dev.inmo.tgbotapi.types.rich + +import dev.inmo.tgbotapi.types.typeField +import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded +import kotlinx.serialization.DeserializationStrategy +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializable +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.json.* + +/** + * Represents a rich formatted text. It can be either a plain text ([RichTextPlain]), a group of rich texts + * ([RichTextGroup]) or any of [RichTextEntity] subtypes. + * + * @see RichText + */ +@Serializable(RichTextSerializer::class) +@ClassCastsIncluded +sealed interface RichText + +/** + * A plain (non-formatted) part of a [RichText]. Serialized as a bare JSON string. + */ +@Serializable +data class RichTextPlain( + val text: String +) : RichText + +/** + * A group of [RichText]s. Serialized as a JSON array. + */ +@Serializable +data class RichTextGroup( + val parts: List +) : RichText + +/** + * Any typed (formatted) part of a [RichText]. Serialized as a JSON object with the [type] discriminator. + */ +@Serializable(RichTextEntitySerializer::class) +sealed interface RichTextEntity : RichText { + val type: String +} + +object RichTextSerializer : KSerializer { + override val descriptor: SerialDescriptor = JsonElement.serializer().descriptor + + private fun fromJson(json: Json, element: JsonElement): RichText = when (element) { + is JsonArray -> RichTextGroup(element.map { fromJson(json, it) }) + is JsonObject -> json.decodeFromJsonElement(RichTextEntitySerializer, element) + is JsonPrimitive -> RichTextPlain(element.content) + } + + private fun toJson(json: Json, value: RichText): JsonElement = when (value) { + is RichTextPlain -> JsonPrimitive(value.text) + is RichTextGroup -> JsonArray(value.parts.map { toJson(json, it) }) + is RichTextEntity -> json.encodeToJsonElement(RichTextEntitySerializer, value) + } + + override fun deserialize(decoder: Decoder): RichText { + val input = decoder as JsonDecoder + return fromJson(input.json, input.decodeJsonElement()) + } + + override fun serialize(encoder: Encoder, value: RichText) { + val output = encoder as JsonEncoder + output.encodeJsonElement(toJson(output.json, value)) + } +} + +object RichTextEntitySerializer : JsonContentPolymorphicSerializer(RichTextEntity::class) { + override fun selectDeserializer(element: JsonElement): DeserializationStrategy { + return when (val type = element.jsonObject[typeField]?.jsonPrimitive?.content) { + RichTextBold.TYPE -> RichTextBold.serializer() + RichTextItalic.TYPE -> RichTextItalic.serializer() + RichTextUnderline.TYPE -> RichTextUnderline.serializer() + RichTextStrikethrough.TYPE -> RichTextStrikethrough.serializer() + RichTextSpoiler.TYPE -> RichTextSpoiler.serializer() + RichTextDateTime.TYPE -> RichTextDateTime.serializer() + RichTextTextMention.TYPE -> RichTextTextMention.serializer() + RichTextSubscript.TYPE -> RichTextSubscript.serializer() + RichTextSuperscript.TYPE -> RichTextSuperscript.serializer() + RichTextMarked.TYPE -> RichTextMarked.serializer() + RichTextCode.TYPE -> RichTextCode.serializer() + RichTextCustomEmoji.TYPE -> RichTextCustomEmoji.serializer() + RichTextMathematicalExpression.TYPE -> RichTextMathematicalExpression.serializer() + RichTextUrl.TYPE -> RichTextUrl.serializer() + RichTextEmailAddress.TYPE -> RichTextEmailAddress.serializer() + RichTextPhoneNumber.TYPE -> RichTextPhoneNumber.serializer() + RichTextBankCardNumber.TYPE -> RichTextBankCardNumber.serializer() + RichTextMention.TYPE -> RichTextMention.serializer() + RichTextHashtag.TYPE -> RichTextHashtag.serializer() + RichTextCashtag.TYPE -> RichTextCashtag.serializer() + RichTextBotCommand.TYPE -> RichTextBotCommand.serializer() + RichTextAnchor.TYPE -> RichTextAnchor.serializer() + RichTextAnchorLink.TYPE -> RichTextAnchorLink.serializer() + RichTextReference.TYPE -> RichTextReference.serializer() + RichTextReferenceLink.TYPE -> RichTextReferenceLink.serializer() + else -> error("Unknown RichTextEntity type: $type") + } + } +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt new file mode 100644 index 0000000000..a54b380dfc --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt @@ -0,0 +1,531 @@ +package dev.inmo.tgbotapi.types.rich + +import dev.inmo.tgbotapi.types.CustomEmojiId +import dev.inmo.tgbotapi.types.alternativeTextField +import dev.inmo.tgbotapi.types.anchorNameField +import dev.inmo.tgbotapi.types.bankCardNumberField +import dev.inmo.tgbotapi.types.botCommandField +import dev.inmo.tgbotapi.types.cashtagField +import dev.inmo.tgbotapi.types.chat.User +import dev.inmo.tgbotapi.types.customEmojiIdField +import dev.inmo.tgbotapi.types.dateTimeFormatField +import dev.inmo.tgbotapi.types.emailAddressField +import dev.inmo.tgbotapi.types.expressionField +import dev.inmo.tgbotapi.types.hashtagField +import dev.inmo.tgbotapi.types.nameField +import dev.inmo.tgbotapi.types.phoneNumberField +import dev.inmo.tgbotapi.types.referenceNameField +import dev.inmo.tgbotapi.types.textField +import dev.inmo.tgbotapi.types.typeField +import dev.inmo.tgbotapi.types.unixTimeField +import dev.inmo.tgbotapi.types.urlField +import dev.inmo.tgbotapi.types.userField +import dev.inmo.tgbotapi.types.usernameField +import kotlinx.serialization.EncodeDefault +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +/** + * A bold [RichTextEntity]. + * + * @see RichTextBold + */ +@Serializable +data class RichTextBold( + @SerialName(textField) + val text: RichText +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "bold" + } +} + +/** + * An italicized [RichTextEntity]. + * + * @see RichTextItalic + */ +@Serializable +data class RichTextItalic( + @SerialName(textField) + val text: RichText +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "italic" + } +} + +/** + * An underlined [RichTextEntity]. + * + * @see RichTextUnderline + */ +@Serializable +data class RichTextUnderline( + @SerialName(textField) + val text: RichText +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "underline" + } +} + +/** + * A strikethrough [RichTextEntity]. + * + * @see RichTextStrikethrough + */ +@Serializable +data class RichTextStrikethrough( + @SerialName(textField) + val text: RichText +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "strikethrough" + } +} + +/** + * A [RichTextEntity] covered by a spoiler. + * + * @see RichTextSpoiler + */ +@Serializable +data class RichTextSpoiler( + @SerialName(textField) + val text: RichText +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "spoiler" + } +} + +/** + * A subscript [RichTextEntity]. + * + * @see RichTextSubscript + */ +@Serializable +data class RichTextSubscript( + @SerialName(textField) + val text: RichText +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "subscript" + } +} + +/** + * A superscript [RichTextEntity]. + * + * @see RichTextSuperscript + */ +@Serializable +data class RichTextSuperscript( + @SerialName(textField) + val text: RichText +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "superscript" + } +} + +/** + * A marked [RichTextEntity]. + * + * @see RichTextMarked + */ +@Serializable +data class RichTextMarked( + @SerialName(textField) + val text: RichText +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "marked" + } +} + +/** + * A monowidth [RichTextEntity]. + * + * @see RichTextCode + */ +@Serializable +data class RichTextCode( + @SerialName(textField) + val text: RichText +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "code" + } +} + +/** + * A formatted date and time [RichTextEntity]. + * + * @see RichTextDateTime + */ +@Serializable +data class RichTextDateTime( + @SerialName(textField) + val text: RichText, + @SerialName(unixTimeField) + val unixTime: Long, + @SerialName(dateTimeFormatField) + val dateTimeFormat: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "date_time" + } +} + +/** + * A mention of a Telegram user by their identifier. + * + * @see RichTextTextMention + */ +@Serializable +data class RichTextTextMention( + @SerialName(textField) + val text: RichText, + @SerialName(userField) + val user: User +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "text_mention" + } +} + +/** + * A custom emoji [RichTextEntity]. + * + * @see RichTextCustomEmoji + */ +@Serializable +data class RichTextCustomEmoji( + @SerialName(customEmojiIdField) + val customEmojiId: CustomEmojiId, + @SerialName(alternativeTextField) + val alternativeText: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "custom_emoji" + } +} + +/** + * A mathematical expression in LaTeX format. + * + * @see RichTextMathematicalExpression + */ +@Serializable +data class RichTextMathematicalExpression( + @SerialName(expressionField) + val expression: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "mathematical_expression" + } +} + +/** + * A [RichTextEntity] with a link. + * + * @see RichTextUrl + */ +@Serializable +data class RichTextUrl( + @SerialName(textField) + val text: RichText, + @SerialName(urlField) + val url: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "url" + } +} + +/** + * A [RichTextEntity] with an email address. + * + * @see RichTextEmailAddress + */ +@Serializable +data class RichTextEmailAddress( + @SerialName(textField) + val text: RichText, + @SerialName(emailAddressField) + val emailAddress: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "email_address" + } +} + +/** + * A [RichTextEntity] with a phone number. + * + * @see RichTextPhoneNumber + */ +@Serializable +data class RichTextPhoneNumber( + @SerialName(textField) + val text: RichText, + @SerialName(phoneNumberField) + val phoneNumber: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "phone_number" + } +} + +/** + * A [RichTextEntity] with a bank card number. + * + * @see RichTextBankCardNumber + */ +@Serializable +data class RichTextBankCardNumber( + @SerialName(textField) + val text: RichText, + @SerialName(bankCardNumberField) + val bankCardNumber: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "bank_card_number" + } +} + +/** + * A mention by a username. + * + * @see RichTextMention + */ +@Serializable +data class RichTextMention( + @SerialName(textField) + val text: RichText, + @SerialName(usernameField) + val username: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "mention" + } +} + +/** + * A hashtag. + * + * @see RichTextHashtag + */ +@Serializable +data class RichTextHashtag( + @SerialName(textField) + val text: RichText, + @SerialName(hashtagField) + val hashtag: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "hashtag" + } +} + +/** + * A cashtag. + * + * @see RichTextCashtag + */ +@Serializable +data class RichTextCashtag( + @SerialName(textField) + val text: RichText, + @SerialName(cashtagField) + val cashtag: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "cashtag" + } +} + +/** + * A bot command. + * + * @see RichTextBotCommand + */ +@Serializable +data class RichTextBotCommand( + @SerialName(textField) + val text: RichText, + @SerialName(botCommandField) + val botCommand: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "bot_command" + } +} + +/** + * An anchor. + * + * @see RichTextAnchor + */ +@Serializable +data class RichTextAnchor( + @SerialName(nameField) + val name: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "anchor" + } +} + +/** + * A link to an anchor. + * + * @see RichTextAnchorLink + */ +@Serializable +data class RichTextAnchorLink( + @SerialName(textField) + val text: RichText, + @SerialName(anchorNameField) + val anchorName: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "anchor_link" + } +} + +/** + * A reference. + * + * @see RichTextReference + */ +@Serializable +data class RichTextReference( + @SerialName(textField) + val text: RichText, + @SerialName(nameField) + val name: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "reference" + } +} + +/** + * A link to a reference. + * + * @see RichTextReferenceLink + */ +@Serializable +data class RichTextReferenceLink( + @SerialName(textField) + val text: RichText, + @SerialName(referenceNameField) + val referenceName: String +) : RichTextEntity { + @EncodeDefault + @SerialName(typeField) + override val type: String = TYPE + + companion object { + const val TYPE = "reference_link" + } +} diff --git a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/RichMessageSerializationTest.kt b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/RichMessageSerializationTest.kt new file mode 100644 index 0000000000..b02008f1fc --- /dev/null +++ b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/RichMessageSerializationTest.kt @@ -0,0 +1,72 @@ +package dev.inmo.tgbotapi.types + +import dev.inmo.tgbotapi.types.rich.* +import kotlinx.serialization.json.Json +import kotlinx.serialization.encodeToString +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue + +class RichMessageSerializationTest { + private val json = Json { encodeDefaults = true } + + @Test + fun decodesRichMessageWithMixedRichText() { + val source = """ + { + "blocks": [ + { + "type": "paragraph", + "text": ["Hello ", {"type": "bold", "text": "world"}, "!"] + }, + {"type": "heading", "text": "Title", "size": 1}, + {"type": "divider"}, + {"type": "list", "items": [ + {"label": "1", "blocks": [{"type": "paragraph", "text": "first"}]} + ]} + ], + "is_rtl": false + } + """.trimIndent() + + val message = json.decodeFromString(RichMessage.serializer(), source) + assertEquals(4, message.blocks.size) + + val paragraph = message.blocks[0] as RichBlockParagraph + val group = paragraph.text as RichTextGroup + assertEquals(RichTextPlain("Hello "), group.parts[0]) + assertEquals(RichTextBold(RichTextPlain("world")), group.parts[1]) + assertEquals(RichTextPlain("!"), group.parts[2]) + + val heading = message.blocks[1] as RichBlockSectionHeading + assertEquals(RichTextPlain("Title"), heading.text) + assertEquals(1, heading.size) + + assertTrue(message.blocks[2] is RichBlockDivider) + + val list = message.blocks[3] as RichBlockList + assertEquals("1", list.items[0].label) + } + + @Test + fun roundTripsRichMessage() { + val message = RichMessage( + blocks = listOf( + RichBlockParagraph( + RichTextGroup( + listOf( + RichTextPlain("a "), + RichTextItalic(RichTextPlain("b")), + RichTextUrl(RichTextPlain("link"), "https://example.org") + ) + ) + ), + RichBlockDivider() + ) + ) + + val encoded = json.encodeToString(RichMessage.serializer(), message) + val decoded = json.decodeFromString(RichMessage.serializer(), encoded) + assertEquals(message, decoded) + } +} diff --git a/tgbotapi.utils/api/tgbotapi.utils.api b/tgbotapi.utils/api/tgbotapi.utils.api index f6a5c407e5..b408eb9dc6 100644 --- a/tgbotapi.utils/api/tgbotapi.utils.api +++ b/tgbotapi.utils/api/tgbotapi.utils.api @@ -1906,6 +1906,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifInputInvoiceMessageContent (Ldev/inmo/tgbotapi/abstracts/CommonSendInvoiceData;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifInputInvoiceMessageContent (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifInputLocationMessageContent (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifInputRichMessageContent (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifInputTextMessageContent (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifInputVenueMessageContent (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifInternal (Ldev/inmo/tgbotapi/types/ReplyInfo;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -2082,6 +2083,56 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifRequestGuestMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifRestrictedChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifRestrictedMemberChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockAnchor (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockAnimation (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockAudio (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockBlockQuotation (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockCollage (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockDetails (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockDivider (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockFooter (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockList (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockMap (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockMathematicalExpression (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockParagraph (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockPhoto (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockPreformatted (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockPullQuotation (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockSectionHeading (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockSlideshow (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockTable (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockThinking (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockVideo (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockVoiceNote (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichMessageContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextAnchor (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextAnchorLink (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextBankCardNumber (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextBold (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextBotCommand (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextCashtag (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextCode (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextCustomEmoji (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextDateTime (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextEmailAddress (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextEntity (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextGroup (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextHashtag (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextItalic (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextMarked (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextMathematicalExpression (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextMention (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextPhoneNumber (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextPlain (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextReference (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextReferenceLink (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextSpoiler (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextStrikethrough (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextSubscript (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextSuperscript (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextTextMention (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextUnderline (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichTextUrl (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSecondaryChatInviteLink (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSecureValueIdentity (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSecureValueWithData (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -2342,6 +2393,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun inputInvoiceMessageContentOrThrow (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent;)Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputInvoiceMessageContent; public static final fun inputLocationMessageContentOrNull (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent;)Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputLocationMessageContent; public static final fun inputLocationMessageContentOrThrow (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent;)Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputLocationMessageContent; + public static final fun inputRichMessageContentOrNull (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent;)Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent; + public static final fun inputRichMessageContentOrThrow (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent;)Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputRichMessageContent; public static final fun inputTextMessageContentOrNull (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent;)Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputTextMessageContent; public static final fun inputTextMessageContentOrThrow (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent;)Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputTextMessageContent; public static final fun inputVenueMessageContentOrNull (Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputMessageContent;)Ldev/inmo/tgbotapi/types/InlineQueries/InputMessageContent/InputVenueMessageContent; @@ -2694,6 +2747,106 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun restrictedChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/RestrictedChatMember; public static final fun restrictedMemberChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/RestrictedMemberChatMember; public static final fun restrictedMemberChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/RestrictedMemberChatMember; + public static final fun richBlockAnchorOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockAnchor; + public static final fun richBlockAnchorOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockAnchor; + public static final fun richBlockAnimationOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockAnimation; + public static final fun richBlockAnimationOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockAnimation; + public static final fun richBlockAudioOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockAudio; + public static final fun richBlockAudioOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockAudio; + public static final fun richBlockBlockQuotationOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation; + public static final fun richBlockBlockQuotationOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation; + public static final fun richBlockCollageOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockCollage; + public static final fun richBlockCollageOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockCollage; + public static final fun richBlockDetailsOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockDetails; + public static final fun richBlockDetailsOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockDetails; + public static final fun richBlockDividerOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockDivider; + public static final fun richBlockDividerOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockDivider; + public static final fun richBlockFooterOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockFooter; + public static final fun richBlockFooterOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockFooter; + public static final fun richBlockListOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockList; + public static final fun richBlockListOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockList; + public static final fun richBlockMapOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockMap; + public static final fun richBlockMapOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockMap; + public static final fun richBlockMathematicalExpressionOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression; + public static final fun richBlockMathematicalExpressionOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression; + public static final fun richBlockParagraphOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph; + public static final fun richBlockParagraphOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph; + public static final fun richBlockPhotoOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto; + public static final fun richBlockPhotoOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto; + public static final fun richBlockPreformattedOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockPreformatted; + public static final fun richBlockPreformattedOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockPreformatted; + public static final fun richBlockPullQuotationOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockPullQuotation; + public static final fun richBlockPullQuotationOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockPullQuotation; + public static final fun richBlockSectionHeadingOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading; + public static final fun richBlockSectionHeadingOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading; + public static final fun richBlockSlideshowOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockSlideshow; + public static final fun richBlockSlideshowOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockSlideshow; + public static final fun richBlockTableOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockTable; + public static final fun richBlockTableOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockTable; + public static final fun richBlockThinkingOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockThinking; + public static final fun richBlockThinkingOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockThinking; + public static final fun richBlockVideoOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockVideo; + public static final fun richBlockVideoOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockVideo; + public static final fun richBlockVoiceNoteOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote; + public static final fun richBlockVoiceNoteOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote; + public static final fun richMessageContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/RichMessageContent; + public static final fun richMessageContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/RichMessageContent; + public static final fun richTextAnchorLinkOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextAnchorLink; + public static final fun richTextAnchorLinkOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextAnchorLink; + public static final fun richTextAnchorOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextAnchor; + public static final fun richTextAnchorOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextAnchor; + public static final fun richTextBankCardNumberOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextBankCardNumber; + public static final fun richTextBankCardNumberOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextBankCardNumber; + public static final fun richTextBoldOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextBold; + public static final fun richTextBoldOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextBold; + public static final fun richTextBotCommandOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextBotCommand; + public static final fun richTextBotCommandOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextBotCommand; + public static final fun richTextCashtagOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextCashtag; + public static final fun richTextCashtagOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextCashtag; + public static final fun richTextCodeOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextCode; + public static final fun richTextCodeOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextCode; + public static final fun richTextCustomEmojiOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextCustomEmoji; + public static final fun richTextCustomEmojiOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextCustomEmoji; + public static final fun richTextDateTimeOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextDateTime; + public static final fun richTextDateTimeOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextDateTime; + public static final fun richTextEmailAddressOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextEmailAddress; + public static final fun richTextEmailAddressOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextEmailAddress; + public static final fun richTextEntityOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextEntity; + public static final fun richTextEntityOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextEntity; + public static final fun richTextGroupOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextGroup; + public static final fun richTextGroupOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextGroup; + public static final fun richTextHashtagOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextHashtag; + public static final fun richTextHashtagOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextHashtag; + public static final fun richTextItalicOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextItalic; + public static final fun richTextItalicOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextItalic; + public static final fun richTextMarkedOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextMarked; + public static final fun richTextMarkedOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextMarked; + public static final fun richTextMathematicalExpressionOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression; + public static final fun richTextMathematicalExpressionOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression; + public static final fun richTextMentionOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextMention; + public static final fun richTextMentionOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextMention; + public static final fun richTextPhoneNumberOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextPhoneNumber; + public static final fun richTextPhoneNumberOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextPhoneNumber; + public static final fun richTextPlainOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextPlain; + public static final fun richTextPlainOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextPlain; + public static final fun richTextReferenceLinkOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextReferenceLink; + public static final fun richTextReferenceLinkOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextReferenceLink; + public static final fun richTextReferenceOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextReference; + public static final fun richTextReferenceOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextReference; + public static final fun richTextSpoilerOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextSpoiler; + public static final fun richTextSpoilerOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextSpoiler; + public static final fun richTextStrikethroughOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextStrikethrough; + public static final fun richTextStrikethroughOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextStrikethrough; + public static final fun richTextSubscriptOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextSubscript; + public static final fun richTextSubscriptOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextSubscript; + public static final fun richTextSuperscriptOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextSuperscript; + public static final fun richTextSuperscriptOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextSuperscript; + public static final fun richTextTextMentionOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextTextMention; + public static final fun richTextTextMentionOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextTextMention; + public static final fun richTextUnderlineOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextUnderline; + public static final fun richTextUnderlineOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextUnderline; + public static final fun richTextUrlOrNull (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextUrl; + public static final fun richTextUrlOrThrow (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextUrl; public static final fun secondaryChatInviteLinkOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/SecondaryChatInviteLink; public static final fun secondaryChatInviteLinkOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/SecondaryChatInviteLink; public static final fun secureValueIdentityOrNull (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueIdentity; @@ -3261,6 +3414,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/extensions/raw/CallbackQue public final class dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChatJoinRequestKt { public static final fun getInvite_link (Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest;)Ldev/inmo/tgbotapi/types/ChatInviteLink; + public static final fun getQuery_id (Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest;)Ljava/lang/String; } public final class dev/inmo/tgbotapi/extensions/utils/extensions/raw/ChatMemberUpdatedKt { 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 d6cb71dfef..3a94bb90f9 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 @@ -90,6 +90,7 @@ import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputContactMes 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.InputRichMessageContent import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputVenueMessageContent import dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery @@ -414,6 +415,7 @@ import dev.inmo.tgbotapi.types.message.content.PaidMediaInfoContent 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.RichMessageContent import dev.inmo.tgbotapi.types.message.content.SpoilerableMediaContent import dev.inmo.tgbotapi.types.message.content.StaticLocationContent import dev.inmo.tgbotapi.types.message.content.StickerContent @@ -548,6 +550,57 @@ import dev.inmo.tgbotapi.types.request.ChatShared import dev.inmo.tgbotapi.types.request.ChatSharedRequest import dev.inmo.tgbotapi.types.request.RequestResponse import dev.inmo.tgbotapi.types.request.UsersShared +import dev.inmo.tgbotapi.types.rich.RichBlock +import dev.inmo.tgbotapi.types.rich.RichBlockAnchor +import dev.inmo.tgbotapi.types.rich.RichBlockAnimation +import dev.inmo.tgbotapi.types.rich.RichBlockAudio +import dev.inmo.tgbotapi.types.rich.RichBlockBlockQuotation +import dev.inmo.tgbotapi.types.rich.RichBlockCollage +import dev.inmo.tgbotapi.types.rich.RichBlockDetails +import dev.inmo.tgbotapi.types.rich.RichBlockDivider +import dev.inmo.tgbotapi.types.rich.RichBlockFooter +import dev.inmo.tgbotapi.types.rich.RichBlockList +import dev.inmo.tgbotapi.types.rich.RichBlockMap +import dev.inmo.tgbotapi.types.rich.RichBlockMathematicalExpression +import dev.inmo.tgbotapi.types.rich.RichBlockParagraph +import dev.inmo.tgbotapi.types.rich.RichBlockPhoto +import dev.inmo.tgbotapi.types.rich.RichBlockPreformatted +import dev.inmo.tgbotapi.types.rich.RichBlockPullQuotation +import dev.inmo.tgbotapi.types.rich.RichBlockSectionHeading +import dev.inmo.tgbotapi.types.rich.RichBlockSlideshow +import dev.inmo.tgbotapi.types.rich.RichBlockTable +import dev.inmo.tgbotapi.types.rich.RichBlockThinking +import dev.inmo.tgbotapi.types.rich.RichBlockVideo +import dev.inmo.tgbotapi.types.rich.RichBlockVoiceNote +import dev.inmo.tgbotapi.types.rich.RichText +import dev.inmo.tgbotapi.types.rich.RichTextAnchor +import dev.inmo.tgbotapi.types.rich.RichTextAnchorLink +import dev.inmo.tgbotapi.types.rich.RichTextBankCardNumber +import dev.inmo.tgbotapi.types.rich.RichTextBold +import dev.inmo.tgbotapi.types.rich.RichTextBotCommand +import dev.inmo.tgbotapi.types.rich.RichTextCashtag +import dev.inmo.tgbotapi.types.rich.RichTextCode +import dev.inmo.tgbotapi.types.rich.RichTextCustomEmoji +import dev.inmo.tgbotapi.types.rich.RichTextDateTime +import dev.inmo.tgbotapi.types.rich.RichTextEmailAddress +import dev.inmo.tgbotapi.types.rich.RichTextEntity +import dev.inmo.tgbotapi.types.rich.RichTextGroup +import dev.inmo.tgbotapi.types.rich.RichTextHashtag +import dev.inmo.tgbotapi.types.rich.RichTextItalic +import dev.inmo.tgbotapi.types.rich.RichTextMarked +import dev.inmo.tgbotapi.types.rich.RichTextMathematicalExpression +import dev.inmo.tgbotapi.types.rich.RichTextMention +import dev.inmo.tgbotapi.types.rich.RichTextPhoneNumber +import dev.inmo.tgbotapi.types.rich.RichTextPlain +import dev.inmo.tgbotapi.types.rich.RichTextReference +import dev.inmo.tgbotapi.types.rich.RichTextReferenceLink +import dev.inmo.tgbotapi.types.rich.RichTextSpoiler +import dev.inmo.tgbotapi.types.rich.RichTextStrikethrough +import dev.inmo.tgbotapi.types.rich.RichTextSubscript +import dev.inmo.tgbotapi.types.rich.RichTextSuperscript +import dev.inmo.tgbotapi.types.rich.RichTextTextMention +import dev.inmo.tgbotapi.types.rich.RichTextUnderline +import dev.inmo.tgbotapi.types.rich.RichTextUrl import dev.inmo.tgbotapi.types.update.BusinessConnectionUpdate import dev.inmo.tgbotapi.types.update.BusinessMessageUpdate import dev.inmo.tgbotapi.types.update.CallbackQueryUpdate @@ -1338,6 +1391,12 @@ public inline fun ResendableContent.gameContentOrThrow(): GameContent = this as public inline fun ResendableContent.ifGameContent(block: (GameContent) -> T): T? = gameContentOrNull() ?.let(block) +public inline fun ResendableContent.richMessageContentOrNull(): RichMessageContent? = this as? dev.inmo.tgbotapi.types.message.content.RichMessageContent + +public inline fun ResendableContent.richMessageContentOrThrow(): RichMessageContent = this as dev.inmo.tgbotapi.types.message.content.RichMessageContent + +public inline fun ResendableContent.ifRichMessageContent(block: (RichMessageContent) -> T): T? = richMessageContentOrNull() ?.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 @@ -3270,6 +3329,306 @@ public inline fun InputMessageContent.inputVenueMessageContentOrThrow(): InputVe public inline fun InputMessageContent.ifInputVenueMessageContent(block: (InputVenueMessageContent) -> T): T? = inputVenueMessageContentOrNull() ?.let(block) +public inline fun InputMessageContent.inputRichMessageContentOrNull(): InputRichMessageContent? = this as? dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputRichMessageContent + +public inline fun InputMessageContent.inputRichMessageContentOrThrow(): InputRichMessageContent = this as dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputRichMessageContent + +public inline fun InputMessageContent.ifInputRichMessageContent(block: (InputRichMessageContent) -> T): T? = inputRichMessageContentOrNull() ?.let(block) + +public inline fun RichText.richTextBoldOrNull(): RichTextBold? = this as? dev.inmo.tgbotapi.types.rich.RichTextBold + +public inline fun RichText.richTextBoldOrThrow(): RichTextBold = this as dev.inmo.tgbotapi.types.rich.RichTextBold + +public inline fun RichText.ifRichTextBold(block: (RichTextBold) -> T): T? = richTextBoldOrNull() ?.let(block) + +public inline fun RichText.richTextItalicOrNull(): RichTextItalic? = this as? dev.inmo.tgbotapi.types.rich.RichTextItalic + +public inline fun RichText.richTextItalicOrThrow(): RichTextItalic = this as dev.inmo.tgbotapi.types.rich.RichTextItalic + +public inline fun RichText.ifRichTextItalic(block: (RichTextItalic) -> T): T? = richTextItalicOrNull() ?.let(block) + +public inline fun RichText.richTextUnderlineOrNull(): RichTextUnderline? = this as? dev.inmo.tgbotapi.types.rich.RichTextUnderline + +public inline fun RichText.richTextUnderlineOrThrow(): RichTextUnderline = this as dev.inmo.tgbotapi.types.rich.RichTextUnderline + +public inline fun RichText.ifRichTextUnderline(block: (RichTextUnderline) -> T): T? = richTextUnderlineOrNull() ?.let(block) + +public inline fun RichText.richTextStrikethroughOrNull(): RichTextStrikethrough? = this as? dev.inmo.tgbotapi.types.rich.RichTextStrikethrough + +public inline fun RichText.richTextStrikethroughOrThrow(): RichTextStrikethrough = this as dev.inmo.tgbotapi.types.rich.RichTextStrikethrough + +public inline fun RichText.ifRichTextStrikethrough(block: (RichTextStrikethrough) -> T): T? = richTextStrikethroughOrNull() ?.let(block) + +public inline fun RichText.richTextSpoilerOrNull(): RichTextSpoiler? = this as? dev.inmo.tgbotapi.types.rich.RichTextSpoiler + +public inline fun RichText.richTextSpoilerOrThrow(): RichTextSpoiler = this as dev.inmo.tgbotapi.types.rich.RichTextSpoiler + +public inline fun RichText.ifRichTextSpoiler(block: (RichTextSpoiler) -> T): T? = richTextSpoilerOrNull() ?.let(block) + +public inline fun RichText.richTextSubscriptOrNull(): RichTextSubscript? = this as? dev.inmo.tgbotapi.types.rich.RichTextSubscript + +public inline fun RichText.richTextSubscriptOrThrow(): RichTextSubscript = this as dev.inmo.tgbotapi.types.rich.RichTextSubscript + +public inline fun RichText.ifRichTextSubscript(block: (RichTextSubscript) -> T): T? = richTextSubscriptOrNull() ?.let(block) + +public inline fun RichText.richTextSuperscriptOrNull(): RichTextSuperscript? = this as? dev.inmo.tgbotapi.types.rich.RichTextSuperscript + +public inline fun RichText.richTextSuperscriptOrThrow(): RichTextSuperscript = this as dev.inmo.tgbotapi.types.rich.RichTextSuperscript + +public inline fun RichText.ifRichTextSuperscript(block: (RichTextSuperscript) -> T): T? = richTextSuperscriptOrNull() ?.let(block) + +public inline fun RichText.richTextMarkedOrNull(): RichTextMarked? = this as? dev.inmo.tgbotapi.types.rich.RichTextMarked + +public inline fun RichText.richTextMarkedOrThrow(): RichTextMarked = this as dev.inmo.tgbotapi.types.rich.RichTextMarked + +public inline fun RichText.ifRichTextMarked(block: (RichTextMarked) -> T): T? = richTextMarkedOrNull() ?.let(block) + +public inline fun RichText.richTextCodeOrNull(): RichTextCode? = this as? dev.inmo.tgbotapi.types.rich.RichTextCode + +public inline fun RichText.richTextCodeOrThrow(): RichTextCode = this as dev.inmo.tgbotapi.types.rich.RichTextCode + +public inline fun RichText.ifRichTextCode(block: (RichTextCode) -> T): T? = richTextCodeOrNull() ?.let(block) + +public inline fun RichText.richTextDateTimeOrNull(): RichTextDateTime? = this as? dev.inmo.tgbotapi.types.rich.RichTextDateTime + +public inline fun RichText.richTextDateTimeOrThrow(): RichTextDateTime = this as dev.inmo.tgbotapi.types.rich.RichTextDateTime + +public inline fun RichText.ifRichTextDateTime(block: (RichTextDateTime) -> T): T? = richTextDateTimeOrNull() ?.let(block) + +public inline fun RichText.richTextTextMentionOrNull(): RichTextTextMention? = this as? dev.inmo.tgbotapi.types.rich.RichTextTextMention + +public inline fun RichText.richTextTextMentionOrThrow(): RichTextTextMention = this as dev.inmo.tgbotapi.types.rich.RichTextTextMention + +public inline fun RichText.ifRichTextTextMention(block: (RichTextTextMention) -> T): T? = richTextTextMentionOrNull() ?.let(block) + +public inline fun RichText.richTextCustomEmojiOrNull(): RichTextCustomEmoji? = this as? dev.inmo.tgbotapi.types.rich.RichTextCustomEmoji + +public inline fun RichText.richTextCustomEmojiOrThrow(): RichTextCustomEmoji = this as dev.inmo.tgbotapi.types.rich.RichTextCustomEmoji + +public inline fun RichText.ifRichTextCustomEmoji(block: (RichTextCustomEmoji) -> T): T? = richTextCustomEmojiOrNull() ?.let(block) + +public inline fun RichText.richTextMathematicalExpressionOrNull(): RichTextMathematicalExpression? = this as? dev.inmo.tgbotapi.types.rich.RichTextMathematicalExpression + +public inline fun RichText.richTextMathematicalExpressionOrThrow(): RichTextMathematicalExpression = this as dev.inmo.tgbotapi.types.rich.RichTextMathematicalExpression + +public inline fun RichText.ifRichTextMathematicalExpression(block: (RichTextMathematicalExpression) -> T): T? = richTextMathematicalExpressionOrNull() ?.let(block) + +public inline fun RichText.richTextUrlOrNull(): RichTextUrl? = this as? dev.inmo.tgbotapi.types.rich.RichTextUrl + +public inline fun RichText.richTextUrlOrThrow(): RichTextUrl = this as dev.inmo.tgbotapi.types.rich.RichTextUrl + +public inline fun RichText.ifRichTextUrl(block: (RichTextUrl) -> T): T? = richTextUrlOrNull() ?.let(block) + +public inline fun RichText.richTextEmailAddressOrNull(): RichTextEmailAddress? = this as? dev.inmo.tgbotapi.types.rich.RichTextEmailAddress + +public inline fun RichText.richTextEmailAddressOrThrow(): RichTextEmailAddress = this as dev.inmo.tgbotapi.types.rich.RichTextEmailAddress + +public inline fun RichText.ifRichTextEmailAddress(block: (RichTextEmailAddress) -> T): T? = richTextEmailAddressOrNull() ?.let(block) + +public inline fun RichText.richTextPhoneNumberOrNull(): RichTextPhoneNumber? = this as? dev.inmo.tgbotapi.types.rich.RichTextPhoneNumber + +public inline fun RichText.richTextPhoneNumberOrThrow(): RichTextPhoneNumber = this as dev.inmo.tgbotapi.types.rich.RichTextPhoneNumber + +public inline fun RichText.ifRichTextPhoneNumber(block: (RichTextPhoneNumber) -> T): T? = richTextPhoneNumberOrNull() ?.let(block) + +public inline fun RichText.richTextBankCardNumberOrNull(): RichTextBankCardNumber? = this as? dev.inmo.tgbotapi.types.rich.RichTextBankCardNumber + +public inline fun RichText.richTextBankCardNumberOrThrow(): RichTextBankCardNumber = this as dev.inmo.tgbotapi.types.rich.RichTextBankCardNumber + +public inline fun RichText.ifRichTextBankCardNumber(block: (RichTextBankCardNumber) -> T): T? = richTextBankCardNumberOrNull() ?.let(block) + +public inline fun RichText.richTextMentionOrNull(): RichTextMention? = this as? dev.inmo.tgbotapi.types.rich.RichTextMention + +public inline fun RichText.richTextMentionOrThrow(): RichTextMention = this as dev.inmo.tgbotapi.types.rich.RichTextMention + +public inline fun RichText.ifRichTextMention(block: (RichTextMention) -> T): T? = richTextMentionOrNull() ?.let(block) + +public inline fun RichText.richTextHashtagOrNull(): RichTextHashtag? = this as? dev.inmo.tgbotapi.types.rich.RichTextHashtag + +public inline fun RichText.richTextHashtagOrThrow(): RichTextHashtag = this as dev.inmo.tgbotapi.types.rich.RichTextHashtag + +public inline fun RichText.ifRichTextHashtag(block: (RichTextHashtag) -> T): T? = richTextHashtagOrNull() ?.let(block) + +public inline fun RichText.richTextCashtagOrNull(): RichTextCashtag? = this as? dev.inmo.tgbotapi.types.rich.RichTextCashtag + +public inline fun RichText.richTextCashtagOrThrow(): RichTextCashtag = this as dev.inmo.tgbotapi.types.rich.RichTextCashtag + +public inline fun RichText.ifRichTextCashtag(block: (RichTextCashtag) -> T): T? = richTextCashtagOrNull() ?.let(block) + +public inline fun RichText.richTextBotCommandOrNull(): RichTextBotCommand? = this as? dev.inmo.tgbotapi.types.rich.RichTextBotCommand + +public inline fun RichText.richTextBotCommandOrThrow(): RichTextBotCommand = this as dev.inmo.tgbotapi.types.rich.RichTextBotCommand + +public inline fun RichText.ifRichTextBotCommand(block: (RichTextBotCommand) -> T): T? = richTextBotCommandOrNull() ?.let(block) + +public inline fun RichText.richTextAnchorOrNull(): RichTextAnchor? = this as? dev.inmo.tgbotapi.types.rich.RichTextAnchor + +public inline fun RichText.richTextAnchorOrThrow(): RichTextAnchor = this as dev.inmo.tgbotapi.types.rich.RichTextAnchor + +public inline fun RichText.ifRichTextAnchor(block: (RichTextAnchor) -> T): T? = richTextAnchorOrNull() ?.let(block) + +public inline fun RichText.richTextAnchorLinkOrNull(): RichTextAnchorLink? = this as? dev.inmo.tgbotapi.types.rich.RichTextAnchorLink + +public inline fun RichText.richTextAnchorLinkOrThrow(): RichTextAnchorLink = this as dev.inmo.tgbotapi.types.rich.RichTextAnchorLink + +public inline fun RichText.ifRichTextAnchorLink(block: (RichTextAnchorLink) -> T): T? = richTextAnchorLinkOrNull() ?.let(block) + +public inline fun RichText.richTextReferenceOrNull(): RichTextReference? = this as? dev.inmo.tgbotapi.types.rich.RichTextReference + +public inline fun RichText.richTextReferenceOrThrow(): RichTextReference = this as dev.inmo.tgbotapi.types.rich.RichTextReference + +public inline fun RichText.ifRichTextReference(block: (RichTextReference) -> T): T? = richTextReferenceOrNull() ?.let(block) + +public inline fun RichText.richTextReferenceLinkOrNull(): RichTextReferenceLink? = this as? dev.inmo.tgbotapi.types.rich.RichTextReferenceLink + +public inline fun RichText.richTextReferenceLinkOrThrow(): RichTextReferenceLink = this as dev.inmo.tgbotapi.types.rich.RichTextReferenceLink + +public inline fun RichText.ifRichTextReferenceLink(block: (RichTextReferenceLink) -> T): T? = richTextReferenceLinkOrNull() ?.let(block) + +public inline fun RichText.richTextPlainOrNull(): RichTextPlain? = this as? dev.inmo.tgbotapi.types.rich.RichTextPlain + +public inline fun RichText.richTextPlainOrThrow(): RichTextPlain = this as dev.inmo.tgbotapi.types.rich.RichTextPlain + +public inline fun RichText.ifRichTextPlain(block: (RichTextPlain) -> T): T? = richTextPlainOrNull() ?.let(block) + +public inline fun RichText.richTextGroupOrNull(): RichTextGroup? = this as? dev.inmo.tgbotapi.types.rich.RichTextGroup + +public inline fun RichText.richTextGroupOrThrow(): RichTextGroup = this as dev.inmo.tgbotapi.types.rich.RichTextGroup + +public inline fun RichText.ifRichTextGroup(block: (RichTextGroup) -> T): T? = richTextGroupOrNull() ?.let(block) + +public inline fun RichText.richTextEntityOrNull(): RichTextEntity? = this as? dev.inmo.tgbotapi.types.rich.RichTextEntity + +public inline fun RichText.richTextEntityOrThrow(): RichTextEntity = this as dev.inmo.tgbotapi.types.rich.RichTextEntity + +public inline fun RichText.ifRichTextEntity(block: (RichTextEntity) -> T): T? = richTextEntityOrNull() ?.let(block) + +public inline fun RichBlock.richBlockParagraphOrNull(): RichBlockParagraph? = this as? dev.inmo.tgbotapi.types.rich.RichBlockParagraph + +public inline fun RichBlock.richBlockParagraphOrThrow(): RichBlockParagraph = this as dev.inmo.tgbotapi.types.rich.RichBlockParagraph + +public inline fun RichBlock.ifRichBlockParagraph(block: (RichBlockParagraph) -> T): T? = richBlockParagraphOrNull() ?.let(block) + +public inline fun RichBlock.richBlockSectionHeadingOrNull(): RichBlockSectionHeading? = this as? dev.inmo.tgbotapi.types.rich.RichBlockSectionHeading + +public inline fun RichBlock.richBlockSectionHeadingOrThrow(): RichBlockSectionHeading = this as dev.inmo.tgbotapi.types.rich.RichBlockSectionHeading + +public inline fun RichBlock.ifRichBlockSectionHeading(block: (RichBlockSectionHeading) -> T): T? = richBlockSectionHeadingOrNull() ?.let(block) + +public inline fun RichBlock.richBlockPreformattedOrNull(): RichBlockPreformatted? = this as? dev.inmo.tgbotapi.types.rich.RichBlockPreformatted + +public inline fun RichBlock.richBlockPreformattedOrThrow(): RichBlockPreformatted = this as dev.inmo.tgbotapi.types.rich.RichBlockPreformatted + +public inline fun RichBlock.ifRichBlockPreformatted(block: (RichBlockPreformatted) -> T): T? = richBlockPreformattedOrNull() ?.let(block) + +public inline fun RichBlock.richBlockFooterOrNull(): RichBlockFooter? = this as? dev.inmo.tgbotapi.types.rich.RichBlockFooter + +public inline fun RichBlock.richBlockFooterOrThrow(): RichBlockFooter = this as dev.inmo.tgbotapi.types.rich.RichBlockFooter + +public inline fun RichBlock.ifRichBlockFooter(block: (RichBlockFooter) -> T): T? = richBlockFooterOrNull() ?.let(block) + +public inline fun RichBlock.richBlockDividerOrNull(): RichBlockDivider? = this as? dev.inmo.tgbotapi.types.rich.RichBlockDivider + +public inline fun RichBlock.richBlockDividerOrThrow(): RichBlockDivider = this as dev.inmo.tgbotapi.types.rich.RichBlockDivider + +public inline fun RichBlock.ifRichBlockDivider(block: (RichBlockDivider) -> T): T? = richBlockDividerOrNull() ?.let(block) + +public inline fun RichBlock.richBlockMathematicalExpressionOrNull(): RichBlockMathematicalExpression? = this as? dev.inmo.tgbotapi.types.rich.RichBlockMathematicalExpression + +public inline fun RichBlock.richBlockMathematicalExpressionOrThrow(): RichBlockMathematicalExpression = this as dev.inmo.tgbotapi.types.rich.RichBlockMathematicalExpression + +public inline fun RichBlock.ifRichBlockMathematicalExpression(block: (RichBlockMathematicalExpression) -> T): T? = richBlockMathematicalExpressionOrNull() ?.let(block) + +public inline fun RichBlock.richBlockAnchorOrNull(): RichBlockAnchor? = this as? dev.inmo.tgbotapi.types.rich.RichBlockAnchor + +public inline fun RichBlock.richBlockAnchorOrThrow(): RichBlockAnchor = this as dev.inmo.tgbotapi.types.rich.RichBlockAnchor + +public inline fun RichBlock.ifRichBlockAnchor(block: (RichBlockAnchor) -> T): T? = richBlockAnchorOrNull() ?.let(block) + +public inline fun RichBlock.richBlockListOrNull(): RichBlockList? = this as? dev.inmo.tgbotapi.types.rich.RichBlockList + +public inline fun RichBlock.richBlockListOrThrow(): RichBlockList = this as dev.inmo.tgbotapi.types.rich.RichBlockList + +public inline fun RichBlock.ifRichBlockList(block: (RichBlockList) -> T): T? = richBlockListOrNull() ?.let(block) + +public inline fun RichBlock.richBlockBlockQuotationOrNull(): RichBlockBlockQuotation? = this as? dev.inmo.tgbotapi.types.rich.RichBlockBlockQuotation + +public inline fun RichBlock.richBlockBlockQuotationOrThrow(): RichBlockBlockQuotation = this as dev.inmo.tgbotapi.types.rich.RichBlockBlockQuotation + +public inline fun RichBlock.ifRichBlockBlockQuotation(block: (RichBlockBlockQuotation) -> T): T? = richBlockBlockQuotationOrNull() ?.let(block) + +public inline fun RichBlock.richBlockPullQuotationOrNull(): RichBlockPullQuotation? = this as? dev.inmo.tgbotapi.types.rich.RichBlockPullQuotation + +public inline fun RichBlock.richBlockPullQuotationOrThrow(): RichBlockPullQuotation = this as dev.inmo.tgbotapi.types.rich.RichBlockPullQuotation + +public inline fun RichBlock.ifRichBlockPullQuotation(block: (RichBlockPullQuotation) -> T): T? = richBlockPullQuotationOrNull() ?.let(block) + +public inline fun RichBlock.richBlockCollageOrNull(): RichBlockCollage? = this as? dev.inmo.tgbotapi.types.rich.RichBlockCollage + +public inline fun RichBlock.richBlockCollageOrThrow(): RichBlockCollage = this as dev.inmo.tgbotapi.types.rich.RichBlockCollage + +public inline fun RichBlock.ifRichBlockCollage(block: (RichBlockCollage) -> T): T? = richBlockCollageOrNull() ?.let(block) + +public inline fun RichBlock.richBlockSlideshowOrNull(): RichBlockSlideshow? = this as? dev.inmo.tgbotapi.types.rich.RichBlockSlideshow + +public inline fun RichBlock.richBlockSlideshowOrThrow(): RichBlockSlideshow = this as dev.inmo.tgbotapi.types.rich.RichBlockSlideshow + +public inline fun RichBlock.ifRichBlockSlideshow(block: (RichBlockSlideshow) -> T): T? = richBlockSlideshowOrNull() ?.let(block) + +public inline fun RichBlock.richBlockTableOrNull(): RichBlockTable? = this as? dev.inmo.tgbotapi.types.rich.RichBlockTable + +public inline fun RichBlock.richBlockTableOrThrow(): RichBlockTable = this as dev.inmo.tgbotapi.types.rich.RichBlockTable + +public inline fun RichBlock.ifRichBlockTable(block: (RichBlockTable) -> T): T? = richBlockTableOrNull() ?.let(block) + +public inline fun RichBlock.richBlockDetailsOrNull(): RichBlockDetails? = this as? dev.inmo.tgbotapi.types.rich.RichBlockDetails + +public inline fun RichBlock.richBlockDetailsOrThrow(): RichBlockDetails = this as dev.inmo.tgbotapi.types.rich.RichBlockDetails + +public inline fun RichBlock.ifRichBlockDetails(block: (RichBlockDetails) -> T): T? = richBlockDetailsOrNull() ?.let(block) + +public inline fun RichBlock.richBlockMapOrNull(): RichBlockMap? = this as? dev.inmo.tgbotapi.types.rich.RichBlockMap + +public inline fun RichBlock.richBlockMapOrThrow(): RichBlockMap = this as dev.inmo.tgbotapi.types.rich.RichBlockMap + +public inline fun RichBlock.ifRichBlockMap(block: (RichBlockMap) -> T): T? = richBlockMapOrNull() ?.let(block) + +public inline fun RichBlock.richBlockAnimationOrNull(): RichBlockAnimation? = this as? dev.inmo.tgbotapi.types.rich.RichBlockAnimation + +public inline fun RichBlock.richBlockAnimationOrThrow(): RichBlockAnimation = this as dev.inmo.tgbotapi.types.rich.RichBlockAnimation + +public inline fun RichBlock.ifRichBlockAnimation(block: (RichBlockAnimation) -> T): T? = richBlockAnimationOrNull() ?.let(block) + +public inline fun RichBlock.richBlockAudioOrNull(): RichBlockAudio? = this as? dev.inmo.tgbotapi.types.rich.RichBlockAudio + +public inline fun RichBlock.richBlockAudioOrThrow(): RichBlockAudio = this as dev.inmo.tgbotapi.types.rich.RichBlockAudio + +public inline fun RichBlock.ifRichBlockAudio(block: (RichBlockAudio) -> T): T? = richBlockAudioOrNull() ?.let(block) + +public inline fun RichBlock.richBlockPhotoOrNull(): RichBlockPhoto? = this as? dev.inmo.tgbotapi.types.rich.RichBlockPhoto + +public inline fun RichBlock.richBlockPhotoOrThrow(): RichBlockPhoto = this as dev.inmo.tgbotapi.types.rich.RichBlockPhoto + +public inline fun RichBlock.ifRichBlockPhoto(block: (RichBlockPhoto) -> T): T? = richBlockPhotoOrNull() ?.let(block) + +public inline fun RichBlock.richBlockVideoOrNull(): RichBlockVideo? = this as? dev.inmo.tgbotapi.types.rich.RichBlockVideo + +public inline fun RichBlock.richBlockVideoOrThrow(): RichBlockVideo = this as dev.inmo.tgbotapi.types.rich.RichBlockVideo + +public inline fun RichBlock.ifRichBlockVideo(block: (RichBlockVideo) -> T): T? = richBlockVideoOrNull() ?.let(block) + +public inline fun RichBlock.richBlockVoiceNoteOrNull(): RichBlockVoiceNote? = this as? dev.inmo.tgbotapi.types.rich.RichBlockVoiceNote + +public inline fun RichBlock.richBlockVoiceNoteOrThrow(): RichBlockVoiceNote = this as dev.inmo.tgbotapi.types.rich.RichBlockVoiceNote + +public inline fun RichBlock.ifRichBlockVoiceNote(block: (RichBlockVoiceNote) -> T): T? = richBlockVoiceNoteOrNull() ?.let(block) + +public inline fun RichBlock.richBlockThinkingOrNull(): RichBlockThinking? = this as? dev.inmo.tgbotapi.types.rich.RichBlockThinking + +public inline fun RichBlock.richBlockThinkingOrThrow(): RichBlockThinking = this as dev.inmo.tgbotapi.types.rich.RichBlockThinking + +public inline fun RichBlock.ifRichBlockThinking(block: (RichBlockThinking) -> T): T? = richBlockThinkingOrNull() ?.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 From c2b1a5d44b4be68f5930f73c21d3ff0633104944 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 19 Jun 2026 17:52:10 +0600 Subject: [PATCH 05/27] Add behaviour-builder coverage for receiving Rich Messages - onRichMessage trigger (ContentTriggers) - waitRichMessage / waitRichMessageMessage expectations - Flow>.onlyRichMessageContentMessages() util Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 3 +++ .../api/tgbotapi.behaviour_builder.api | 6 +++++ .../expectations/WaitContent.kt | 4 +++ .../expectations/WaitContentMessage.kt | 4 +++ .../triggers_handling/ContentTriggers.kt | 27 +++++++++++++++++++ tgbotapi.utils/api/tgbotapi.utils.api | 1 + .../utils/ContentMessageConversations.kt | 1 + 7 files changed, 46 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37541a76a8..0710b19972 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,10 @@ * `API`: * (`Rich Messages`) Added `sendRichMessage` and `sendRichMessageDraft` `TelegramBot` extensions * (`Join Request Queries`) Added `answerChatJoinRequestQuery` and `sendChatJoinRequestWebApp` `TelegramBot` extensions +* `BehaviourBuilder`: + * (`Rich Messages`) Added `onRichMessage` trigger and `waitRichMessage`/`waitRichMessageMessage` expectations * `Utils`: + * (`Rich Messages`) Added `Flow>.onlyRichMessageContentMessages()` * (`Join Request Queries`) Added `ChatJoinRequest.query_id` raw accessor ## 34.0.0 diff --git a/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api b/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api index c4b5194121..308119af0f 100644 --- a/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api +++ b/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api @@ -394,6 +394,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W public static synthetic fun waitPhoto$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitPoll (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitPoll$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; + public static final fun waitRichMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; + public static synthetic fun waitRichMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitStaticLocation (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitStaticLocation$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitSticker (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; @@ -467,6 +469,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W public static synthetic fun waitPhotoMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitPollMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitPollMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; + public static final fun waitRichMessageMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; + public static synthetic fun waitRichMessageMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitStaticLocationMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; public static synthetic fun waitStaticLocationMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow; public static final fun waitStickerMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow; @@ -1299,6 +1303,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl public static synthetic fun onPhoto$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onPoll (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static synthetic fun onPoll$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; + public static final fun onRichMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; + public static synthetic fun onRichMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onStaticLocation (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static synthetic fun onStaticLocation$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static final fun onSticker (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; 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 42863ae53e..2f98307778 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 @@ -66,6 +66,10 @@ fun BehaviourContext.waitStory( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContent(initRequest, errorFactory).mapContent() +fun BehaviourContext.waitRichMessage( + initRequest: Request<*>? = null, + errorFactory: NullableRequestBuilder<*> = { null } +) = waitContent(initRequest, errorFactory).mapContent() fun BehaviourContext.waitVenue( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } 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 34beb83fa4..839d287c74 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 @@ -75,6 +75,10 @@ fun BehaviourContext.waitStoryMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } ) = waitContentMessage(initRequest, errorFactory).mapWithContent() +fun BehaviourContext.waitRichMessageMessage( + initRequest: Request<*>? = null, + errorFactory: NullableRequestBuilder<*> = { null } +) = waitContentMessage(initRequest, errorFactory).mapWithContent() fun BehaviourContext.waitVenueMessage( initRequest: Request<*>? = null, errorFactory: NullableRequestBuilder<*> = { null } 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 6ab5711dc6..4adcf4e139 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 @@ -304,6 +304,33 @@ fun BC.onStory( scenarioReceiver ) +/** + * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call + * @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example, + * this filter will be used if you will call [dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.waitContentMessage]. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. + * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] + * to combinate several filters + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that + * data + */ +fun BC.onRichMessage( + initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, + subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, + additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver? = null, + scenarioReceiver: CustomBehaviourContextAndTypeReceiver +) = onContentMessageWithType( + initialFilter, + subcontextUpdatesFilter, + markerFactory, + additionalSubcontextInitialAction, + scenarioReceiver +) + /** * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call * @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example, diff --git a/tgbotapi.utils/api/tgbotapi.utils.api b/tgbotapi.utils/api/tgbotapi.utils.api index b408eb9dc6..47171990f2 100644 --- a/tgbotapi.utils/api/tgbotapi.utils.api +++ b/tgbotapi.utils/api/tgbotapi.utils.api @@ -3221,6 +3221,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ContentMessageConversation public static final fun onlyLocationContentMessages (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow; public static final fun onlyPhotoContentMessages (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow; public static final fun onlyPollContentMessages (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow; + public static final fun onlyRichMessageContentMessages (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow; public static final fun onlyStickerContentMessages (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow; public static final fun onlyStoryContentMessages (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow; public static final fun onlyTextContentMessages (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow; 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 0a323ec0c7..55ad47943c 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 @@ -22,6 +22,7 @@ fun Flow>.onlyPollContentMessages() = withContentType>.onlyStickerContentMessages() = withContentType() fun Flow>.onlyTextContentMessages() = withContentType() fun Flow>.onlyStoryContentMessages() = withContentType() +fun Flow>.onlyRichMessageContentMessages() = withContentType() fun Flow>.onlyVenueContentMessages() = withContentType() fun Flow>.onlyVideoContentMessages() = withContentType() fun Flow>.onlyLivePhotoContentMessages() = withContentType() From 0188c65319756975986952fa9cbd14d8b19fbea1 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 19 Jun 2026 18:42:25 +0600 Subject: [PATCH 06/27] Rework ChatJoinRequestQueryResult + EditChatMessageText nullable text - ChatJoinRequestQueryResult: enum -> sealed interface (Approve/Decline/ Queue objects + Unknown) with a companion KSerializer using a PrimitiveKind.STRING descriptor (encodeString/decodeString), not String.serializer() - EditChatMessageText: text is now nullable per API; add EditChatMessageRichText factory for rich edits; widen EditTextChatMessage.text to String? Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 4 +- tgbotapi.core/api/tgbotapi.core.api | 44 +++++++++++++--- .../AnswerChatJoinRequestQuery.kt | 52 +++++++++++++++---- .../edit/abstracts/EditTextChatMessage.kt | 2 +- .../requests/edit/text/EditChatMessageText.kt | 22 +++++++- 5 files changed, 102 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0710b19972..a5045a16cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,14 +10,14 @@ * (`Rich Messages`) Added `RichMessage` type and `RichMessageContent` message content; parsed `rich_message` in `RawMessage`; added `RichMessageContentMessage` typealias * (`Rich Messages`) Added `InputRichMessage` (internal constructor with `InputRichMessageHTML`/`InputRichMessageMarkdown` factories) and `InputRichMessageContent` usable as `InputMessageContent` * (`Rich Messages`) Added `SendRichMessage` and `SendRichMessageDraft` requests - * (`Rich Messages`) Added `richMessage` parameter to `EditChatMessageText` + * (`Rich Messages`) Added `richMessage` parameter to `EditChatMessageText`; its `text` is now nullable (per API) and the `EditChatMessageRichText` factory builds a rich edit; widened `EditTextChatMessage.text` to nullable * (`Polls`) Added `Link` type (`dev.inmo.tgbotapi.types.Link`) implementing `PollMedia`, carrying the `url` of a link attached to a poll option * (`Polls`) Added `link` field parsing to `PollMedia` deserialization/serialization * (`Polls`) Added `TelegramMediaLink` (`InputMediaLink`) implementing `InputPollOptionMedia`, usable as a poll option media * (`Join Request Queries`) Added `ChatJoinRequestQueryId` value class and `queryId` field to `ChatJoinRequest` * (`Join Request Queries`) Added `supportsJoinRequestQueries` flag to `ExtendedBot` (`User.supports_join_request_queries`) * (`Join Request Queries`) Added `guardBot` field to `ExtendedChat` (`ChatFullInfo.guard_bot`), parsed for public chats - * (`Join Request Queries`) Added `AnswerChatJoinRequestQuery` request and `ChatJoinRequestQueryResult` enum (`Approve`/`Decline`/`Queue`) + * (`Join Request Queries`) Added `AnswerChatJoinRequestQuery` request and `ChatJoinRequestQueryResult` sealed interface (`Approve`/`Decline`/`Queue`/`Unknown`) serialized as a plain string * (`Join Request Queries`) Added `SendChatJoinRequestWebApp` request * `API`: * (`Rich Messages`) Added `sendRichMessage` and `sendRichMessageDraft` `TelegramBot` extensions diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 5b0ac9c364..c32d85d9c3 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -3401,20 +3401,46 @@ public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestA public static fun getResultDeserializer (Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestAnswer;)Lkotlinx/serialization/DeserializationStrategy; } -public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult : java/lang/Enum { - public static final field Approve Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult; +public abstract interface class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult { public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Companion; - public static final field Decline Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult; - public static final field Queue Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult; - public static fun getEntries ()Lkotlin/enums/EnumEntries; - public static fun valueOf (Ljava/lang/String;)Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult; - public static fun values ()[Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult; + public abstract fun getName ()Ljava/lang/String; } -public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Companion { +public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Approve : dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult { + public static final field INSTANCE Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Approve; + public fun getName ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Companion : kotlinx/serialization/KSerializer { + public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Decline : dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult { + public static final field INSTANCE Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Decline; + public fun getName ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Queue : dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult { + public static final field INSTANCE Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Queue; + public fun getName ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Unknown : dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult { + public fun (Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;)Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Unknown; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Unknown;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Unknown; + public fun equals (Ljava/lang/Object;)Z + public fun getName ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + public abstract interface class dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink : dev/inmo/tgbotapi/requests/chat/abstracts/EditChatInviteLinkRequest { public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink$Companion; public abstract fun getExpirationUnixTimeStamp ()Ldev/inmo/tgbotapi/types/TelegramDate; @@ -5196,6 +5222,8 @@ public final class dev/inmo/tgbotapi/requests/edit/text/EditChatMessageText$Comp public final class dev/inmo/tgbotapi/requests/edit/text/EditChatMessageTextKt { public static final field editMessageTextMethod Ljava/lang/String; + public static final fun EditChatMessageRichText-FG4LXhY (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLdev/inmo/tgbotapi/types/rich/InputRichMessage;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;)Ldev/inmo/tgbotapi/requests/edit/text/EditChatMessageText; + public static synthetic fun EditChatMessageRichText-FG4LXhY$default (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLdev/inmo/tgbotapi/types/rich/InputRichMessage;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/edit/text/EditChatMessageText; public static final fun EditChatMessageText-PljJ14I (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/LinkPreviewOptions;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;)Ldev/inmo/tgbotapi/requests/edit/text/EditChatMessageText; public static synthetic fun EditChatMessageText-PljJ14I$default (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/util/List;Ljava/lang/String;Ldev/inmo/tgbotapi/types/LinkPreviewOptions;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/edit/text/EditChatMessageText; public static final fun EditChatMessageText-fLfFtqc (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLjava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/lang/String;Ldev/inmo/tgbotapi/types/LinkPreviewOptions;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;)Ldev/inmo/tgbotapi/requests/edit/text/EditChatMessageText; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery.kt index 157647774b..0207fbacab 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery.kt @@ -6,34 +6,68 @@ import dev.inmo.tgbotapi.types.chatJoinRequestQueryIdField import dev.inmo.tgbotapi.types.resultField import dev.inmo.tgbotapi.utils.serializers.UnitFromBooleanSerializer import kotlinx.serialization.DeserializationStrategy +import kotlinx.serialization.KSerializer import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.SerializationStrategy +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder /** - * Result of an [AnswerChatJoinRequestQuery]. + * Result of an [AnswerChatJoinRequestQuery]. Serialized as a plain string. * * @see answerChatJoinRequestQuery */ -@Serializable -enum class ChatJoinRequestQueryResult { +@Serializable(ChatJoinRequestQueryResult.Companion::class) +sealed interface ChatJoinRequestQueryResult { + val name: String + /** * Allow the user to join the chat. */ - @SerialName("approve") - Approve, + object Approve : ChatJoinRequestQueryResult { + override val name: String = "approve" + } /** * Disallow the user to join the chat. */ - @SerialName("decline") - Decline, + object Decline : ChatJoinRequestQueryResult { + override val name: String = "decline" + } /** * Leave the decision to other administrators. */ - @SerialName("queue") - Queue + object Queue : ChatJoinRequestQueryResult { + override val name: String = "queue" + } + + /** + * Any other result which is currently unknown to this library. + */ + data class Unknown(override val name: String) : ChatJoinRequestQueryResult + + companion object : KSerializer { + override val descriptor: SerialDescriptor = + PrimitiveSerialDescriptor("dev.inmo.tgbotapi.requests.chat.invite_links.ChatJoinRequestQueryResult", PrimitiveKind.STRING) + + override fun serialize(encoder: Encoder, value: ChatJoinRequestQueryResult) { + encoder.encodeString(value.name) + } + + override fun deserialize(decoder: Decoder): ChatJoinRequestQueryResult { + return when (val name = decoder.decodeString()) { + Approve.name -> Approve + Decline.name -> Decline + Queue.name -> Queue + else -> Unknown(name) + } + } + } } /** diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/abstracts/EditTextChatMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/abstracts/EditTextChatMessage.kt index 8dbdd24f52..91ebc18ae4 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/abstracts/EditTextChatMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/abstracts/EditTextChatMessage.kt @@ -3,5 +3,5 @@ package dev.inmo.tgbotapi.requests.edit.abstracts import dev.inmo.tgbotapi.abstracts.TextedOutput interface EditTextChatMessage : TextedOutput { - override val text: String + override val text: String? } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/text/EditChatMessageText.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/text/EditChatMessageText.kt index 5b2123ae6b..0219ba57c1 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/text/EditChatMessageText.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/edit/text/EditChatMessageText.kt @@ -56,6 +56,24 @@ fun EditChatMessageText( replyMarkup ) +fun EditChatMessageRichText( + chatId: ChatIdentifier, + messageId: MessageId, + richMessage: InputRichMessage, + businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId, + replyMarkup: InlineKeyboardMarkup? = null +) = EditChatMessageText( + chatId = chatId, + messageId = messageId, + text = null, + parseMode = null, + rawEntities = null, + businessConnectionId = businessConnectionId, + linkPreviewOptions = null, + replyMarkup = replyMarkup, + richMessage = richMessage +) + @ConsistentCopyVisibility @Serializable data class EditChatMessageText internal constructor( @@ -64,7 +82,7 @@ data class EditChatMessageText internal constructor( @SerialName(messageIdField) override val messageId: MessageId, @SerialName(textField) - override val text: String, + override val text: String? = null, @SerialName(parseModeField) override val parseMode: ParseMode? = null, @SerialName(entitiesField) @@ -79,7 +97,7 @@ data class EditChatMessageText internal constructor( val richMessage: InputRichMessage? = null ) : EditChatMessage, EditTextChatMessage, EditReplyMessage, EditLinkPreviewOptionsContainer { override val textSources: TextSourcesList? by lazy { - rawEntities ?.asTextSources(text) + text ?.let { rawEntities ?.asTextSources(it) } } override fun method(): String = editMessageTextMethod From df5018ecf5ae217e77283fb1e1a4860504a2e9bd Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 19 Jun 2026 18:49:42 +0600 Subject: [PATCH 07/27] Make ChatJoinRequestQueryResult inheritors data objects + serializable - Approve/Decline/Queue are now data object - each inheritor (and Unknown) annotated with the shared ChatJoinRequestQueryResult.Companion serializer - companion PrimitiveSerialDescriptor serial name is "ChatJoinRequestQueryResult" Co-Authored-By: Claude Opus 4.8 --- tgbotapi.core/api/tgbotapi.core.api | 17 +++++++++++++++++ .../invite_links/AnswerChatJoinRequestQuery.kt | 12 ++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index c32d85d9c3..d2459efe12 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -3408,7 +3408,11 @@ public abstract interface class dev/inmo/tgbotapi/requests/chat/invite_links/Cha public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Approve : dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult { public static final field INSTANCE Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Approve; + public fun equals (Ljava/lang/Object;)Z public fun getName ()Ljava/lang/String; + public fun hashCode ()I + public final fun serializer ()Lkotlinx/serialization/KSerializer; + public fun toString ()Ljava/lang/String; } public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Companion : kotlinx/serialization/KSerializer { @@ -3422,15 +3426,24 @@ public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQ public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Decline : dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult { public static final field INSTANCE Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Decline; + public fun equals (Ljava/lang/Object;)Z public fun getName ()Ljava/lang/String; + public fun hashCode ()I + public final fun serializer ()Lkotlinx/serialization/KSerializer; + public fun toString ()Ljava/lang/String; } public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Queue : dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult { public static final field INSTANCE Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Queue; + public fun equals (Ljava/lang/Object;)Z public fun getName ()Ljava/lang/String; + public fun hashCode ()I + public final fun serializer ()Lkotlinx/serialization/KSerializer; + public fun toString ()Ljava/lang/String; } public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Unknown : dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult { + public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Unknown$Companion; public fun (Ljava/lang/String;)V public final fun component1 ()Ljava/lang/String; public final fun copy (Ljava/lang/String;)Ldev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Unknown; @@ -3441,6 +3454,10 @@ public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQ public fun toString ()Ljava/lang/String; } +public final class dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestQueryResult$Unknown$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public abstract interface class dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink : dev/inmo/tgbotapi/requests/chat/abstracts/EditChatInviteLinkRequest { public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink$Companion; public abstract fun getExpirationUnixTimeStamp ()Ldev/inmo/tgbotapi/types/TelegramDate; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery.kt index 0207fbacab..7b5ea38775 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/AnswerChatJoinRequestQuery.kt @@ -28,32 +28,36 @@ sealed interface ChatJoinRequestQueryResult { /** * Allow the user to join the chat. */ - object Approve : ChatJoinRequestQueryResult { + @Serializable(ChatJoinRequestQueryResult.Companion::class) + data object Approve : ChatJoinRequestQueryResult { override val name: String = "approve" } /** * Disallow the user to join the chat. */ - object Decline : ChatJoinRequestQueryResult { + @Serializable(ChatJoinRequestQueryResult.Companion::class) + data object Decline : ChatJoinRequestQueryResult { override val name: String = "decline" } /** * Leave the decision to other administrators. */ - object Queue : ChatJoinRequestQueryResult { + @Serializable(ChatJoinRequestQueryResult.Companion::class) + data object Queue : ChatJoinRequestQueryResult { override val name: String = "queue" } /** * Any other result which is currently unknown to this library. */ + @Serializable(ChatJoinRequestQueryResult.Companion::class) data class Unknown(override val name: String) : ChatJoinRequestQueryResult companion object : KSerializer { override val descriptor: SerialDescriptor = - PrimitiveSerialDescriptor("dev.inmo.tgbotapi.requests.chat.invite_links.ChatJoinRequestQueryResult", PrimitiveKind.STRING) + PrimitiveSerialDescriptor("ChatJoinRequestQueryResult", PrimitiveKind.STRING) override fun serialize(encoder: Encoder, value: ChatJoinRequestQueryResult) { encoder.encodeString(value.name) From 9fc80fdd4d01ba9b33b027053309d1d93ce52d54 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 29 Jun 2026 16:17:56 +0600 Subject: [PATCH 08/27] Fix RichTextBotCommand SerialName to bot_command RichTextBotCommand.botCommand reused botCommandField ("command", shared with BotCommand.command) but Bot API docs require "bot_command". Add botCommandFullField = "bot_command" and switch RichTextBotCommand to it. Co-Authored-By: Claude Opus 4.8 --- .../src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt | 1 + .../kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 085a3deb8b..409c65fd8d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -463,6 +463,7 @@ const val inputMessageContentField = "input_message_content" const val hideUrlField = "hide_url" const val botCommandField = "command" +const val botCommandFullField = "bot_command" const val botCommandsField = "commands" const val scopeField = "scope" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt index a54b380dfc..251075be16 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt @@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.types.CustomEmojiId import dev.inmo.tgbotapi.types.alternativeTextField import dev.inmo.tgbotapi.types.anchorNameField import dev.inmo.tgbotapi.types.bankCardNumberField -import dev.inmo.tgbotapi.types.botCommandField +import dev.inmo.tgbotapi.types.botCommandFullField import dev.inmo.tgbotapi.types.cashtagField import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.customEmojiIdField @@ -436,7 +436,7 @@ data class RichTextCashtag( data class RichTextBotCommand( @SerialName(textField) val text: RichText, - @SerialName(botCommandField) + @SerialName(botCommandFullField) val botCommand: String ) : RichTextEntity { @EncodeDefault From 1c06ec8687e59179257e3ca1c522cf31af377b03 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 29 Jun 2026 17:04:03 +0600 Subject: [PATCH 09/27] apiDump --- tgbotapi.core/api/tgbotapi.core.api | 1 + 1 file changed, 1 insertion(+) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index d2459efe12..670ae3c2b5 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -11181,6 +11181,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field botActionActualityTime I public static final field botAdministratorRightsField Ljava/lang/String; public static final field botCommandField Ljava/lang/String; + public static final field botCommandFullField Ljava/lang/String; public static final field botCommandsField Ljava/lang/String; public static final field botIsMemberField Ljava/lang/String; public static final field botUsernameField Ljava/lang/String; From 313fcb3325c385acb26f359509e4686a83ac61f8 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 29 Jun 2026 23:37:14 +0600 Subject: [PATCH 10/27] fix of sendrichmessagedraft --- .../inmo/tgbotapi/extensions/api/send/SendRichMessageDraft.kt | 2 +- .../dev/inmo/tgbotapi/requests/send/SendRichMessageDraft.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendRichMessageDraft.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendRichMessageDraft.kt index 5f3c7a0257..2002481c74 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendRichMessageDraft.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendRichMessageDraft.kt @@ -10,7 +10,7 @@ public suspend fun TelegramBot.sendRichMessageDraft( chatId: ChatId, draftId: Long, richMessage: InputRichMessage, - threadId: MessageThreadId? = null + threadId: MessageThreadId? = chatId.threadId ): Unit = execute( SendRichMessageDraft( chatId = chatId, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendRichMessageDraft.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendRichMessageDraft.kt index 8d0e842d89..96f4457dd2 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendRichMessageDraft.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/SendRichMessageDraft.kt @@ -33,7 +33,7 @@ data class SendRichMessageDraft( @SerialName(richMessageField) val richMessage: InputRichMessage, @SerialName(messageThreadIdField) - val threadId: MessageThreadId? = null + val threadId: MessageThreadId? = chatId.threadId ) : SimpleRequest { init { require(draftId != 0L) { From 1091dbdb5ec376f69f37f15f3f2316556b51d025 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 30 Jun 2026 16:56:58 +0600 Subject: [PATCH 11/27] Rename RichMessage -> RichTextInfo The Telegram type backing rich-formatted message info is RichMessage, but the class name collided conceptually with the in-progress rich-message builders. Rename the data class (and its file) to RichTextInfo and update all references (RawMessage, RichMessageContent, serialization test) plus the API dump. Co-Authored-By: Claude Opus 4.8 --- tgbotapi.core/api/tgbotapi.core.api | 70 +++++++++---------- .../inmo/tgbotapi/types/message/RawMessage.kt | 4 +- .../message/content/RichMessageContent.kt | 4 +- .../rich/{RichMessage.kt => RichTextInfo.kt} | 2 +- .../types/RichMessageSerializationTest.kt | 9 ++- 5 files changed, 44 insertions(+), 45 deletions(-) rename tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/{RichMessage.kt => RichTextInfo.kt} (94%) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 670ae3c2b5..a87db69043 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -29207,14 +29207,14 @@ public final class dev/inmo/tgbotapi/types/message/content/ResendableContent$Def public final class dev/inmo/tgbotapi/types/message/content/RichMessageContent : dev/inmo/tgbotapi/types/message/content/MessageContent { public static final field Companion Ldev/inmo/tgbotapi/types/message/content/RichMessageContent$Companion; - public synthetic fun (Ldev/inmo/tgbotapi/types/chat/Chat;JLdev/inmo/tgbotapi/types/rich/RichMessage;Lkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun component3 ()Ldev/inmo/tgbotapi/types/rich/RichMessage; - public final fun copy-HkzWJnM (Ldev/inmo/tgbotapi/types/chat/Chat;JLdev/inmo/tgbotapi/types/rich/RichMessage;)Ldev/inmo/tgbotapi/types/message/content/RichMessageContent; - public static synthetic fun copy-HkzWJnM$default (Ldev/inmo/tgbotapi/types/message/content/RichMessageContent;Ldev/inmo/tgbotapi/types/chat/Chat;JLdev/inmo/tgbotapi/types/rich/RichMessage;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/message/content/RichMessageContent; + public synthetic fun (Ldev/inmo/tgbotapi/types/chat/Chat;JLdev/inmo/tgbotapi/types/rich/RichTextInfo;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component3 ()Ldev/inmo/tgbotapi/types/rich/RichTextInfo; + public final fun copy-HkzWJnM (Ldev/inmo/tgbotapi/types/chat/Chat;JLdev/inmo/tgbotapi/types/rich/RichTextInfo;)Ldev/inmo/tgbotapi/types/message/content/RichMessageContent; + public static synthetic fun copy-HkzWJnM$default (Ldev/inmo/tgbotapi/types/message/content/RichMessageContent;Ldev/inmo/tgbotapi/types/chat/Chat;JLdev/inmo/tgbotapi/types/rich/RichTextInfo;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/message/content/RichMessageContent; public fun createResend-QiyHKDI (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/abstracts/Request; public fun createResend-eUDkMIk (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/abstracts/Request; public fun equals (Ljava/lang/Object;)Z - public final fun getRichMessage ()Ldev/inmo/tgbotapi/types/rich/RichMessage; + public final fun getRichMessage ()Ldev/inmo/tgbotapi/types/rich/RichTextInfo; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -35254,36 +35254,6 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockVoiceNote$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/rich/RichMessage { - public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichMessage$Companion; - public fun (Ljava/util/List;Ljava/lang/Boolean;)V - public synthetic fun (Ljava/util/List;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun component1 ()Ljava/util/List; - public final fun component2 ()Ljava/lang/Boolean; - public final fun copy (Ljava/util/List;Ljava/lang/Boolean;)Ldev/inmo/tgbotapi/types/rich/RichMessage; - public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichMessage;Ljava/util/List;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichMessage; - public fun equals (Ljava/lang/Object;)Z - public final fun getBlocks ()Ljava/util/List; - public fun hashCode ()I - public final fun isRtl ()Ljava/lang/Boolean; - public fun toString ()Ljava/lang/String; -} - -public final synthetic class dev/inmo/tgbotapi/types/rich/RichMessage$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichMessage$$serializer; - public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichMessage; - public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichMessage;)V - public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; -} - -public final class dev/inmo/tgbotapi/types/rich/RichMessage$Companion { - public final fun serializer ()Lkotlinx/serialization/KSerializer; -} - public abstract interface class dev/inmo/tgbotapi/types/rich/RichText { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichText$Companion; } @@ -35669,6 +35639,36 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextHashtag$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/types/rich/RichTextInfo { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextInfo$Companion; + public fun (Ljava/util/List;Ljava/lang/Boolean;)V + public synthetic fun (Ljava/util/List;Ljava/lang/Boolean;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/util/List; + public final fun component2 ()Ljava/lang/Boolean; + public final fun copy (Ljava/util/List;Ljava/lang/Boolean;)Ldev/inmo/tgbotapi/types/rich/RichTextInfo; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextInfo;Ljava/util/List;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextInfo; + public fun equals (Ljava/lang/Object;)Z + public final fun getBlocks ()Ljava/util/List; + public fun hashCode ()I + public final fun isRtl ()Ljava/lang/Boolean; + public fun toString ()Ljava/lang/String; +} + +public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextInfo$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextInfo$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/rich/RichTextInfo; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/rich/RichTextInfo;)V + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextInfo$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/types/rich/RichTextItalic : dev/inmo/tgbotapi/types/rich/RichTextEntity { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextItalic$Companion; public static final field TYPE Ljava/lang/String; 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 9a55bfc893..bc0f49ec58 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 @@ -50,7 +50,7 @@ import dev.inmo.tgbotapi.types.polls.Poll import dev.inmo.tgbotapi.types.polls.PollOptionPersistentId import dev.inmo.tgbotapi.types.request.ChatShared import dev.inmo.tgbotapi.types.request.UsersShared -import dev.inmo.tgbotapi.types.rich.RichMessage +import dev.inmo.tgbotapi.types.rich.RichTextInfo import dev.inmo.tgbotapi.types.stories.Story import dev.inmo.tgbotapi.types.venue.Venue import dev.inmo.tgbotapi.utils.isFakeTelegramUser @@ -93,7 +93,7 @@ internal data class RawMessage( private val caption_entities: RawMessageEntities? = null, private val has_media_spoiler: Boolean? = null, private val story: Story? = null, - private val rich_message: RichMessage? = null, + private val rich_message: RichTextInfo? = null, private val audio: AudioFile? = null, private val document: DocumentFile? = null, private val paid_media: PaidMediaInfo? = null, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt index 8e53080231..5b918a96f2 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt @@ -8,14 +8,14 @@ import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.SuggestedPostParameters import dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage -import dev.inmo.tgbotapi.types.rich.RichMessage +import dev.inmo.tgbotapi.types.rich.RichTextInfo import kotlinx.serialization.Serializable @Serializable data class RichMessageContent( private val chat: Chat, private val messageId: MessageId, - val richMessage: RichMessage + val richMessage: RichTextInfo ) : MessageContent { override fun createResend( chatId: ChatIdentifier, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextInfo.kt similarity index 94% rename from tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichMessage.kt rename to tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextInfo.kt index 55bb419788..8a9c0733a4 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextInfo.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.Serializable * @see RichMessage */ @Serializable -data class RichMessage( +data class RichTextInfo( @SerialName(blocksField) val blocks: List, @SerialName(isRtlField) diff --git a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/RichMessageSerializationTest.kt b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/RichMessageSerializationTest.kt index b02008f1fc..774a996e72 100644 --- a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/RichMessageSerializationTest.kt +++ b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/RichMessageSerializationTest.kt @@ -2,7 +2,6 @@ package dev.inmo.tgbotapi.types import dev.inmo.tgbotapi.types.rich.* import kotlinx.serialization.json.Json -import kotlinx.serialization.encodeToString import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -29,7 +28,7 @@ class RichMessageSerializationTest { } """.trimIndent() - val message = json.decodeFromString(RichMessage.serializer(), source) + val message = json.decodeFromString(RichTextInfo.serializer(), source) assertEquals(4, message.blocks.size) val paragraph = message.blocks[0] as RichBlockParagraph @@ -50,7 +49,7 @@ class RichMessageSerializationTest { @Test fun roundTripsRichMessage() { - val message = RichMessage( + val message = RichTextInfo( blocks = listOf( RichBlockParagraph( RichTextGroup( @@ -65,8 +64,8 @@ class RichMessageSerializationTest { ) ) - val encoded = json.encodeToString(RichMessage.serializer(), message) - val decoded = json.decodeFromString(RichMessage.serializer(), encoded) + val encoded = json.encodeToString(RichTextInfo.serializer(), message) + val decoded = json.decodeFromString(RichTextInfo.serializer(), encoded) assertEquals(message, decoded) } } From 4cfc0545268100001d6eb43bda9b486cbd59b4b7 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 30 Jun 2026 17:02:03 +0600 Subject: [PATCH 12/27] Implement markdown and html for RichTextEntity inheritors Add Rich Markdown style and Rich HTML style serialization for every RichTextEntity subtype, following the Bot API rich formatting spec (https://core.telegram.org/bots/api#rich-markdown-style and #rich-html-style). New RichTextFormatting.kt provides: * String.escapeRichMarkdown() escaping the rich-markdown special characters; * RichText.source - plain unformatted text of any RichText; * RichText.markdown / RichText.html - recursive dispatch over RichTextPlain, RichTextGroup and RichTextEntity so inner texts render correctly. Each of the 25 entity types now overrides markdown and html. Auto-detected entities (mention, hashtag, cashtag, bank card, bot command) emit their visible text; the rest wrap inner text in the corresponding markers/tags. Co-Authored-By: Claude Opus 4.8 --- tgbotapi.core/api/tgbotapi.core.api | 59 ++++++++ .../dev/inmo/tgbotapi/types/rich/RichText.kt | 3 + .../tgbotapi/types/rich/RichTextEntities.kt | 127 ++++++++++++++++++ .../tgbotapi/types/rich/RichTextFormatting.kt | 82 +++++++++++ 4 files changed, 271 insertions(+) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormatting.kt diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index a87db69043..f1373e71a8 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -35270,6 +35270,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextAnchor : dev/inmo/tgbota public final fun copy (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextAnchor; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextAnchor;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextAnchor; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getName ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35301,6 +35303,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextAnchorLink : dev/inmo/tg public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextAnchorLink;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextAnchorLink; public fun equals (Ljava/lang/Object;)Z public final fun getAnchorName ()Ljava/lang/String; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35332,6 +35336,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextBankCardNumber : dev/inm public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextBankCardNumber;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextBankCardNumber; public fun equals (Ljava/lang/Object;)Z public final fun getBankCardNumber ()Ljava/lang/String; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35361,6 +35367,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextBold : dev/inmo/tgbotapi public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextBold; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextBold;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextBold; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35392,6 +35400,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextBotCommand : dev/inmo/tg public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextBotCommand;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextBotCommand; public fun equals (Ljava/lang/Object;)Z public final fun getBotCommand ()Ljava/lang/String; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35423,6 +35433,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextCashtag : dev/inmo/tgbot public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextCashtag;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextCashtag; public fun equals (Ljava/lang/Object;)Z public final fun getCashtag ()Ljava/lang/String; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35452,6 +35464,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextCode : dev/inmo/tgbotapi public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextCode; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextCode;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextCode; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35484,6 +35498,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextCustomEmoji : dev/inmo/t public fun equals (Ljava/lang/Object;)Z public final fun getAlternativeText ()Ljava/lang/String; public final fun getCustomEmojiId-dDnjveI ()Ljava/lang/String; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -35515,6 +35531,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextDateTime : dev/inmo/tgbo public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextDateTime;Ldev/inmo/tgbotapi/types/rich/RichText;JLjava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextDateTime; public fun equals (Ljava/lang/Object;)Z public final fun getDateTimeFormat ()Ljava/lang/String; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public final fun getUnixTime ()J @@ -35547,6 +35565,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextEmailAddress : dev/inmo/ public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextEmailAddress;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextEmailAddress; public fun equals (Ljava/lang/Object;)Z public final fun getEmailAddress ()Ljava/lang/String; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35570,6 +35590,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextEmailAddress$Companion { public abstract interface class dev/inmo/tgbotapi/types/rich/RichTextEntity : dev/inmo/tgbotapi/types/rich/RichText { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextEntity$Companion; + public abstract fun getHtml ()Ljava/lang/String; + public abstract fun getMarkdown ()Ljava/lang/String; public abstract fun getType ()Ljava/lang/String; } @@ -35581,6 +35603,13 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextEntitySerializer : kotli public static final field INSTANCE Ldev/inmo/tgbotapi/types/rich/RichTextEntitySerializer; } +public final class dev/inmo/tgbotapi/types/rich/RichTextFormattingKt { + public static final fun escapeRichMarkdown (Ljava/lang/String;)Ljava/lang/String; + public static final fun getHtml (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public static final fun getMarkdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public static final fun getSource (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; +} + public final class dev/inmo/tgbotapi/types/rich/RichTextGroup : dev/inmo/tgbotapi/types/rich/RichText { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextGroup$Companion; public fun (Ljava/util/List;)V @@ -35618,6 +35647,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextHashtag : dev/inmo/tgbot public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextHashtag;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextHashtag; public fun equals (Ljava/lang/Object;)Z public final fun getHashtag ()Ljava/lang/String; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35677,6 +35708,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextItalic : dev/inmo/tgbota public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextItalic; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextItalic;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextItalic; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35706,6 +35739,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextMarked : dev/inmo/tgbota public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextMarked; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextMarked;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextMarked; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35736,6 +35771,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression : public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression; public fun equals (Ljava/lang/Object;)Z public final fun getExpression ()Ljava/lang/String; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -35765,6 +35802,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextMention : dev/inmo/tgbot public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextMention; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextMention;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextMention; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public final fun getUsername ()Ljava/lang/String; @@ -35796,6 +35835,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextPhoneNumber : dev/inmo/t public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextPhoneNumber; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextPhoneNumber;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextPhoneNumber; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getPhoneNumber ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; @@ -35854,6 +35895,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextReference : dev/inmo/tgb public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextReference; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextReference;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextReference; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getName ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; @@ -35885,6 +35928,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextReferenceLink : dev/inmo public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextReferenceLink; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextReferenceLink;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextReferenceLink; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getReferenceName ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; @@ -35924,6 +35969,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextSpoiler : dev/inmo/tgbot public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextSpoiler; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextSpoiler;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextSpoiler; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35953,6 +36000,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextStrikethrough : dev/inmo public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextStrikethrough; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextStrikethrough;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextStrikethrough; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35982,6 +36031,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextSubscript : dev/inmo/tgb public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextSubscript; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextSubscript;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextSubscript; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -36011,6 +36062,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextSuperscript : dev/inmo/t public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextSuperscript; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextSuperscript;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextSuperscript; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -36041,6 +36094,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextTextMention : dev/inmo/t public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/chat/User;)Ldev/inmo/tgbotapi/types/rich/RichTextTextMention; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextTextMention;Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/chat/User;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextTextMention; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public final fun getUser ()Ldev/inmo/tgbotapi/types/chat/User; @@ -36071,6 +36126,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextUnderline : dev/inmo/tgb public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichTextUnderline; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextUnderline;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextUnderline; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -36101,6 +36158,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextUrl : dev/inmo/tgbotapi/ public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextUrl; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextUrl;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextUrl; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public final fun getUrl ()Ljava/lang/String; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt index d81064de88..f270d7dada 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt @@ -42,6 +42,9 @@ data class RichTextGroup( @Serializable(RichTextEntitySerializer::class) sealed interface RichTextEntity : RichText { val type: String + + val markdown: String + val html: String } object RichTextSerializer : KSerializer { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt index 251075be16..67f77caa8c 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt @@ -12,6 +12,7 @@ import dev.inmo.tgbotapi.types.dateTimeFormatField import dev.inmo.tgbotapi.types.emailAddressField import dev.inmo.tgbotapi.types.expressionField import dev.inmo.tgbotapi.types.hashtagField +import dev.inmo.tgbotapi.types.internalUserLinkBeginning import dev.inmo.tgbotapi.types.nameField import dev.inmo.tgbotapi.types.phoneNumberField import dev.inmo.tgbotapi.types.referenceNameField @@ -21,6 +22,7 @@ import dev.inmo.tgbotapi.types.unixTimeField import dev.inmo.tgbotapi.types.urlField import dev.inmo.tgbotapi.types.userField import dev.inmo.tgbotapi.types.usernameField +import dev.inmo.tgbotapi.utils.extensions.toHtml import kotlinx.serialization.EncodeDefault import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -39,6 +41,11 @@ data class RichTextBold( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "**${text.markdown}**" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "bold" } @@ -58,6 +65,11 @@ data class RichTextItalic( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "*${text.markdown}*" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "italic" } @@ -77,6 +89,11 @@ data class RichTextUnderline( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "${text.markdown}" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "underline" } @@ -96,6 +113,11 @@ data class RichTextStrikethrough( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "~~${text.markdown}~~" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "strikethrough" } @@ -115,6 +137,11 @@ data class RichTextSpoiler( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "||${text.markdown}||" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "spoiler" } @@ -134,6 +161,11 @@ data class RichTextSubscript( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "${text.markdown}" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "subscript" } @@ -153,6 +185,11 @@ data class RichTextSuperscript( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "${text.markdown}" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "superscript" } @@ -172,6 +209,11 @@ data class RichTextMarked( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "==${text.markdown}==" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "marked" } @@ -191,6 +233,11 @@ data class RichTextCode( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "`${text.source}`" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "code" } @@ -214,6 +261,11 @@ data class RichTextDateTime( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "![${text.markdown}](tg://time?unix=$unixTime&format=$dateTimeFormat)" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "date_time" } @@ -235,6 +287,11 @@ data class RichTextTextMention( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "[${text.markdown}]($internalUserLinkBeginning${user.id.chatId.long})" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "text_mention" } @@ -256,6 +313,11 @@ data class RichTextCustomEmoji( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "![${alternativeText.escapeRichMarkdown()}](tg://emoji?id=${customEmojiId.string})" + override val html: String + get() = "${alternativeText.toHtml()}" + companion object { const val TYPE = "custom_emoji" } @@ -275,6 +337,11 @@ data class RichTextMathematicalExpression( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "\$$expression\$" + override val html: String + get() = "$expression" + companion object { const val TYPE = "mathematical_expression" } @@ -296,6 +363,11 @@ data class RichTextUrl( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "[${text.markdown}]($url)" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "url" } @@ -317,6 +389,11 @@ data class RichTextEmailAddress( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "[${text.markdown}](mailto:$emailAddress)" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "email_address" } @@ -338,6 +415,11 @@ data class RichTextPhoneNumber( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "[${text.markdown}](tel:$phoneNumber)" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "phone_number" } @@ -359,6 +441,11 @@ data class RichTextBankCardNumber( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = text.markdown + override val html: String + get() = text.html + companion object { const val TYPE = "bank_card_number" } @@ -380,6 +467,11 @@ data class RichTextMention( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = text.markdown + override val html: String + get() = text.html + companion object { const val TYPE = "mention" } @@ -401,6 +493,11 @@ data class RichTextHashtag( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = text.markdown + override val html: String + get() = text.html + companion object { const val TYPE = "hashtag" } @@ -422,6 +519,11 @@ data class RichTextCashtag( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = text.markdown + override val html: String + get() = text.html + companion object { const val TYPE = "cashtag" } @@ -443,6 +545,11 @@ data class RichTextBotCommand( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = text.markdown + override val html: String + get() = text.html + companion object { const val TYPE = "bot_command" } @@ -462,6 +569,11 @@ data class RichTextAnchor( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "" + override val html: String + get() = "" + companion object { const val TYPE = "anchor" } @@ -483,6 +595,11 @@ data class RichTextAnchorLink( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "[${text.markdown}](#$anchorName)" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "anchor_link" } @@ -504,6 +621,11 @@ data class RichTextReference( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "${text.markdown}" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "reference" } @@ -525,6 +647,11 @@ data class RichTextReferenceLink( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "[${text.markdown}](#$referenceName)" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "reference_link" } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormatting.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormatting.kt new file mode 100644 index 0000000000..69fbe2da81 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormatting.kt @@ -0,0 +1,82 @@ +package dev.inmo.tgbotapi.types.rich + +import dev.inmo.tgbotapi.types.internalUserLinkBeginning +import dev.inmo.tgbotapi.utils.extensions.toHtml + +/** + * Characters which have a special meaning in the + * [Rich Markdown style](https://core.telegram.org/bots/api#rich-markdown-style) and must be escaped with a backslash + * to be represented literally. + */ +private val richMarkdownSpecialCharacters = setOf( + '\\', '`', '*', '_', '~', '|', '[', ']', '(', ')', '<', '>', '#', '=', '!', '$' +) + +/** + * Escapes all the [richMarkdownSpecialCharacters] of the receiver with a backslash so that the resulting string is + * represented literally in the [Rich Markdown style](https://core.telegram.org/bots/api#rich-markdown-style). + */ +fun String.escapeRichMarkdown(): String = buildString { + for (character in this@escapeRichMarkdown) { + if (character in richMarkdownSpecialCharacters) { + append('\\') + } + append(character) + } +} + +/** + * Plain (unformatted) text of this [RichText]. For [RichTextEntity]s without an inner [RichText] it falls back to the + * most meaningful textual representation: alternative text for custom emojis, the expression for mathematical + * expressions and an empty string for anchors. + */ +val RichText.source: String + get() = when (this) { + is RichTextPlain -> text + is RichTextGroup -> parts.joinToString(separator = "") { it.source } + is RichTextCustomEmoji -> alternativeText + is RichTextMathematicalExpression -> expression + is RichTextAnchor -> "" + is RichTextBold -> text.source + is RichTextItalic -> text.source + is RichTextUnderline -> text.source + is RichTextStrikethrough -> text.source + is RichTextSpoiler -> text.source + is RichTextSubscript -> text.source + is RichTextSuperscript -> text.source + is RichTextMarked -> text.source + is RichTextCode -> text.source + is RichTextDateTime -> text.source + is RichTextTextMention -> text.source + is RichTextUrl -> text.source + is RichTextEmailAddress -> text.source + is RichTextPhoneNumber -> text.source + is RichTextBankCardNumber -> text.source + is RichTextMention -> text.source + is RichTextHashtag -> text.source + is RichTextCashtag -> text.source + is RichTextBotCommand -> text.source + is RichTextAnchorLink -> text.source + is RichTextReference -> text.source + is RichTextReferenceLink -> text.source + } + +/** + * [Rich Markdown style](https://core.telegram.org/bots/api#rich-markdown-style) representation of this [RichText]. + */ +val RichText.markdown: String + get() = when (this) { + is RichTextPlain -> text.escapeRichMarkdown() + is RichTextGroup -> parts.joinToString(separator = "") { it.markdown } + is RichTextEntity -> markdown + } + +/** + * [Rich HTML style](https://core.telegram.org/bots/api#rich-html-style) representation of this [RichText]. + */ +val RichText.html: String + get() = when (this) { + is RichTextPlain -> text.toHtml() + is RichTextGroup -> parts.joinToString(separator = "") { it.html } + is RichTextEntity -> html + } From b5238320a5ee1655fb612af64db23860181f82fa Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 30 Jun 2026 17:11:14 +0600 Subject: [PATCH 13/27] Add tests for rich text entity markdown and html Cover markdown and html output of all 25 RichTextEntity subtypes plus the recursive RichText.markdown / RichText.html / RichText.source extensions (nested groups, plain-text escaping, plain-text extraction). Note: plainHtmlEscapesAngleBrackets asserts the current String.toHtml() behaviour, which escapes '&' last and therefore over-escapes '<'/'>' (e.g. "a "a&lt;b"). This matches the rest of the library's HTML output. Co-Authored-By: Claude Opus 4.8 --- .../types/rich/RichTextFormattingTest.kt | 221 ++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormattingTest.kt diff --git a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormattingTest.kt b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormattingTest.kt new file mode 100644 index 0000000000..ff5a77f6d1 --- /dev/null +++ b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormattingTest.kt @@ -0,0 +1,221 @@ +package dev.inmo.tgbotapi.types.rich + +import dev.inmo.tgbotapi.types.ChatId +import dev.inmo.tgbotapi.types.CustomEmojiId +import dev.inmo.tgbotapi.types.RawChatId +import dev.inmo.tgbotapi.types.chat.CommonUser +import kotlin.test.Test +import kotlin.test.assertEquals + +class RichTextFormattingTest { + @Test + fun bold() { + val entity = RichTextBold(RichTextPlain("x")) + assertEquals("**x**", entity.markdown) + assertEquals("x", entity.html) + } + + @Test + fun italic() { + val entity = RichTextItalic(RichTextPlain("x")) + assertEquals("*x*", entity.markdown) + assertEquals("x", entity.html) + } + + @Test + fun underline() { + val entity = RichTextUnderline(RichTextPlain("x")) + assertEquals("x", entity.markdown) + assertEquals("x", entity.html) + } + + @Test + fun strikethrough() { + val entity = RichTextStrikethrough(RichTextPlain("x")) + assertEquals("~~x~~", entity.markdown) + assertEquals("x", entity.html) + } + + @Test + fun spoiler() { + val entity = RichTextSpoiler(RichTextPlain("x")) + assertEquals("||x||", entity.markdown) + assertEquals("x", entity.html) + } + + @Test + fun subscript() { + val entity = RichTextSubscript(RichTextPlain("x")) + assertEquals("x", entity.markdown) + assertEquals("x", entity.html) + } + + @Test + fun superscript() { + val entity = RichTextSuperscript(RichTextPlain("x")) + assertEquals("x", entity.markdown) + assertEquals("x", entity.html) + } + + @Test + fun marked() { + val entity = RichTextMarked(RichTextPlain("x")) + assertEquals("==x==", entity.markdown) + assertEquals("x", entity.html) + } + + @Test + fun code() { + val entity = RichTextCode(RichTextPlain("x")) + assertEquals("`x`", entity.markdown) + assertEquals("x", entity.html) + } + + @Test + fun dateTime() { + val entity = RichTextDateTime(RichTextPlain("now"), 1647531900L, "wDT") + assertEquals("![now](tg://time?unix=1647531900&format=wDT)", entity.markdown) + assertEquals("now", entity.html) + } + + @Test + fun textMention() { + val entity = RichTextTextMention(RichTextPlain("John"), CommonUser(ChatId(RawChatId(12345L)), "John")) + assertEquals("[John](tg://user?id=12345)", entity.markdown) + assertEquals("John", entity.html) + } + + @Test + fun customEmoji() { + val entity = RichTextCustomEmoji(CustomEmojiId("555"), "alt") + assertEquals("![alt](tg://emoji?id=555)", entity.markdown) + assertEquals("alt", entity.html) + } + + @Test + fun mathematicalExpression() { + val entity = RichTextMathematicalExpression("x^2") + assertEquals("\$x^2\$", entity.markdown) + assertEquals("x^2", entity.html) + } + + @Test + fun url() { + val entity = RichTextUrl(RichTextPlain("link"), "https://t.me/") + assertEquals("[link](https://t.me/)", entity.markdown) + assertEquals("link", entity.html) + } + + @Test + fun emailAddress() { + val entity = RichTextEmailAddress(RichTextPlain("mail"), "a@b.com") + assertEquals("[mail](mailto:a@b.com)", entity.markdown) + assertEquals("mail", entity.html) + } + + @Test + fun phoneNumber() { + val entity = RichTextPhoneNumber(RichTextPlain("call"), "+123") + assertEquals("[call](tel:+123)", entity.markdown) + assertEquals("call", entity.html) + } + + @Test + fun bankCardNumber() { + val entity = RichTextBankCardNumber(RichTextPlain("4242 4242 4242 4242"), "4242424242424242") + assertEquals("4242 4242 4242 4242", entity.markdown) + assertEquals("4242 4242 4242 4242", entity.html) + } + + @Test + fun mention() { + val entity = RichTextMention(RichTextPlain("@user"), "user") + assertEquals("@user", entity.markdown) + assertEquals("@user", entity.html) + } + + @Test + fun hashtag() { + val entity = RichTextHashtag(RichTextPlain("#tag"), "tag") + assertEquals("\\#tag", entity.markdown) + assertEquals("#tag", entity.html) + } + + @Test + fun cashtag() { + val entity = RichTextCashtag(RichTextPlain("\$USD"), "USD") + assertEquals("\\\$USD", entity.markdown) + assertEquals("\$USD", entity.html) + } + + @Test + fun botCommand() { + val entity = RichTextBotCommand(RichTextPlain("/start"), "start") + assertEquals("/start", entity.markdown) + assertEquals("/start", entity.html) + } + + @Test + fun anchor() { + val entity = RichTextAnchor("top") + assertEquals("", entity.markdown) + assertEquals("", entity.html) + } + + @Test + fun anchorLink() { + val entity = RichTextAnchorLink(RichTextPlain("go"), "top") + assertEquals("[go](#top)", entity.markdown) + assertEquals("go", entity.html) + } + + @Test + fun reference() { + val entity = RichTextReference(RichTextPlain("ref"), "note1") + assertEquals("ref", entity.markdown) + assertEquals("ref", entity.html) + } + + @Test + fun referenceLink() { + val entity = RichTextReferenceLink(RichTextPlain("see"), "note1") + assertEquals("[see](#note1)", entity.markdown) + assertEquals("see", entity.html) + } + + @Test + fun nestedGroupRecursesIntoInnerEntities() { + val entity = RichTextBold( + RichTextGroup( + listOf( + RichTextPlain("a "), + RichTextItalic(RichTextPlain("b")) + ) + ) + ) + assertEquals("**a *b***", entity.markdown) + assertEquals("a b", entity.html) + } + + @Test + fun plainMarkdownEscapesSpecialCharacters() { + assertEquals("a\\*b\\_c", RichTextPlain("a*b_c").markdown) + assertEquals("\\[x\\]", RichTextPlain("[x]").markdown) + } + + @Test + fun plainHtmlEscapesAngleBrackets() { + assertEquals("a&lt;b", RichTextPlain("a Date: Tue, 30 Jun 2026 17:21:19 +0600 Subject: [PATCH 14/27] Add rich block markdown and html source builders Add List.toRichMarkdown() / toRichHtml() (and per-block RichBlock .markdown / .html plus RichTextInfo.markdown / .html convenience) that render the Rich Markdown style and Rich HTML style source strings for a whole rich message, ready to feed into InputRichMessageMarkdown / InputRichMessageHTML. All 21 block types are covered, including lists (bullet/ordered/task), tables, block/pull quotations, details, collages, slideshows, maps and media. Media blocks use the Telegram file_id as the source (documented), since Telegram only accepts HTTP(S) URLs for rich media and the parsed model carries no public URL. Co-Authored-By: Claude Opus 4.8 --- tgbotapi.core/api/tgbotapi.core.api | 9 + .../types/rich/RichBlockFormatting.kt | 200 ++++++++++++++++++ .../types/rich/RichBlockFormattingTest.kt | 141 ++++++++++++ 3 files changed, 350 insertions(+) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt create mode 100644 tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormattingTest.kt diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index f1373e71a8..38269f8a67 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -34757,6 +34757,15 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockFooter$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/types/rich/RichBlockFormattingKt { + public static final fun getHtml (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ljava/lang/String; + public static final fun getHtml (Ldev/inmo/tgbotapi/types/rich/RichTextInfo;)Ljava/lang/String; + public static final fun getMarkdown (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ljava/lang/String; + public static final fun getMarkdown (Ldev/inmo/tgbotapi/types/rich/RichTextInfo;)Ljava/lang/String; + public static final fun toRichHtml (Ljava/util/List;)Ljava/lang/String; + public static final fun toRichMarkdown (Ljava/util/List;)Ljava/lang/String; +} + public final class dev/inmo/tgbotapi/types/rich/RichBlockList : dev/inmo/tgbotapi/types/rich/RichBlock { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockList$Companion; public static final field TYPE Ljava/lang/String; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt new file mode 100644 index 0000000000..2511d90d5f --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt @@ -0,0 +1,200 @@ +package dev.inmo.tgbotapi.types.rich + +/** + * Builds the [Rich Markdown style](https://core.telegram.org/bots/api#rich-markdown-style) source string for this list + * of [RichBlock]s. The resulting string may be passed to [InputRichMessageMarkdown]. + * + * Media blocks ([RichBlockPhoto], [RichBlockVideo], [RichBlockAudio], [RichBlockVoiceNote] and [RichBlockAnimation]) are + * rendered using the Telegram file_id as the media source. Telegram only accepts HTTP(S) URLs for rich media, so for + * those blocks the output is a faithful structural representation rather than a directly sendable message. + */ +fun List.toRichMarkdown(): String = joinToString(separator = "\n\n") { it.markdown } + +/** + * Builds the [Rich HTML style](https://core.telegram.org/bots/api#rich-html-style) source string for this list of + * [RichBlock]s. The resulting string may be passed to [InputRichMessageHTML]. See [toRichMarkdown] for the media note. + */ +fun List.toRichHtml(): String = joinToString(separator = "\n") { it.html } + +/** + * [Rich Markdown style](https://core.telegram.org/bots/api#rich-markdown-style) source of all the [RichTextInfo.blocks]. + */ +val RichTextInfo.markdown: String + get() = blocks.toRichMarkdown() + +/** + * [Rich HTML style](https://core.telegram.org/bots/api#rich-html-style) source of all the [RichTextInfo.blocks]. + */ +val RichTextInfo.html: String + get() = blocks.toRichHtml() + +/** + * [Rich Markdown style](https://core.telegram.org/bots/api#rich-markdown-style) source of this single [RichBlock]. + */ +val RichBlock.markdown: String + get() = when (this) { + is RichBlockParagraph -> text.markdown + is RichBlockSectionHeading -> "#".repeat(size) + " " + text.markdown + is RichBlockPreformatted -> "```" + (language ?: "") + "\n" + text.source + "\n```" + is RichBlockFooter -> "
${text.markdown}
" + is RichBlockDivider -> "---" + is RichBlockMathematicalExpression -> "\$\$" + expression + "\$\$" + is RichBlockAnchor -> "" + is RichBlockList -> richBlockListMarkdown(this) + is RichBlockBlockQuotation -> richBlockQuotationMarkdown(blocks, credit) + is RichBlockPullQuotation -> "" + is RichBlockCollage -> richMediaContainerMarkdown("tg-collage", blocks, caption) + is RichBlockSlideshow -> richMediaContainerMarkdown("tg-slideshow", blocks, caption) + is RichBlockTable -> richBlockTableMarkdown(this) + is RichBlockDetails -> "${summary.markdown}\n\n${blocks.toRichMarkdown()}\n\n" + is RichBlockMap -> richBlockMapMarkdown(this) + is RichBlockAnimation -> richMediaMarkdown(animation.fileId.fileId, caption) + is RichBlockAudio -> richMediaMarkdown(audio.fileId.fileId, caption) + is RichBlockPhoto -> richMediaMarkdown(photo.fileId.fileId, caption) + is RichBlockVideo -> richMediaMarkdown(video.fileId.fileId, caption) + is RichBlockVoiceNote -> richMediaMarkdown(voiceNote.fileId.fileId, caption) + is RichBlockThinking -> "${text.markdown}" + } + +/** + * [Rich HTML style](https://core.telegram.org/bots/api#rich-html-style) source of this single [RichBlock]. + */ +val RichBlock.html: String + get() = when (this) { + is RichBlockParagraph -> "

${text.html}

" + is RichBlockSectionHeading -> "${text.html}" + is RichBlockPreformatted -> language?.let { "
${text.html}
" } ?: "
${text.html}
" + is RichBlockFooter -> "
${text.html}
" + is RichBlockDivider -> "
" + is RichBlockMathematicalExpression -> "$expression" + is RichBlockAnchor -> "" + is RichBlockList -> richBlockListHtml(this) + is RichBlockBlockQuotation -> "
${blocks.toRichHtml()}${creditCiteHtml(credit)}
" + is RichBlockPullQuotation -> "" + is RichBlockCollage -> richMediaContainerHtml("tg-collage", blocks, caption) + is RichBlockSlideshow -> richMediaContainerHtml("tg-slideshow", blocks, caption) + is RichBlockTable -> richBlockTableHtml(this) + is RichBlockDetails -> "${summary.html}${blocks.toRichHtml()}" + is RichBlockMap -> richBlockMapHtml(this) + is RichBlockAnimation -> richMediaHtml("video", animation.fileId.fileId, hasSpoiler == true, selfClosing = false, caption = caption) + is RichBlockAudio -> richMediaHtml("audio", audio.fileId.fileId, spoiler = false, selfClosing = false, caption = caption) + is RichBlockPhoto -> richMediaHtml("img", photo.fileId.fileId, hasSpoiler == true, selfClosing = true, caption = caption) + is RichBlockVideo -> richMediaHtml("video", video.fileId.fileId, hasSpoiler == true, selfClosing = false, caption = caption) + is RichBlockVoiceNote -> richMediaHtml("audio", voiceNote.fileId.fileId, spoiler = false, selfClosing = false, caption = caption) + is RichBlockThinking -> "${text.html}" + } + +private fun richOpenAttribute(isOpen: Boolean?): String = if (isOpen == true) " open" else "" + +private fun creditCiteMarkdown(credit: RichText?): String = credit?.let { "${it.markdown}" } ?: "" + +private fun creditCiteHtml(credit: RichText?): String = credit?.let { "${it.html}" } ?: "" + +private fun richBlockListMarkdown(list: RichBlockList): String = + list.items.mapIndexed { index, item -> + val marker = when { + item.hasCheckbox == true -> if (item.isChecked == true) "- [x] " else "- [ ] " + item.labelType != null -> "${item.value ?: (index + 1)}. " + else -> "- " + } + item.blocks.toRichMarkdown().lineSequence().mapIndexed { lineIndex, line -> + if (lineIndex == 0) "$marker$line" else " $line" + }.joinToString(separator = "\n") + }.joinToString(separator = "\n") + +private fun richBlockListHtml(list: RichBlockList): String { + val ordered = list.items.any { it.labelType != null } + val tag = if (ordered) "ol" else "ul" + val items = list.items.joinToString(separator = "") { item -> + val attributes = buildString { + item.value?.let { append(" value=\"$it\"") } + item.labelType?.let { append(" type=\"$it\"") } + } + val checkbox = if (item.hasCheckbox == true) { + "" + } else { + "" + } + "$checkbox${item.blocks.toRichHtml()}" + } + return "<$tag>$items" +} + +private fun richBlockQuotationMarkdown(blocks: List, credit: RichText?): String { + val quoted = blocks.toRichMarkdown().lineSequence().joinToString(separator = "\n") { line -> + if (line.isEmpty()) ">" else "> $line" + } + return quoted + (credit?.let { "\n> ${creditCiteMarkdown(it)}" } ?: "") +} + +private fun richMediaContainerMarkdown(tag: String, blocks: List, caption: RichBlockCaption?): String { + val media = blocks.joinToString(separator = "\n") { it.markdown } + val captionPart = caption?.let { "\n
${it.text.markdown}${creditCiteMarkdown(it.credit)}
" } ?: "" + return "<$tag>\n\n$media$captionPart\n\n" +} + +private fun richMediaContainerHtml(tag: String, blocks: List, caption: RichBlockCaption?): String { + val media = blocks.joinToString(separator = "") { it.html } + val captionPart = caption?.let { "
${it.text.html}${creditCiteHtml(it.credit)}
" } ?: "" + return "<$tag>$media$captionPart" +} + +private fun richMediaMarkdown(source: String, caption: RichBlockCaption?): String = + caption?.let { "![](" + source + " \"" + it.text.source + "\")" } ?: "![]($source)" + +private fun richMediaHtml(tag: String, source: String, spoiler: Boolean, selfClosing: Boolean, caption: RichBlockCaption?): String { + val spoilerAttribute = if (spoiler) " tg-spoiler" else "" + val element = if (selfClosing) "<$tag src=\"$source\"$spoilerAttribute/>" else "<$tag src=\"$source\"$spoilerAttribute>" + return caption?.let { "
$element
${it.text.html}${creditCiteHtml(it.credit)}
" } ?: element +} + +private fun richBlockMapMarkdown(map: RichBlockMap): String { + val element = "" + return map.caption?.let { "
$element
${it.text.markdown}${creditCiteMarkdown(it.credit)}
" } ?: element +} + +private fun richBlockMapHtml(map: RichBlockMap): String { + val element = "" + return map.caption?.let { "
$element
${it.text.html}${creditCiteHtml(it.credit)}
" } ?: element +} + +private fun richBlockTableMarkdown(table: RichBlockTable): String { + if (table.cells.isEmpty()) return "" + fun renderRow(row: List): String = + row.joinToString(separator = " | ", prefix = "| ", postfix = " |") { it.text?.markdown ?: "" } + fun alignment(cell: RichBlockTableCell): String = when (cell.align) { + "left" -> ":---" + "center" -> ":--:" + "right" -> "---:" + else -> "---" + } + val header = table.cells.first() + val lines = mutableListOf( + renderRow(header), + header.joinToString(separator = " | ", prefix = "| ", postfix = " |") { alignment(it) } + ) + table.cells.drop(1).forEach { lines.add(renderRow(it)) } + return lines.joinToString(separator = "\n") +} + +private fun richBlockTableHtml(table: RichBlockTable): String { + val attributes = buildString { + if (table.isBordered == true) append(" bordered") + if (table.isStriped == true) append(" striped") + } + val caption = table.caption?.let { "${it.html}" } ?: "" + val rows = table.cells.joinToString(separator = "") { row -> + val cells = row.joinToString(separator = "") { cell -> + val tag = if (cell.isHeader == true) "th" else "td" + val cellAttributes = buildString { + cell.colspan?.let { append(" colspan=\"$it\"") } + cell.rowspan?.let { append(" rowspan=\"$it\"") } + append(" align=\"${cell.align}\"") + append(" valign=\"${cell.valign}\"") + } + "<$tag$cellAttributes>${cell.text?.html ?: ""}" + } + "$cells" + } + return "$caption$rows" +} diff --git a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormattingTest.kt b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormattingTest.kt new file mode 100644 index 0000000000..95dea255e6 --- /dev/null +++ b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormattingTest.kt @@ -0,0 +1,141 @@ +package dev.inmo.tgbotapi.types.rich + +import kotlin.test.Test +import kotlin.test.assertEquals + +class RichBlockFormattingTest { + @Test + fun paragraph() { + val block = RichBlockParagraph(RichTextPlain("Hello")) + assertEquals("Hello", block.markdown) + assertEquals("

Hello

", block.html) + } + + @Test + fun heading() { + val block = RichBlockSectionHeading(RichTextPlain("Title"), 2) + assertEquals("## Title", block.markdown) + assertEquals("

Title

", block.html) + } + + @Test + fun divider() { + val block = RichBlockDivider() + assertEquals("---", block.markdown) + assertEquals("
", block.html) + } + + @Test + fun footer() { + val block = RichBlockFooter(RichTextPlain("f")) + assertEquals("
f
", block.markdown) + assertEquals("
f
", block.html) + } + + @Test + fun preformatted() { + val withLanguage = RichBlockPreformatted(RichTextPlain("code"), "kotlin") + assertEquals("```kotlin\ncode\n```", withLanguage.markdown) + assertEquals("
code
", withLanguage.html) + + val withoutLanguage = RichBlockPreformatted(RichTextPlain("c")) + assertEquals("```\nc\n```", withoutLanguage.markdown) + assertEquals("
c
", withoutLanguage.html) + } + + @Test + fun mathematicalExpression() { + val block = RichBlockMathematicalExpression("E=mc^2") + assertEquals("\$\$E=mc^2\$\$", block.markdown) + assertEquals("E=mc^2", block.html) + } + + @Test + fun anchor() { + val block = RichBlockAnchor("top") + assertEquals("", block.markdown) + assertEquals("", block.html) + } + + @Test + fun bulletList() { + val block = RichBlockList(listOf(RichBlockListItem("-", listOf(RichBlockParagraph(RichTextPlain("one")))))) + assertEquals("- one", block.markdown) + assertEquals("
  • one

", block.html) + } + + @Test + fun orderedList() { + val block = RichBlockList( + listOf(RichBlockListItem("1", listOf(RichBlockParagraph(RichTextPlain("one"))), labelType = "1")) + ) + assertEquals("1. one", block.markdown) + assertEquals("
  1. one

", block.html) + } + + @Test + fun taskList() { + val block = RichBlockList( + listOf( + RichBlockListItem( + "x", + listOf(RichBlockParagraph(RichTextPlain("done"))), + hasCheckbox = true, + isChecked = true + ) + ) + ) + assertEquals("- [x] done", block.markdown) + assertEquals("
  • done

", block.html) + } + + @Test + fun blockQuotation() { + val block = RichBlockBlockQuotation(listOf(RichBlockParagraph(RichTextPlain("q")))) + assertEquals("> q", block.markdown) + assertEquals("

q

", block.html) + } + + @Test + fun details() { + val block = RichBlockDetails(RichTextPlain("sum"), listOf(RichBlockParagraph(RichTextPlain("body"))), isOpen = true) + assertEquals("
sum\n\nbody\n\n
", block.markdown) + assertEquals("
sum

body

", block.html) + } + + @Test + fun table() { + val block = RichBlockTable( + listOf( + listOf( + RichBlockTableCell(text = RichTextPlain("H1"), isHeader = true, align = "left", valign = "top"), + RichBlockTableCell(text = RichTextPlain("H2"), isHeader = true, align = "center", valign = "top") + ), + listOf( + RichBlockTableCell(text = RichTextPlain("a"), align = "left", valign = "top"), + RichBlockTableCell(text = RichTextPlain("b"), align = "center", valign = "top") + ) + ) + ) + assertEquals("| H1 | H2 |\n| :--- | :--: |\n| a | b |", block.markdown) + assertEquals( + "" + + "
H1H2
ab
", + block.html + ) + } + + @Test + fun listOfBlocksJoinsBlocks() { + val blocks = listOf(RichBlockParagraph(RichTextPlain("a")), RichBlockDivider()) + assertEquals("a\n\n---", blocks.toRichMarkdown()) + assertEquals("

a

\n
", blocks.toRichHtml()) + } + + @Test + fun richTextInfoDelegatesToBlocks() { + val info = RichTextInfo(listOf(RichBlockParagraph(RichTextPlain("p")), RichBlockDivider())) + assertEquals("p\n\n---", info.markdown) + assertEquals("

p

\n
", info.html) + } +} From 6b4999095e8ce7739cb6324a717a1b498bb4eb1b Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 30 Jun 2026 17:29:47 +0600 Subject: [PATCH 15/27] Add rich text / rich block DSL builder Add a type-safe Kotlin DSL for building rich messages: * buildRichText { } - RichTextBuilder with plain() plus a function for every RichTextEntity (String and nested RichTextBuilder overloads where text-bearing); * buildRichBlocks { } / buildRichTextInfo { } - RichBlocksBuilder with the text-bearing and container blocks (paragraph, heading, list, blockQuotation, details, ...), nesting RichText or further blocks per block kind; * RichBlockListBuilder for list items. Container blocks expose nested block/text builders; file/cell-heavy blocks (media, table, collage, slideshow, map) are appended via add() / unary plus. A @DslMarker (RichTextDsl) keeps the nested scopes from leaking receivers. Co-Authored-By: Claude Opus 4.8 --- tgbotapi.core/api/tgbotapi.core.api | 102 +++++++++ .../inmo/tgbotapi/types/rich/RichTextDsl.kt | 208 ++++++++++++++++++ .../tgbotapi/types/rich/RichTextDslTest.kt | 77 +++++++ 3 files changed, 387 insertions(+) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDsl.kt create mode 100644 tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDslTest.kt diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 38269f8a67..95e09872f0 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -34795,6 +34795,14 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockList$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/types/rich/RichBlockListBuilder { + public fun ()V + public final fun build ()Ljava/util/List; + public final fun item (Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public final fun item (Ljava/lang/String;Ljava/lang/String;)V + public static synthetic fun item$default (Ldev/inmo/tgbotapi/types/rich/RichBlockListBuilder;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V +} + public final class dev/inmo/tgbotapi/types/rich/RichBlockListItem { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockListItem$Companion; public fun (Ljava/lang/String;Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;)V @@ -35263,6 +35271,35 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockVoiceNote$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/types/rich/RichBlocksBuilder { + public fun ()V + public final fun add (Ldev/inmo/tgbotapi/types/rich/RichBlock;)V + public final fun anchor (Ljava/lang/String;)V + public final fun blockQuotation (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)V + public static synthetic fun blockQuotation$default (Ldev/inmo/tgbotapi/types/rich/RichBlocksBuilder;Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V + public final fun build ()Ljava/util/List; + public final fun details (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)V + public final fun details (Ljava/lang/String;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)V + public static synthetic fun details$default (Ldev/inmo/tgbotapi/types/rich/RichBlocksBuilder;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V + public static synthetic fun details$default (Ldev/inmo/tgbotapi/types/rich/RichBlocksBuilder;Ljava/lang/String;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V + public final fun divider ()V + public final fun footer (Ljava/lang/String;)V + public final fun footer (Lkotlin/jvm/functions/Function1;)V + public final fun heading (ILjava/lang/String;)V + public final fun heading (ILkotlin/jvm/functions/Function1;)V + public final fun list (Lkotlin/jvm/functions/Function1;)V + public final fun mathematicalExpression (Ljava/lang/String;)V + public final fun paragraph (Ljava/lang/String;)V + public final fun paragraph (Lkotlin/jvm/functions/Function1;)V + public final fun preformatted (Ljava/lang/String;Ljava/lang/String;)V + public static synthetic fun preformatted$default (Ldev/inmo/tgbotapi/types/rich/RichBlocksBuilder;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)V + public final fun pullQuotation (Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;)V + public static synthetic fun pullQuotation$default (Ldev/inmo/tgbotapi/types/rich/RichBlocksBuilder;Ldev/inmo/tgbotapi/types/rich/RichText;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V + public final fun thinking (Ljava/lang/String;)V + public final fun thinking (Lkotlin/jvm/functions/Function1;)V + public final fun unaryPlus (Ldev/inmo/tgbotapi/types/rich/RichBlock;)V +} + public abstract interface class dev/inmo/tgbotapi/types/rich/RichText { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichText$Companion; } @@ -35432,6 +35469,61 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextBotCommand$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/types/rich/RichTextBuilder { + public fun ()V + public final fun add (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun anchor (Ljava/lang/String;)V + public final fun anchorLink (Ljava/lang/String;Ljava/lang/String;)V + public final fun anchorLink (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public final fun bankCard (Ljava/lang/String;Ljava/lang/String;)V + public final fun bankCard (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public final fun bold (Ljava/lang/String;)V + public final fun bold (Lkotlin/jvm/functions/Function1;)V + public final fun botCommand (Ljava/lang/String;Ljava/lang/String;)V + public final fun botCommand (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public final fun build ()Ldev/inmo/tgbotapi/types/rich/RichText; + public final fun cashtag (Ljava/lang/String;Ljava/lang/String;)V + public final fun cashtag (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public final fun code (Ljava/lang/String;)V + public final fun code (Lkotlin/jvm/functions/Function1;)V + public final fun customEmoji-R1fjqgo (Ljava/lang/String;Ljava/lang/String;)V + public final fun dateTime (JLjava/lang/String;Ljava/lang/String;)V + public final fun dateTime (JLjava/lang/String;Lkotlin/jvm/functions/Function1;)V + public final fun email (Ljava/lang/String;Ljava/lang/String;)V + public final fun email (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public final fun hashtag (Ljava/lang/String;Ljava/lang/String;)V + public final fun hashtag (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public final fun italic (Ljava/lang/String;)V + public final fun italic (Lkotlin/jvm/functions/Function1;)V + public final fun marked (Ljava/lang/String;)V + public final fun marked (Lkotlin/jvm/functions/Function1;)V + public final fun mathematicalExpression (Ljava/lang/String;)V + public final fun mention (Ljava/lang/String;Ljava/lang/String;)V + public final fun mention (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public final fun phone (Ljava/lang/String;Ljava/lang/String;)V + public final fun phone (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public final fun plain (Ljava/lang/String;)V + public final fun reference (Ljava/lang/String;Ljava/lang/String;)V + public final fun reference (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public final fun referenceLink (Ljava/lang/String;Ljava/lang/String;)V + public final fun referenceLink (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V + public final fun spoiler (Ljava/lang/String;)V + public final fun spoiler (Lkotlin/jvm/functions/Function1;)V + public final fun strikethrough (Ljava/lang/String;)V + public final fun strikethrough (Lkotlin/jvm/functions/Function1;)V + public final fun subscript (Ljava/lang/String;)V + public final fun subscript (Lkotlin/jvm/functions/Function1;)V + public final fun superscript (Ljava/lang/String;)V + public final fun superscript (Lkotlin/jvm/functions/Function1;)V + public final fun textMention (Ldev/inmo/tgbotapi/types/chat/User;Ljava/lang/String;)V + public final fun textMention (Ldev/inmo/tgbotapi/types/chat/User;Lkotlin/jvm/functions/Function1;)V + public final fun unaryPlus (Ldev/inmo/tgbotapi/types/rich/RichText;)V + public final fun underline (Ljava/lang/String;)V + public final fun underline (Lkotlin/jvm/functions/Function1;)V + public final fun url (Ljava/lang/String;Ljava/lang/String;)V + public final fun url (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V +} + public final class dev/inmo/tgbotapi/types/rich/RichTextCashtag : dev/inmo/tgbotapi/types/rich/RichTextEntity { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextCashtag$Companion; public static final field TYPE Ljava/lang/String; @@ -35564,6 +35656,16 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextDateTime$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public abstract interface annotation class dev/inmo/tgbotapi/types/rich/RichTextDsl : java/lang/annotation/Annotation { +} + +public final class dev/inmo/tgbotapi/types/rich/RichTextDslKt { + public static final fun buildRichBlocks (Lkotlin/jvm/functions/Function1;)Ljava/util/List; + public static final fun buildRichText (Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/rich/RichText; + public static final fun buildRichTextInfo (Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/rich/RichTextInfo; + public static synthetic fun buildRichTextInfo$default (Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextInfo; +} + public final class dev/inmo/tgbotapi/types/rich/RichTextEmailAddress : dev/inmo/tgbotapi/types/rich/RichTextEntity { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextEmailAddress$Companion; public static final field TYPE Ljava/lang/String; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDsl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDsl.kt new file mode 100644 index 0000000000..88805f81f7 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDsl.kt @@ -0,0 +1,208 @@ +package dev.inmo.tgbotapi.types.rich + +import dev.inmo.tgbotapi.types.CustomEmojiId +import dev.inmo.tgbotapi.types.chat.User + +/** + * [DslMarker] for the rich message builders, so the inner [RichTextBuilder], [RichBlocksBuilder] and + * [RichBlockListBuilder] scopes do not leak their receivers into each other. + */ +@DslMarker +annotation class RichTextDsl + +/** + * Builder of a single [RichText]. Each call appends a part; [build] returns a [RichTextPlain]/[RichTextEntity] when there + * is exactly one part, a [RichTextGroup] otherwise. + */ +@RichTextDsl +class RichTextBuilder { + private val parts = mutableListOf() + + /** Appends an already built [RichText]. */ + fun add(richText: RichText) { + parts.add(richText) + } + + /** Appends an already built [RichText]. */ + operator fun RichText.unaryPlus() = add(this) + + /** Plain, non-formatted text. */ + fun plain(text: String) = add(RichTextPlain(text)) + + fun bold(text: String) = add(RichTextBold(RichTextPlain(text))) + fun bold(block: RichTextBuilder.() -> Unit) = add(RichTextBold(buildRichText(block))) + + fun italic(text: String) = add(RichTextItalic(RichTextPlain(text))) + fun italic(block: RichTextBuilder.() -> Unit) = add(RichTextItalic(buildRichText(block))) + + fun underline(text: String) = add(RichTextUnderline(RichTextPlain(text))) + fun underline(block: RichTextBuilder.() -> Unit) = add(RichTextUnderline(buildRichText(block))) + + fun strikethrough(text: String) = add(RichTextStrikethrough(RichTextPlain(text))) + fun strikethrough(block: RichTextBuilder.() -> Unit) = add(RichTextStrikethrough(buildRichText(block))) + + fun spoiler(text: String) = add(RichTextSpoiler(RichTextPlain(text))) + fun spoiler(block: RichTextBuilder.() -> Unit) = add(RichTextSpoiler(buildRichText(block))) + + fun subscript(text: String) = add(RichTextSubscript(RichTextPlain(text))) + fun subscript(block: RichTextBuilder.() -> Unit) = add(RichTextSubscript(buildRichText(block))) + + fun superscript(text: String) = add(RichTextSuperscript(RichTextPlain(text))) + fun superscript(block: RichTextBuilder.() -> Unit) = add(RichTextSuperscript(buildRichText(block))) + + fun marked(text: String) = add(RichTextMarked(RichTextPlain(text))) + fun marked(block: RichTextBuilder.() -> Unit) = add(RichTextMarked(buildRichText(block))) + + fun code(text: String) = add(RichTextCode(RichTextPlain(text))) + fun code(block: RichTextBuilder.() -> Unit) = add(RichTextCode(buildRichText(block))) + + fun dateTime(unixTime: Long, dateTimeFormat: String, text: String) = + add(RichTextDateTime(RichTextPlain(text), unixTime, dateTimeFormat)) + fun dateTime(unixTime: Long, dateTimeFormat: String, block: RichTextBuilder.() -> Unit) = + add(RichTextDateTime(buildRichText(block), unixTime, dateTimeFormat)) + + fun textMention(user: User, text: String) = add(RichTextTextMention(RichTextPlain(text), user)) + fun textMention(user: User, block: RichTextBuilder.() -> Unit) = add(RichTextTextMention(buildRichText(block), user)) + + fun customEmoji(customEmojiId: CustomEmojiId, alternativeText: String) = + add(RichTextCustomEmoji(customEmojiId, alternativeText)) + + fun mathematicalExpression(expression: String) = add(RichTextMathematicalExpression(expression)) + + fun url(url: String, text: String) = add(RichTextUrl(RichTextPlain(text), url)) + fun url(url: String, block: RichTextBuilder.() -> Unit) = add(RichTextUrl(buildRichText(block), url)) + + fun email(emailAddress: String, text: String) = add(RichTextEmailAddress(RichTextPlain(text), emailAddress)) + fun email(emailAddress: String, block: RichTextBuilder.() -> Unit) = + add(RichTextEmailAddress(buildRichText(block), emailAddress)) + + fun phone(phoneNumber: String, text: String) = add(RichTextPhoneNumber(RichTextPlain(text), phoneNumber)) + fun phone(phoneNumber: String, block: RichTextBuilder.() -> Unit) = + add(RichTextPhoneNumber(buildRichText(block), phoneNumber)) + + fun bankCard(bankCardNumber: String, text: String) = add(RichTextBankCardNumber(RichTextPlain(text), bankCardNumber)) + fun bankCard(bankCardNumber: String, block: RichTextBuilder.() -> Unit) = + add(RichTextBankCardNumber(buildRichText(block), bankCardNumber)) + + fun mention(username: String, text: String) = add(RichTextMention(RichTextPlain(text), username)) + fun mention(username: String, block: RichTextBuilder.() -> Unit) = add(RichTextMention(buildRichText(block), username)) + + fun hashtag(hashtag: String, text: String) = add(RichTextHashtag(RichTextPlain(text), hashtag)) + fun hashtag(hashtag: String, block: RichTextBuilder.() -> Unit) = add(RichTextHashtag(buildRichText(block), hashtag)) + + fun cashtag(cashtag: String, text: String) = add(RichTextCashtag(RichTextPlain(text), cashtag)) + fun cashtag(cashtag: String, block: RichTextBuilder.() -> Unit) = add(RichTextCashtag(buildRichText(block), cashtag)) + + fun botCommand(botCommand: String, text: String) = add(RichTextBotCommand(RichTextPlain(text), botCommand)) + fun botCommand(botCommand: String, block: RichTextBuilder.() -> Unit) = + add(RichTextBotCommand(buildRichText(block), botCommand)) + + fun anchor(name: String) = add(RichTextAnchor(name)) + + fun anchorLink(anchorName: String, text: String) = add(RichTextAnchorLink(RichTextPlain(text), anchorName)) + fun anchorLink(anchorName: String, block: RichTextBuilder.() -> Unit) = + add(RichTextAnchorLink(buildRichText(block), anchorName)) + + fun reference(name: String, text: String) = add(RichTextReference(RichTextPlain(text), name)) + fun reference(name: String, block: RichTextBuilder.() -> Unit) = add(RichTextReference(buildRichText(block), name)) + + fun referenceLink(referenceName: String, text: String) = + add(RichTextReferenceLink(RichTextPlain(text), referenceName)) + fun referenceLink(referenceName: String, block: RichTextBuilder.() -> Unit) = + add(RichTextReferenceLink(buildRichText(block), referenceName)) + + fun build(): RichText = when (parts.size) { + 0 -> RichTextGroup(emptyList()) + 1 -> parts.single() + else -> RichTextGroup(parts.toList()) + } +} + +/** + * Builder of [RichBlockListItem]s used inside [RichBlocksBuilder.list]. + */ +@RichTextDsl +class RichBlockListBuilder { + private val items = mutableListOf() + + fun item( + label: String, + hasCheckbox: Boolean? = null, + isChecked: Boolean? = null, + value: Int? = null, + labelType: String? = null, + block: RichBlocksBuilder.() -> Unit + ) { + items.add(RichBlockListItem(label, buildRichBlocks(block), hasCheckbox, isChecked, value, labelType)) + } + + fun item(label: String, text: String) { + items.add(RichBlockListItem(label, listOf(RichBlockParagraph(RichTextPlain(text))))) + } + + fun build(): List = items.toList() +} + +/** + * Builder of a [List] of [RichBlock]s - the root of the rich message DSL. Text-bearing and container blocks have their + * own DSL functions; file/cell-heavy blocks (media, collage, slideshow, table, map) can be appended with [add] / unary + * plus. + */ +@RichTextDsl +class RichBlocksBuilder { + private val blocks = mutableListOf() + + /** Appends an already built [RichBlock]. */ + fun add(block: RichBlock) { + blocks.add(block) + } + + /** Appends an already built [RichBlock]. */ + operator fun RichBlock.unaryPlus() = add(this) + + fun paragraph(text: String) = add(RichBlockParagraph(RichTextPlain(text))) + fun paragraph(block: RichTextBuilder.() -> Unit) = add(RichBlockParagraph(buildRichText(block))) + + fun heading(size: Int, text: String) = add(RichBlockSectionHeading(RichTextPlain(text), size)) + fun heading(size: Int, block: RichTextBuilder.() -> Unit) = add(RichBlockSectionHeading(buildRichText(block), size)) + + fun preformatted(text: String, language: String? = null) = add(RichBlockPreformatted(RichTextPlain(text), language)) + + fun footer(text: String) = add(RichBlockFooter(RichTextPlain(text))) + fun footer(block: RichTextBuilder.() -> Unit) = add(RichBlockFooter(buildRichText(block))) + + fun divider() = add(RichBlockDivider()) + + fun mathematicalExpression(expression: String) = add(RichBlockMathematicalExpression(expression)) + + fun anchor(name: String) = add(RichBlockAnchor(name)) + + fun thinking(text: String) = add(RichBlockThinking(RichTextPlain(text))) + fun thinking(block: RichTextBuilder.() -> Unit) = add(RichBlockThinking(buildRichText(block))) + + fun list(block: RichBlockListBuilder.() -> Unit) = add(RichBlockList(RichBlockListBuilder().apply(block).build())) + + fun blockQuotation(credit: RichText? = null, block: RichBlocksBuilder.() -> Unit) = + add(RichBlockBlockQuotation(buildRichBlocks(block), credit)) + + fun pullQuotation(credit: RichText? = null, block: RichTextBuilder.() -> Unit) = + add(RichBlockPullQuotation(buildRichText(block), credit)) + + fun details(summary: RichText, isOpen: Boolean? = null, block: RichBlocksBuilder.() -> Unit) = + add(RichBlockDetails(summary, buildRichBlocks(block), isOpen)) + + fun details(summary: String, isOpen: Boolean? = null, block: RichBlocksBuilder.() -> Unit) = + details(RichTextPlain(summary), isOpen, block) + + fun build(): List = blocks.toList() +} + +/** Builds a [RichText] using the [RichTextBuilder] DSL. */ +fun buildRichText(block: RichTextBuilder.() -> Unit): RichText = RichTextBuilder().apply(block).build() + +/** Builds a [List] of [RichBlock]s using the [RichBlocksBuilder] DSL. */ +fun buildRichBlocks(block: RichBlocksBuilder.() -> Unit): List = RichBlocksBuilder().apply(block).build() + +/** Builds a [RichTextInfo] using the [RichBlocksBuilder] DSL. */ +fun buildRichTextInfo(isRtl: Boolean? = null, block: RichBlocksBuilder.() -> Unit): RichTextInfo = + RichTextInfo(buildRichBlocks(block), isRtl) diff --git a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDslTest.kt b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDslTest.kt new file mode 100644 index 0000000000..c4f3ca274c --- /dev/null +++ b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDslTest.kt @@ -0,0 +1,77 @@ +package dev.inmo.tgbotapi.types.rich + +import kotlin.test.Test +import kotlin.test.assertEquals + +class RichTextDslTest { + @Test + fun buildsRichTextGroup() { + val richText = buildRichText { + plain("a ") + bold("b") + italic { + plain("c") + bold("d") + } + } + assertEquals( + RichTextGroup( + listOf( + RichTextPlain("a "), + RichTextBold(RichTextPlain("b")), + RichTextItalic(RichTextGroup(listOf(RichTextPlain("c"), RichTextBold(RichTextPlain("d"))))) + ) + ), + richText + ) + } + + @Test + fun singlePartUnwraps() { + assertEquals(RichTextBold(RichTextPlain("x")), buildRichText { bold("x") }) + } + + @Test + fun rendersMarkdown() { + assertEquals("a **b**", buildRichText { plain("a "); bold("b") }.markdown) + } + + @Test + fun buildsBlocks() { + val blocks = buildRichBlocks { + heading(1, "Title") + paragraph { + plain("Hello ") + bold("world") + } + divider() + list { + item("1", "first") + item("2", labelType = "1") { paragraph("second") } + } + blockQuotation { + paragraph("quoted") + } + } + assertEquals(5, blocks.size) + assertEquals(RichBlockSectionHeading(RichTextPlain("Title"), 1), blocks[0]) + assertEquals( + RichBlockParagraph(RichTextGroup(listOf(RichTextPlain("Hello "), RichTextBold(RichTextPlain("world"))))), + blocks[1] + ) + assertEquals(RichBlockDivider(), blocks[2]) + val list = blocks[3] as RichBlockList + assertEquals(2, list.items.size) + assertEquals(RichBlockListItem("1", listOf(RichBlockParagraph(RichTextPlain("first")))), list.items[0]) + assertEquals(RichBlockBlockQuotation(listOf(RichBlockParagraph(RichTextPlain("quoted")))), blocks[4]) + } + + @Test + fun buildsRichTextInfo() { + val info = buildRichTextInfo(isRtl = true) { + paragraph("p") + } + assertEquals(RichTextInfo(listOf(RichBlockParagraph(RichTextPlain("p"))), true), info) + assertEquals("p", info.markdown) + } +} From e793eea943195aced01291c80050248f69225969 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 30 Jun 2026 20:55:46 +0600 Subject: [PATCH 16/27] Move RichText/RichBlock markdown and html into members Add markdown and html as members of the RichText and RichBlock sealed interfaces and override them in every inheritor (RichTextPlain, RichTextGroup and all 21 RichBlock subtypes), mirroring the existing RichTextEntity implementation. The former RichText/RichBlock.markdown and .html extension properties (which dispatched via a when over each subtype) are removed; the shared RichBlock render helpers become internal so the overrides can reuse them. Co-Authored-By: Claude Opus 4.8 --- tgbotapi.core/api/tgbotapi.core.api | 54 ++++++++- .../dev/inmo/tgbotapi/types/rich/RichBlock.kt | 10 ++ .../types/rich/RichBlockFormatting.kt | 84 +++----------- .../inmo/tgbotapi/types/rich/RichBlocks.kt | 105 ++++++++++++++++++ .../dev/inmo/tgbotapi/types/rich/RichText.kt | 31 +++++- .../tgbotapi/types/rich/RichTextFormatting.kt | 23 ---- 6 files changed, 205 insertions(+), 102 deletions(-) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 95e09872f0..e564b1c870 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -34473,6 +34473,8 @@ public final class dev/inmo/tgbotapi/types/rich/InputRichMessageKt { public abstract interface class dev/inmo/tgbotapi/types/rich/RichBlock { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlock$Companion; + public abstract fun getHtml ()Ljava/lang/String; + public abstract fun getMarkdown ()Ljava/lang/String; public abstract fun getType ()Ljava/lang/String; } @@ -34488,6 +34490,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockAnchor : dev/inmo/tgbot public final fun copy (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichBlockAnchor; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockAnchor;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockAnchor; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getName ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -34523,6 +34527,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockAnimation : dev/inmo/tg public final fun getAnimation ()Ldev/inmo/tgbotapi/types/files/AnimationFile; public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; public final fun getHasSpoiler ()Ljava/lang/Boolean; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -34555,6 +34561,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockAudio : dev/inmo/tgbota public fun equals (Ljava/lang/Object;)Z public final fun getAudio ()Ldev/inmo/tgbotapi/types/files/AudioFile; public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -34587,6 +34595,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation : dev/in public fun equals (Ljava/lang/Object;)Z public final fun getBlocks ()Ljava/util/List; public final fun getCredit ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -34649,6 +34659,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockCollage : dev/inmo/tgbo public fun equals (Ljava/lang/Object;)Z public final fun getBlocks ()Ljava/util/List; public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -34681,6 +34693,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockDetails : dev/inmo/tgbo public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockDetails;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/util/List;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockDetails; public fun equals (Ljava/lang/Object;)Z public final fun getBlocks ()Ljava/util/List; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getSummary ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -34708,6 +34722,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockDivider : dev/inmo/tgbo public static final field TYPE Ljava/lang/String; public fun ()V public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -34736,6 +34752,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockFooter : dev/inmo/tgbot public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichBlockFooter; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockFooter;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockFooter; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -34758,9 +34776,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockFooter$Companion { } public final class dev/inmo/tgbotapi/types/rich/RichBlockFormattingKt { - public static final fun getHtml (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ljava/lang/String; public static final fun getHtml (Ldev/inmo/tgbotapi/types/rich/RichTextInfo;)Ljava/lang/String; - public static final fun getMarkdown (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ljava/lang/String; public static final fun getMarkdown (Ldev/inmo/tgbotapi/types/rich/RichTextInfo;)Ljava/lang/String; public static final fun toRichHtml (Ljava/util/List;)Ljava/lang/String; public static final fun toRichMarkdown (Ljava/util/List;)Ljava/lang/String; @@ -34774,7 +34790,9 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockList : dev/inmo/tgbotap public final fun copy (Ljava/util/List;)Ldev/inmo/tgbotapi/types/rich/RichBlockList; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockList;Ljava/util/List;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockList; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; public final fun getItems ()Ljava/util/List; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -34856,7 +34874,9 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockMap : dev/inmo/tgbotapi public fun equals (Ljava/lang/Object;)Z public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; public final fun getHeight ()I + public fun getHtml ()Ljava/lang/String; public final fun getLocation ()Ldev/inmo/tgbotapi/types/location/StaticLocation; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public final fun getWidth ()I public final fun getZoom ()I @@ -34888,6 +34908,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression; public fun equals (Ljava/lang/Object;)Z public final fun getExpression ()Ljava/lang/String; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -34916,6 +34938,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockParagraph : dev/inmo/tg public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -34950,6 +34974,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockPhoto : dev/inmo/tgbota public fun equals (Ljava/lang/Object;)Z public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; public final fun getHasSpoiler ()Ljava/lang/Boolean; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getPhoto-bGlShw4 ()Ljava/util/List; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -34981,7 +35007,9 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockPreformatted : dev/inmo public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichBlockPreformatted; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockPreformatted;Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockPreformatted; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; public final fun getLanguage ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35014,6 +35042,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockPullQuotation : dev/inm public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockPullQuotation;Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockPullQuotation; public fun equals (Ljava/lang/Object;)Z public final fun getCredit ()Ldev/inmo/tgbotapi/types/rich/RichText; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35044,6 +35074,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockSectionHeading : dev/in public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;I)Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading;Ldev/inmo/tgbotapi/types/rich/RichText;IILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getSize ()I public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; @@ -35082,6 +35114,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockSlideshow : dev/inmo/tg public fun equals (Ljava/lang/Object;)Z public final fun getBlocks ()Ljava/util/List; public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -35116,6 +35150,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockTable : dev/inmo/tgbota public fun equals (Ljava/lang/Object;)Z public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichText; public final fun getCells ()Ljava/util/List; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public final fun isBordered ()Ljava/lang/Boolean; @@ -35184,6 +35220,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockThinking : dev/inmo/tgb public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;)Ldev/inmo/tgbotapi/types/rich/RichBlockThinking; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockThinking;Ldev/inmo/tgbotapi/types/rich/RichText;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockThinking; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35218,6 +35256,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockVideo : dev/inmo/tgbota public fun equals (Ljava/lang/Object;)Z public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; public final fun getHasSpoiler ()Ljava/lang/Boolean; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public final fun getVideo ()Ldev/inmo/tgbotapi/types/files/VideoFile; public fun hashCode ()I @@ -35250,6 +35290,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockVoiceNote : dev/inmo/tg public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote;Ldev/inmo/tgbotapi/types/files/VoiceFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote; public fun equals (Ljava/lang/Object;)Z public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public final fun getVoiceNote ()Ldev/inmo/tgbotapi/types/files/VoiceFile; public fun hashCode ()I @@ -35302,6 +35344,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlocksBuilder { public abstract interface class dev/inmo/tgbotapi/types/rich/RichText { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichText$Companion; + public abstract fun getHtml ()Ljava/lang/String; + public abstract fun getMarkdown ()Ljava/lang/String; } public final class dev/inmo/tgbotapi/types/rich/RichText$Companion { @@ -35716,8 +35760,6 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextEntitySerializer : kotli public final class dev/inmo/tgbotapi/types/rich/RichTextFormattingKt { public static final fun escapeRichMarkdown (Ljava/lang/String;)Ljava/lang/String; - public static final fun getHtml (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; - public static final fun getMarkdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public static final fun getSource (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; } @@ -35728,6 +35770,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextGroup : dev/inmo/tgbotap public final fun copy (Ljava/util/List;)Ldev/inmo/tgbotapi/types/rich/RichTextGroup; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextGroup;Ljava/util/List;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextGroup; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getParts ()Ljava/util/List; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -35977,6 +36021,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextPlain : dev/inmo/tgbotap public final fun copy (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextPlain; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextPlain;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextPlain; public fun equals (Ljava/lang/Object;)Z + public fun getHtml ()Ljava/lang/String; + public fun getMarkdown ()Ljava/lang/String; public final fun getText ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlock.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlock.kt index 847003b0b2..6ab799ec33 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlock.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlock.kt @@ -18,6 +18,16 @@ import kotlinx.serialization.json.jsonPrimitive @ClassCastsIncluded sealed interface RichBlock { val type: String + + /** + * [Rich Markdown style](https://core.telegram.org/bots/api#rich-markdown-style) source of this single [RichBlock]. + */ + val markdown: String + + /** + * [Rich HTML style](https://core.telegram.org/bots/api#rich-html-style) source of this single [RichBlock]. + */ + val html: String } object RichBlockSerializer : JsonContentPolymorphicSerializer(RichBlock::class) { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt index 2511d90d5f..cefa811de3 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt @@ -28,69 +28,13 @@ val RichTextInfo.markdown: String val RichTextInfo.html: String get() = blocks.toRichHtml() -/** - * [Rich Markdown style](https://core.telegram.org/bots/api#rich-markdown-style) source of this single [RichBlock]. - */ -val RichBlock.markdown: String - get() = when (this) { - is RichBlockParagraph -> text.markdown - is RichBlockSectionHeading -> "#".repeat(size) + " " + text.markdown - is RichBlockPreformatted -> "```" + (language ?: "") + "\n" + text.source + "\n```" - is RichBlockFooter -> "
${text.markdown}
" - is RichBlockDivider -> "---" - is RichBlockMathematicalExpression -> "\$\$" + expression + "\$\$" - is RichBlockAnchor -> "" - is RichBlockList -> richBlockListMarkdown(this) - is RichBlockBlockQuotation -> richBlockQuotationMarkdown(blocks, credit) - is RichBlockPullQuotation -> "" - is RichBlockCollage -> richMediaContainerMarkdown("tg-collage", blocks, caption) - is RichBlockSlideshow -> richMediaContainerMarkdown("tg-slideshow", blocks, caption) - is RichBlockTable -> richBlockTableMarkdown(this) - is RichBlockDetails -> "${summary.markdown}\n\n${blocks.toRichMarkdown()}\n\n" - is RichBlockMap -> richBlockMapMarkdown(this) - is RichBlockAnimation -> richMediaMarkdown(animation.fileId.fileId, caption) - is RichBlockAudio -> richMediaMarkdown(audio.fileId.fileId, caption) - is RichBlockPhoto -> richMediaMarkdown(photo.fileId.fileId, caption) - is RichBlockVideo -> richMediaMarkdown(video.fileId.fileId, caption) - is RichBlockVoiceNote -> richMediaMarkdown(voiceNote.fileId.fileId, caption) - is RichBlockThinking -> "${text.markdown}" - } +internal fun richOpenAttribute(isOpen: Boolean?): String = if (isOpen == true) " open" else "" -/** - * [Rich HTML style](https://core.telegram.org/bots/api#rich-html-style) source of this single [RichBlock]. - */ -val RichBlock.html: String - get() = when (this) { - is RichBlockParagraph -> "

${text.html}

" - is RichBlockSectionHeading -> "${text.html}" - is RichBlockPreformatted -> language?.let { "
${text.html}
" } ?: "
${text.html}
" - is RichBlockFooter -> "
${text.html}
" - is RichBlockDivider -> "
" - is RichBlockMathematicalExpression -> "$expression" - is RichBlockAnchor -> "" - is RichBlockList -> richBlockListHtml(this) - is RichBlockBlockQuotation -> "
${blocks.toRichHtml()}${creditCiteHtml(credit)}
" - is RichBlockPullQuotation -> "" - is RichBlockCollage -> richMediaContainerHtml("tg-collage", blocks, caption) - is RichBlockSlideshow -> richMediaContainerHtml("tg-slideshow", blocks, caption) - is RichBlockTable -> richBlockTableHtml(this) - is RichBlockDetails -> "${summary.html}${blocks.toRichHtml()}" - is RichBlockMap -> richBlockMapHtml(this) - is RichBlockAnimation -> richMediaHtml("video", animation.fileId.fileId, hasSpoiler == true, selfClosing = false, caption = caption) - is RichBlockAudio -> richMediaHtml("audio", audio.fileId.fileId, spoiler = false, selfClosing = false, caption = caption) - is RichBlockPhoto -> richMediaHtml("img", photo.fileId.fileId, hasSpoiler == true, selfClosing = true, caption = caption) - is RichBlockVideo -> richMediaHtml("video", video.fileId.fileId, hasSpoiler == true, selfClosing = false, caption = caption) - is RichBlockVoiceNote -> richMediaHtml("audio", voiceNote.fileId.fileId, spoiler = false, selfClosing = false, caption = caption) - is RichBlockThinking -> "${text.html}" - } +internal fun creditCiteMarkdown(credit: RichText?): String = credit?.let { "${it.markdown}" } ?: "" -private fun richOpenAttribute(isOpen: Boolean?): String = if (isOpen == true) " open" else "" +internal fun creditCiteHtml(credit: RichText?): String = credit?.let { "${it.html}" } ?: "" -private fun creditCiteMarkdown(credit: RichText?): String = credit?.let { "${it.markdown}" } ?: "" - -private fun creditCiteHtml(credit: RichText?): String = credit?.let { "${it.html}" } ?: "" - -private fun richBlockListMarkdown(list: RichBlockList): String = +internal fun richBlockListMarkdown(list: RichBlockList): String = list.items.mapIndexed { index, item -> val marker = when { item.hasCheckbox == true -> if (item.isChecked == true) "- [x] " else "- [ ] " @@ -102,7 +46,7 @@ private fun richBlockListMarkdown(list: RichBlockList): String = }.joinToString(separator = "\n") }.joinToString(separator = "\n") -private fun richBlockListHtml(list: RichBlockList): String { +internal fun richBlockListHtml(list: RichBlockList): String { val ordered = list.items.any { it.labelType != null } val tag = if (ordered) "ol" else "ul" val items = list.items.joinToString(separator = "") { item -> @@ -120,45 +64,45 @@ private fun richBlockListHtml(list: RichBlockList): String { return "<$tag>$items" } -private fun richBlockQuotationMarkdown(blocks: List, credit: RichText?): String { +internal fun richBlockQuotationMarkdown(blocks: List, credit: RichText?): String { val quoted = blocks.toRichMarkdown().lineSequence().joinToString(separator = "\n") { line -> if (line.isEmpty()) ">" else "> $line" } return quoted + (credit?.let { "\n> ${creditCiteMarkdown(it)}" } ?: "") } -private fun richMediaContainerMarkdown(tag: String, blocks: List, caption: RichBlockCaption?): String { +internal fun richMediaContainerMarkdown(tag: String, blocks: List, caption: RichBlockCaption?): String { val media = blocks.joinToString(separator = "\n") { it.markdown } val captionPart = caption?.let { "\n
${it.text.markdown}${creditCiteMarkdown(it.credit)}
" } ?: "" return "<$tag>\n\n$media$captionPart\n\n" } -private fun richMediaContainerHtml(tag: String, blocks: List, caption: RichBlockCaption?): String { +internal fun richMediaContainerHtml(tag: String, blocks: List, caption: RichBlockCaption?): String { val media = blocks.joinToString(separator = "") { it.html } val captionPart = caption?.let { "
${it.text.html}${creditCiteHtml(it.credit)}
" } ?: "" return "<$tag>$media$captionPart" } -private fun richMediaMarkdown(source: String, caption: RichBlockCaption?): String = +internal fun richMediaMarkdown(source: String, caption: RichBlockCaption?): String = caption?.let { "![](" + source + " \"" + it.text.source + "\")" } ?: "![]($source)" -private fun richMediaHtml(tag: String, source: String, spoiler: Boolean, selfClosing: Boolean, caption: RichBlockCaption?): String { +internal fun richMediaHtml(tag: String, source: String, spoiler: Boolean, selfClosing: Boolean, caption: RichBlockCaption?): String { val spoilerAttribute = if (spoiler) " tg-spoiler" else "" val element = if (selfClosing) "<$tag src=\"$source\"$spoilerAttribute/>" else "<$tag src=\"$source\"$spoilerAttribute>" return caption?.let { "
$element
${it.text.html}${creditCiteHtml(it.credit)}
" } ?: element } -private fun richBlockMapMarkdown(map: RichBlockMap): String { +internal fun richBlockMapMarkdown(map: RichBlockMap): String { val element = "" return map.caption?.let { "
$element
${it.text.markdown}${creditCiteMarkdown(it.credit)}
" } ?: element } -private fun richBlockMapHtml(map: RichBlockMap): String { +internal fun richBlockMapHtml(map: RichBlockMap): String { val element = "" return map.caption?.let { "
$element
${it.text.html}${creditCiteHtml(it.credit)}
" } ?: element } -private fun richBlockTableMarkdown(table: RichBlockTable): String { +internal fun richBlockTableMarkdown(table: RichBlockTable): String { if (table.cells.isEmpty()) return "" fun renderRow(row: List): String = row.joinToString(separator = " | ", prefix = "| ", postfix = " |") { it.text?.markdown ?: "" } @@ -177,7 +121,7 @@ private fun richBlockTableMarkdown(table: RichBlockTable): String { return lines.joinToString(separator = "\n") } -private fun richBlockTableHtml(table: RichBlockTable): String { +internal fun richBlockTableHtml(table: RichBlockTable): String { val attributes = buildString { if (table.isBordered == true) append(" bordered") if (table.isStriped == true) append(" striped") diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt index ddf293aff2..adbd6189cb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt @@ -49,6 +49,11 @@ data class RichBlockParagraph( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = text.markdown + override val html: String + get() = "

${text.html}

" + companion object { const val TYPE = "paragraph" } @@ -73,6 +78,11 @@ data class RichBlockSectionHeading( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "#".repeat(size) + " " + text.markdown + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "heading" } @@ -94,6 +104,11 @@ data class RichBlockPreformatted( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "```" + (language ?: "") + "\n" + text.source + "\n```" + override val html: String + get() = language?.let { "
${text.html}
" } ?: "
${text.html}
" + companion object { const val TYPE = "pre" } @@ -113,6 +128,11 @@ data class RichBlockFooter( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "
${text.markdown}
" + override val html: String + get() = "
${text.html}
" + companion object { const val TYPE = "footer" } @@ -129,6 +149,11 @@ class RichBlockDivider : RichBlock { @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "---" + override val html: String + get() = "
" + override fun equals(other: Any?): Boolean = other is RichBlockDivider override fun hashCode(): Int = TYPE.hashCode() @@ -154,6 +179,11 @@ data class RichBlockMathematicalExpression( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "\$\$" + expression + "\$\$" + override val html: String + get() = "$expression" + companion object { const val TYPE = "mathematical_expression" } @@ -173,6 +203,11 @@ data class RichBlockAnchor( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "" + override val html: String + get() = "" + companion object { const val TYPE = "anchor" } @@ -192,6 +227,11 @@ data class RichBlockList( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = richBlockListMarkdown(this) + override val html: String + get() = richBlockListHtml(this) + companion object { const val TYPE = "list" } @@ -213,6 +253,11 @@ data class RichBlockBlockQuotation( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = richBlockQuotationMarkdown(blocks, credit) + override val html: String + get() = "
${blocks.toRichHtml()}${creditCiteHtml(credit)}
" + companion object { const val TYPE = "blockquote" } @@ -234,6 +279,11 @@ data class RichBlockPullQuotation( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "" + override val html: String + get() = "" + companion object { const val TYPE = "pullquote" } @@ -255,6 +305,11 @@ data class RichBlockCollage( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = richMediaContainerMarkdown("tg-collage", blocks, caption) + override val html: String + get() = richMediaContainerHtml("tg-collage", blocks, caption) + companion object { const val TYPE = "collage" } @@ -276,6 +331,11 @@ data class RichBlockSlideshow( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = richMediaContainerMarkdown("tg-slideshow", blocks, caption) + override val html: String + get() = richMediaContainerHtml("tg-slideshow", blocks, caption) + companion object { const val TYPE = "slideshow" } @@ -301,6 +361,11 @@ data class RichBlockTable( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = richBlockTableMarkdown(this) + override val html: String + get() = richBlockTableHtml(this) + companion object { const val TYPE = "table" } @@ -324,6 +389,11 @@ data class RichBlockDetails( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "${summary.markdown}\n\n${blocks.toRichMarkdown()}\n\n" + override val html: String + get() = "${summary.html}${blocks.toRichHtml()}" + companion object { const val TYPE = "details" } @@ -354,6 +424,11 @@ data class RichBlockMap( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = richBlockMapMarkdown(this) + override val html: String + get() = richBlockMapHtml(this) + companion object { const val TYPE = "map" } @@ -377,6 +452,11 @@ data class RichBlockAnimation( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = richMediaMarkdown(animation.fileId.fileId, caption) + override val html: String + get() = richMediaHtml("video", animation.fileId.fileId, hasSpoiler == true, selfClosing = false, caption = caption) + companion object { const val TYPE = "animation" } @@ -398,6 +478,11 @@ data class RichBlockAudio( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = richMediaMarkdown(audio.fileId.fileId, caption) + override val html: String + get() = richMediaHtml("audio", audio.fileId.fileId, spoiler = false, selfClosing = false, caption = caption) + companion object { const val TYPE = "audio" } @@ -421,6 +506,11 @@ data class RichBlockPhoto( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = richMediaMarkdown(photo.fileId.fileId, caption) + override val html: String + get() = richMediaHtml("img", photo.fileId.fileId, hasSpoiler == true, selfClosing = true, caption = caption) + companion object { const val TYPE = "photo" } @@ -444,6 +534,11 @@ data class RichBlockVideo( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = richMediaMarkdown(video.fileId.fileId, caption) + override val html: String + get() = richMediaHtml("video", video.fileId.fileId, hasSpoiler == true, selfClosing = false, caption = caption) + companion object { const val TYPE = "video" } @@ -465,6 +560,11 @@ data class RichBlockVoiceNote( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = richMediaMarkdown(voiceNote.fileId.fileId, caption) + override val html: String + get() = richMediaHtml("audio", voiceNote.fileId.fileId, spoiler = false, selfClosing = false, caption = caption) + companion object { const val TYPE = "voice_note" } @@ -484,6 +584,11 @@ data class RichBlockThinking( @SerialName(typeField) override val type: String = TYPE + override val markdown: String + get() = "${text.markdown}" + override val html: String + get() = "${text.html}" + companion object { const val TYPE = "thinking" } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt index f270d7dada..db75fb6ccb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt @@ -1,6 +1,7 @@ package dev.inmo.tgbotapi.types.rich import dev.inmo.tgbotapi.types.typeField +import dev.inmo.tgbotapi.utils.extensions.toHtml import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded import kotlinx.serialization.DeserializationStrategy import kotlinx.serialization.KSerializer @@ -18,7 +19,17 @@ import kotlinx.serialization.json.* */ @Serializable(RichTextSerializer::class) @ClassCastsIncluded -sealed interface RichText +sealed interface RichText { + /** + * [Rich Markdown style](https://core.telegram.org/bots/api#rich-markdown-style) representation of this [RichText]. + */ + val markdown: String + + /** + * [Rich HTML style](https://core.telegram.org/bots/api#rich-html-style) representation of this [RichText]. + */ + val html: String +} /** * A plain (non-formatted) part of a [RichText]. Serialized as a bare JSON string. @@ -26,7 +37,12 @@ sealed interface RichText @Serializable data class RichTextPlain( val text: String -) : RichText +) : RichText { + override val markdown: String + get() = text.escapeRichMarkdown() + override val html: String + get() = text.toHtml() +} /** * A group of [RichText]s. Serialized as a JSON array. @@ -34,7 +50,12 @@ data class RichTextPlain( @Serializable data class RichTextGroup( val parts: List -) : RichText +) : RichText { + override val markdown: String + get() = parts.joinToString(separator = "") { it.markdown } + override val html: String + get() = parts.joinToString(separator = "") { it.html } +} /** * Any typed (formatted) part of a [RichText]. Serialized as a JSON object with the [type] discriminator. @@ -43,8 +64,8 @@ data class RichTextGroup( sealed interface RichTextEntity : RichText { val type: String - val markdown: String - val html: String + override val markdown: String + override val html: String } object RichTextSerializer : KSerializer { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormatting.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormatting.kt index 69fbe2da81..3c031ecf50 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormatting.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormatting.kt @@ -1,8 +1,5 @@ package dev.inmo.tgbotapi.types.rich -import dev.inmo.tgbotapi.types.internalUserLinkBeginning -import dev.inmo.tgbotapi.utils.extensions.toHtml - /** * Characters which have a special meaning in the * [Rich Markdown style](https://core.telegram.org/bots/api#rich-markdown-style) and must be escaped with a backslash @@ -60,23 +57,3 @@ val RichText.source: String is RichTextReference -> text.source is RichTextReferenceLink -> text.source } - -/** - * [Rich Markdown style](https://core.telegram.org/bots/api#rich-markdown-style) representation of this [RichText]. - */ -val RichText.markdown: String - get() = when (this) { - is RichTextPlain -> text.escapeRichMarkdown() - is RichTextGroup -> parts.joinToString(separator = "") { it.markdown } - is RichTextEntity -> markdown - } - -/** - * [Rich HTML style](https://core.telegram.org/bots/api#rich-html-style) representation of this [RichText]. - */ -val RichText.html: String - get() = when (this) { - is RichTextPlain -> text.toHtml() - is RichTextGroup -> parts.joinToString(separator = "") { it.html } - is RichTextEntity -> html - } From 8acd7453a62e80023ce8730adbb7a05080bf0cc4 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 30 Jun 2026 21:41:32 +0600 Subject: [PATCH 17/27] Move rich markdown and html bodies into companion objects For every RichText and RichBlock type the markdown and html rendering now lives in companion-object functions taking the relevant fields, and the property overrides are plain value initializers that reuse those functions (e.g. RichTextEmailAddress.markdown(text, emailAddress)). Class-specific render helpers (list, table, map, block quotation, details open attribute) move into the matching companions; helpers shared across several types (credit cite, media and media container rendering) stay internal top-level functions. Co-Authored-By: Claude Opus 4.8 --- tgbotapi.core/api/tgbotapi.core.api | 96 +++++++ .../types/rich/RichBlockFormatting.kt | 90 ------ .../inmo/tgbotapi/types/rich/RichBlocks.kt | 269 ++++++++++++------ .../dev/inmo/tgbotapi/types/rich/RichText.kt | 22 +- .../tgbotapi/types/rich/RichTextEntities.kt | 206 +++++++------- 5 files changed, 401 insertions(+), 282 deletions(-) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index e564b1c870..2994b3843a 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -34510,6 +34510,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockAnchor$$seria } public final class dev/inmo/tgbotapi/types/rich/RichBlockAnchor$Companion { + public final fun html (Ljava/lang/String;)Ljava/lang/String; + public final fun markdown (Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -34546,6 +34548,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockAnimation$$se } public final class dev/inmo/tgbotapi/types/rich/RichBlockAnimation$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -34580,6 +34584,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockAudio$$serial } public final class dev/inmo/tgbotapi/types/rich/RichBlockAudio$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -34614,6 +34620,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockBlockQuotatio } public final class dev/inmo/tgbotapi/types/rich/RichBlockBlockQuotation$Companion { + public final fun html (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -34678,6 +34686,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockCollage$$seri } public final class dev/inmo/tgbotapi/types/rich/RichBlockCollage$Companion { + public final fun html (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; + public final fun markdown (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -34714,6 +34724,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockDetails$$seri } public final class dev/inmo/tgbotapi/types/rich/RichBlockDetails$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/util/List;Ljava/lang/Boolean;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/util/List;Ljava/lang/Boolean;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -34741,6 +34753,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockDivider$$seri } public final class dev/inmo/tgbotapi/types/rich/RichBlockDivider$Companion { + public final fun html ()Ljava/lang/String; + public final fun markdown ()Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -34772,6 +34786,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockFooter$$seria } public final class dev/inmo/tgbotapi/types/rich/RichBlockFooter$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -34810,6 +34826,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockList$$seriali } public final class dev/inmo/tgbotapi/types/rich/RichBlockList$Companion { + public final fun html (Ljava/util/List;)Ljava/lang/String; + public final fun markdown (Ljava/util/List;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -34896,6 +34914,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockMap$$serializ } public final class dev/inmo/tgbotapi/types/rich/RichBlockMap$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/location/StaticLocation;ILdev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/location/StaticLocation;ILdev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -34927,6 +34947,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockMathematicalE } public final class dev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression$Companion { + public final fun html (Ljava/lang/String;)Ljava/lang/String; + public final fun markdown (Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -34958,6 +34980,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockParagraph$$se } public final class dev/inmo/tgbotapi/types/rich/RichBlockParagraph$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -34994,6 +35018,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockPhoto$$serial } public final class dev/inmo/tgbotapi/types/rich/RichBlockPhoto$Companion { + public final fun html-OKnyJrA (Ljava/util/List;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; + public final fun markdown-ACrxq0Q (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35028,6 +35054,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockPreformatted$ } public final class dev/inmo/tgbotapi/types/rich/RichBlockPreformatted$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35062,6 +35090,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockPullQuotation } public final class dev/inmo/tgbotapi/types/rich/RichBlockPullQuotation$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35095,6 +35125,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockSectionHeadin } public final class dev/inmo/tgbotapi/types/rich/RichBlockSectionHeading$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;I)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;I)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35133,6 +35165,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockSlideshow$$se } public final class dev/inmo/tgbotapi/types/rich/RichBlockSlideshow$Companion { + public final fun html (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; + public final fun markdown (Ljava/util/List;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35171,6 +35205,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockTable$$serial } public final class dev/inmo/tgbotapi/types/rich/RichBlockTable$Companion { + public final fun html (Ljava/util/List;Ljava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ljava/util/List;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35240,6 +35276,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockThinking$$ser } public final class dev/inmo/tgbotapi/types/rich/RichBlockThinking$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35276,6 +35314,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockVideo$$serial } public final class dev/inmo/tgbotapi/types/rich/RichBlockVideo$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35310,6 +35350,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichBlockVoiceNote$$se } public final class dev/inmo/tgbotapi/types/rich/RichBlockVoiceNote$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/files/VoiceFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/files/VoiceFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35380,6 +35422,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextAnchor$$serial } public final class dev/inmo/tgbotapi/types/rich/RichTextAnchor$Companion { + public final fun html (Ljava/lang/String;)Ljava/lang/String; + public final fun markdown (Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35413,6 +35457,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextAnchorLink$$se } public final class dev/inmo/tgbotapi/types/rich/RichTextAnchorLink$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35446,6 +35492,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextBankCardNumber } public final class dev/inmo/tgbotapi/types/rich/RichTextBankCardNumber$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35477,6 +35525,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextBold$$serializ } public final class dev/inmo/tgbotapi/types/rich/RichTextBold$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35510,6 +35560,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextBotCommand$$se } public final class dev/inmo/tgbotapi/types/rich/RichTextBotCommand$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35598,6 +35650,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextCashtag$$seria } public final class dev/inmo/tgbotapi/types/rich/RichTextCashtag$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35629,6 +35683,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextCode$$serializ } public final class dev/inmo/tgbotapi/types/rich/RichTextCode$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35662,6 +35718,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextCustomEmoji$$s } public final class dev/inmo/tgbotapi/types/rich/RichTextCustomEmoji$Companion { + public final fun html-R1fjqgo (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; + public final fun markdown-R1fjqgo (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35697,6 +35755,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextDateTime$$seri } public final class dev/inmo/tgbotapi/types/rich/RichTextDateTime$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;JLjava/lang/String;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;JLjava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35740,6 +35800,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextEmailAddress$$ } public final class dev/inmo/tgbotapi/types/rich/RichTextEmailAddress$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35789,6 +35851,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextGroup$$seriali } public final class dev/inmo/tgbotapi/types/rich/RichTextGroup$Companion { + public final fun html (Ljava/util/List;)Ljava/lang/String; + public final fun markdown (Ljava/util/List;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35822,6 +35886,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextHashtag$$seria } public final class dev/inmo/tgbotapi/types/rich/RichTextHashtag$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35883,6 +35949,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextItalic$$serial } public final class dev/inmo/tgbotapi/types/rich/RichTextItalic$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35914,6 +35982,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextMarked$$serial } public final class dev/inmo/tgbotapi/types/rich/RichTextMarked$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35945,6 +36015,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextMathematicalEx } public final class dev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression$Companion { + public final fun html (Ljava/lang/String;)Ljava/lang/String; + public final fun markdown (Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -35978,6 +36050,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextMention$$seria } public final class dev/inmo/tgbotapi/types/rich/RichTextMention$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -36011,6 +36085,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextPhoneNumber$$s } public final class dev/inmo/tgbotapi/types/rich/RichTextPhoneNumber$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -36040,6 +36116,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextPlain$$seriali } public final class dev/inmo/tgbotapi/types/rich/RichTextPlain$Companion { + public final fun html (Ljava/lang/String;)Ljava/lang/String; + public final fun markdown (Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -36073,6 +36151,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextReference$$ser } public final class dev/inmo/tgbotapi/types/rich/RichTextReference$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -36106,6 +36186,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextReferenceLink$ } public final class dev/inmo/tgbotapi/types/rich/RichTextReferenceLink$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -36146,6 +36228,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextSpoiler$$seria } public final class dev/inmo/tgbotapi/types/rich/RichTextSpoiler$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -36177,6 +36261,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextStrikethrough$ } public final class dev/inmo/tgbotapi/types/rich/RichTextStrikethrough$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -36208,6 +36294,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextSubscript$$ser } public final class dev/inmo/tgbotapi/types/rich/RichTextSubscript$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -36239,6 +36327,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextSuperscript$$s } public final class dev/inmo/tgbotapi/types/rich/RichTextSuperscript$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -36272,6 +36362,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextTextMention$$s } public final class dev/inmo/tgbotapi/types/rich/RichTextTextMention$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/chat/User;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/chat/User;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -36303,6 +36395,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextUnderline$$ser } public final class dev/inmo/tgbotapi/types/rich/RichTextUnderline$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -36336,6 +36430,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextUrl$$serialize } public final class dev/inmo/tgbotapi/types/rich/RichTextUrl$Companion { + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt index cefa811de3..bfd64293ea 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt @@ -28,49 +28,10 @@ val RichTextInfo.markdown: String val RichTextInfo.html: String get() = blocks.toRichHtml() -internal fun richOpenAttribute(isOpen: Boolean?): String = if (isOpen == true) " open" else "" - internal fun creditCiteMarkdown(credit: RichText?): String = credit?.let { "${it.markdown}" } ?: "" internal fun creditCiteHtml(credit: RichText?): String = credit?.let { "${it.html}" } ?: "" -internal fun richBlockListMarkdown(list: RichBlockList): String = - list.items.mapIndexed { index, item -> - val marker = when { - item.hasCheckbox == true -> if (item.isChecked == true) "- [x] " else "- [ ] " - item.labelType != null -> "${item.value ?: (index + 1)}. " - else -> "- " - } - item.blocks.toRichMarkdown().lineSequence().mapIndexed { lineIndex, line -> - if (lineIndex == 0) "$marker$line" else " $line" - }.joinToString(separator = "\n") - }.joinToString(separator = "\n") - -internal fun richBlockListHtml(list: RichBlockList): String { - val ordered = list.items.any { it.labelType != null } - val tag = if (ordered) "ol" else "ul" - val items = list.items.joinToString(separator = "") { item -> - val attributes = buildString { - item.value?.let { append(" value=\"$it\"") } - item.labelType?.let { append(" type=\"$it\"") } - } - val checkbox = if (item.hasCheckbox == true) { - "" - } else { - "" - } - "$checkbox${item.blocks.toRichHtml()}" - } - return "<$tag>$items" -} - -internal fun richBlockQuotationMarkdown(blocks: List, credit: RichText?): String { - val quoted = blocks.toRichMarkdown().lineSequence().joinToString(separator = "\n") { line -> - if (line.isEmpty()) ">" else "> $line" - } - return quoted + (credit?.let { "\n> ${creditCiteMarkdown(it)}" } ?: "") -} - internal fun richMediaContainerMarkdown(tag: String, blocks: List, caption: RichBlockCaption?): String { val media = blocks.joinToString(separator = "\n") { it.markdown } val captionPart = caption?.let { "\n
${it.text.markdown}${creditCiteMarkdown(it.credit)}
" } ?: "" @@ -91,54 +52,3 @@ internal fun richMediaHtml(tag: String, source: String, spoiler: Boolean, selfCl val element = if (selfClosing) "<$tag src=\"$source\"$spoilerAttribute/>" else "<$tag src=\"$source\"$spoilerAttribute>" return caption?.let { "
$element
${it.text.html}${creditCiteHtml(it.credit)}
" } ?: element } - -internal fun richBlockMapMarkdown(map: RichBlockMap): String { - val element = "" - return map.caption?.let { "
$element
${it.text.markdown}${creditCiteMarkdown(it.credit)}
" } ?: element -} - -internal fun richBlockMapHtml(map: RichBlockMap): String { - val element = "" - return map.caption?.let { "
$element
${it.text.html}${creditCiteHtml(it.credit)}
" } ?: element -} - -internal fun richBlockTableMarkdown(table: RichBlockTable): String { - if (table.cells.isEmpty()) return "" - fun renderRow(row: List): String = - row.joinToString(separator = " | ", prefix = "| ", postfix = " |") { it.text?.markdown ?: "" } - fun alignment(cell: RichBlockTableCell): String = when (cell.align) { - "left" -> ":---" - "center" -> ":--:" - "right" -> "---:" - else -> "---" - } - val header = table.cells.first() - val lines = mutableListOf( - renderRow(header), - header.joinToString(separator = " | ", prefix = "| ", postfix = " |") { alignment(it) } - ) - table.cells.drop(1).forEach { lines.add(renderRow(it)) } - return lines.joinToString(separator = "\n") -} - -internal fun richBlockTableHtml(table: RichBlockTable): String { - val attributes = buildString { - if (table.isBordered == true) append(" bordered") - if (table.isStriped == true) append(" striped") - } - val caption = table.caption?.let { "${it.html}" } ?: "" - val rows = table.cells.joinToString(separator = "") { row -> - val cells = row.joinToString(separator = "") { cell -> - val tag = if (cell.isHeader == true) "th" else "td" - val cellAttributes = buildString { - cell.colspan?.let { append(" colspan=\"$it\"") } - cell.rowspan?.let { append(" rowspan=\"$it\"") } - append(" align=\"${cell.align}\"") - append(" valign=\"${cell.valign}\"") - } - "<$tag$cellAttributes>${cell.text?.html ?: ""}" - } - "$cells" - } - return "$caption$rows" -} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt index adbd6189cb..f74b61f22b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt @@ -49,13 +49,13 @@ data class RichBlockParagraph( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = text.markdown - override val html: String - get() = "

${text.html}

" + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "paragraph" + fun markdown(text: RichText): String = text.markdown + fun html(text: RichText): String = "

${text.html}

" } } @@ -78,13 +78,13 @@ data class RichBlockSectionHeading( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "#".repeat(size) + " " + text.markdown - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text, size) + override val html: String = html(text, size) companion object { const val TYPE = "heading" + fun markdown(text: RichText, size: Int): String = "#".repeat(size) + " " + text.markdown + fun html(text: RichText, size: Int): String = "${text.html}" } } @@ -104,13 +104,14 @@ data class RichBlockPreformatted( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "```" + (language ?: "") + "\n" + text.source + "\n```" - override val html: String - get() = language?.let { "
${text.html}
" } ?: "
${text.html}
" + override val markdown: String = markdown(text, language) + override val html: String = html(text, language) companion object { const val TYPE = "pre" + fun markdown(text: RichText, language: String?): String = "```" + (language ?: "") + "\n" + text.source + "\n```" + fun html(text: RichText, language: String?): String = + language?.let { "
${text.html}
" } ?: "
${text.html}
" } } @@ -128,13 +129,13 @@ data class RichBlockFooter( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "
${text.markdown}
" - override val html: String - get() = "
${text.html}
" + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "footer" + fun markdown(text: RichText): String = "
${text.markdown}
" + fun html(text: RichText): String = "
${text.html}
" } } @@ -149,10 +150,8 @@ class RichBlockDivider : RichBlock { @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "---" - override val html: String - get() = "
" + override val markdown: String = markdown() + override val html: String = html() override fun equals(other: Any?): Boolean = other is RichBlockDivider @@ -162,6 +161,8 @@ class RichBlockDivider : RichBlock { companion object { const val TYPE = "divider" + fun markdown(): String = "---" + fun html(): String = "
" } } @@ -179,13 +180,13 @@ data class RichBlockMathematicalExpression( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "\$\$" + expression + "\$\$" - override val html: String - get() = "$expression" + override val markdown: String = markdown(expression) + override val html: String = html(expression) companion object { const val TYPE = "mathematical_expression" + fun markdown(expression: String): String = "\$\$" + expression + "\$\$" + fun html(expression: String): String = "$expression" } } @@ -203,13 +204,13 @@ data class RichBlockAnchor( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "" - override val html: String - get() = "" + override val markdown: String = markdown(name) + override val html: String = html(name) companion object { const val TYPE = "anchor" + fun markdown(name: String): String = "" + fun html(name: String): String = "" } } @@ -227,13 +228,40 @@ data class RichBlockList( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = richBlockListMarkdown(this) - override val html: String - get() = richBlockListHtml(this) + override val markdown: String = markdown(items) + override val html: String = html(items) companion object { const val TYPE = "list" + fun markdown(items: List): String = + items.mapIndexed { index, item -> + val marker = when { + item.hasCheckbox == true -> if (item.isChecked == true) "- [x] " else "- [ ] " + item.labelType != null -> "${item.value ?: (index + 1)}. " + else -> "- " + } + item.blocks.toRichMarkdown().lineSequence().mapIndexed { lineIndex, line -> + if (lineIndex == 0) "$marker$line" else " $line" + }.joinToString(separator = "\n") + }.joinToString(separator = "\n") + + fun html(items: List): String { + val ordered = items.any { it.labelType != null } + val tag = if (ordered) "ol" else "ul" + val renderedItems = items.joinToString(separator = "") { item -> + val attributes = buildString { + item.value?.let { append(" value=\"$it\"") } + item.labelType?.let { append(" type=\"$it\"") } + } + val checkbox = if (item.hasCheckbox == true) { + "" + } else { + "" + } + "$checkbox${item.blocks.toRichHtml()}" + } + return "<$tag>$renderedItems" + } } } @@ -253,13 +281,20 @@ data class RichBlockBlockQuotation( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = richBlockQuotationMarkdown(blocks, credit) - override val html: String - get() = "
${blocks.toRichHtml()}${creditCiteHtml(credit)}
" + override val markdown: String = markdown(blocks, credit) + override val html: String = html(blocks, credit) companion object { const val TYPE = "blockquote" + fun markdown(blocks: List, credit: RichText?): String { + val quoted = blocks.toRichMarkdown().lineSequence().joinToString(separator = "\n") { line -> + if (line.isEmpty()) ">" else "> $line" + } + return quoted + (credit?.let { "\n> ${creditCiteMarkdown(it)}" } ?: "") + } + + fun html(blocks: List, credit: RichText?): String = + "
${blocks.toRichHtml()}${creditCiteHtml(credit)}
" } } @@ -279,13 +314,13 @@ data class RichBlockPullQuotation( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "" - override val html: String - get() = "" + override val markdown: String = markdown(text, credit) + override val html: String = html(text, credit) companion object { const val TYPE = "pullquote" + fun markdown(text: RichText, credit: RichText?): String = "" + fun html(text: RichText, credit: RichText?): String = "" } } @@ -305,13 +340,15 @@ data class RichBlockCollage( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = richMediaContainerMarkdown("tg-collage", blocks, caption) - override val html: String - get() = richMediaContainerHtml("tg-collage", blocks, caption) + override val markdown: String = markdown(blocks, caption) + override val html: String = html(blocks, caption) companion object { const val TYPE = "collage" + fun markdown(blocks: List, caption: RichBlockCaption?): String = + richMediaContainerMarkdown("tg-collage", blocks, caption) + fun html(blocks: List, caption: RichBlockCaption?): String = + richMediaContainerHtml("tg-collage", blocks, caption) } } @@ -331,13 +368,15 @@ data class RichBlockSlideshow( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = richMediaContainerMarkdown("tg-slideshow", blocks, caption) - override val html: String - get() = richMediaContainerHtml("tg-slideshow", blocks, caption) + override val markdown: String = markdown(blocks, caption) + override val html: String = html(blocks, caption) companion object { const val TYPE = "slideshow" + fun markdown(blocks: List, caption: RichBlockCaption?): String = + richMediaContainerMarkdown("tg-slideshow", blocks, caption) + fun html(blocks: List, caption: RichBlockCaption?): String = + richMediaContainerHtml("tg-slideshow", blocks, caption) } } @@ -361,13 +400,51 @@ data class RichBlockTable( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = richBlockTableMarkdown(this) - override val html: String - get() = richBlockTableHtml(this) + override val markdown: String = markdown(cells) + override val html: String = html(cells, isBordered, isStriped, caption) companion object { const val TYPE = "table" + fun markdown(cells: List>): String { + if (cells.isEmpty()) return "" + fun renderRow(row: List): String = + row.joinToString(separator = " | ", prefix = "| ", postfix = " |") { it.text?.markdown ?: "" } + fun alignment(cell: RichBlockTableCell): String = when (cell.align) { + "left" -> ":---" + "center" -> ":--:" + "right" -> "---:" + else -> "---" + } + val header = cells.first() + val lines = mutableListOf( + renderRow(header), + header.joinToString(separator = " | ", prefix = "| ", postfix = " |") { alignment(it) } + ) + cells.drop(1).forEach { lines.add(renderRow(it)) } + return lines.joinToString(separator = "\n") + } + + fun html(cells: List>, isBordered: Boolean?, isStriped: Boolean?, caption: RichText?): String { + val attributes = buildString { + if (isBordered == true) append(" bordered") + if (isStriped == true) append(" striped") + } + val captionPart = caption?.let { "${it.html}" } ?: "" + val rows = cells.joinToString(separator = "") { row -> + val renderedCells = row.joinToString(separator = "") { cell -> + val tag = if (cell.isHeader == true) "th" else "td" + val cellAttributes = buildString { + cell.colspan?.let { append(" colspan=\"$it\"") } + cell.rowspan?.let { append(" rowspan=\"$it\"") } + append(" align=\"${cell.align}\"") + append(" valign=\"${cell.valign}\"") + } + "<$tag$cellAttributes>${cell.text?.html ?: ""}" + } + "$renderedCells" + } + return "$captionPart$rows" + } } } @@ -389,13 +466,20 @@ data class RichBlockDetails( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "${summary.markdown}\n\n${blocks.toRichMarkdown()}\n\n" - override val html: String - get() = "${summary.html}${blocks.toRichHtml()}" + override val markdown: String = markdown(summary, blocks, isOpen) + override val html: String = html(summary, blocks, isOpen) companion object { const val TYPE = "details" + fun markdown(summary: RichText, blocks: List, isOpen: Boolean?): String { + val open = if (isOpen == true) " open" else "" + return "${summary.markdown}\n\n${blocks.toRichMarkdown()}\n\n" + } + + fun html(summary: RichText, blocks: List, isOpen: Boolean?): String { + val open = if (isOpen == true) " open" else "" + return "${summary.html}${blocks.toRichHtml()}" + } } } @@ -424,13 +508,20 @@ data class RichBlockMap( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = richBlockMapMarkdown(this) - override val html: String - get() = richBlockMapHtml(this) + override val markdown: String = markdown(location, zoom, caption) + override val html: String = html(location, zoom, caption) companion object { const val TYPE = "map" + fun markdown(location: StaticLocation, zoom: Int, caption: RichBlockCaption?): String { + val element = "" + return caption?.let { "
$element
${it.text.markdown}${creditCiteMarkdown(it.credit)}
" } ?: element + } + + fun html(location: StaticLocation, zoom: Int, caption: RichBlockCaption?): String { + val element = "" + return caption?.let { "
$element
${it.text.html}${creditCiteHtml(it.credit)}
" } ?: element + } } } @@ -452,13 +543,15 @@ data class RichBlockAnimation( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = richMediaMarkdown(animation.fileId.fileId, caption) - override val html: String - get() = richMediaHtml("video", animation.fileId.fileId, hasSpoiler == true, selfClosing = false, caption = caption) + override val markdown: String = markdown(animation, caption) + override val html: String = html(animation, hasSpoiler, caption) companion object { const val TYPE = "animation" + fun markdown(animation: AnimationFile, caption: RichBlockCaption?): String = + richMediaMarkdown(animation.fileId.fileId, caption) + fun html(animation: AnimationFile, hasSpoiler: Boolean?, caption: RichBlockCaption?): String = + richMediaHtml("video", animation.fileId.fileId, hasSpoiler == true, selfClosing = false, caption = caption) } } @@ -478,13 +571,15 @@ data class RichBlockAudio( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = richMediaMarkdown(audio.fileId.fileId, caption) - override val html: String - get() = richMediaHtml("audio", audio.fileId.fileId, spoiler = false, selfClosing = false, caption = caption) + override val markdown: String = markdown(audio, caption) + override val html: String = html(audio, caption) companion object { const val TYPE = "audio" + fun markdown(audio: AudioFile, caption: RichBlockCaption?): String = + richMediaMarkdown(audio.fileId.fileId, caption) + fun html(audio: AudioFile, caption: RichBlockCaption?): String = + richMediaHtml("audio", audio.fileId.fileId, spoiler = false, selfClosing = false, caption = caption) } } @@ -506,13 +601,15 @@ data class RichBlockPhoto( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = richMediaMarkdown(photo.fileId.fileId, caption) - override val html: String - get() = richMediaHtml("img", photo.fileId.fileId, hasSpoiler == true, selfClosing = true, caption = caption) + override val markdown: String = markdown(photo, caption) + override val html: String = html(photo, hasSpoiler, caption) companion object { const val TYPE = "photo" + fun markdown(photo: PhotoFile, caption: RichBlockCaption?): String = + richMediaMarkdown(photo.fileId.fileId, caption) + fun html(photo: PhotoFile, hasSpoiler: Boolean?, caption: RichBlockCaption?): String = + richMediaHtml("img", photo.fileId.fileId, hasSpoiler == true, selfClosing = true, caption = caption) } } @@ -534,13 +631,15 @@ data class RichBlockVideo( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = richMediaMarkdown(video.fileId.fileId, caption) - override val html: String - get() = richMediaHtml("video", video.fileId.fileId, hasSpoiler == true, selfClosing = false, caption = caption) + override val markdown: String = markdown(video, caption) + override val html: String = html(video, hasSpoiler, caption) companion object { const val TYPE = "video" + fun markdown(video: VideoFile, caption: RichBlockCaption?): String = + richMediaMarkdown(video.fileId.fileId, caption) + fun html(video: VideoFile, hasSpoiler: Boolean?, caption: RichBlockCaption?): String = + richMediaHtml("video", video.fileId.fileId, hasSpoiler == true, selfClosing = false, caption = caption) } } @@ -560,13 +659,15 @@ data class RichBlockVoiceNote( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = richMediaMarkdown(voiceNote.fileId.fileId, caption) - override val html: String - get() = richMediaHtml("audio", voiceNote.fileId.fileId, spoiler = false, selfClosing = false, caption = caption) + override val markdown: String = markdown(voiceNote, caption) + override val html: String = html(voiceNote, caption) companion object { const val TYPE = "voice_note" + fun markdown(voiceNote: VoiceFile, caption: RichBlockCaption?): String = + richMediaMarkdown(voiceNote.fileId.fileId, caption) + fun html(voiceNote: VoiceFile, caption: RichBlockCaption?): String = + richMediaHtml("audio", voiceNote.fileId.fileId, spoiler = false, selfClosing = false, caption = caption) } } @@ -584,12 +685,12 @@ data class RichBlockThinking( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "${text.markdown}" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "thinking" + fun markdown(text: RichText): String = "${text.markdown}" + fun html(text: RichText): String = "${text.html}" } } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt index db75fb6ccb..00dec95955 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt @@ -38,10 +38,13 @@ sealed interface RichText { data class RichTextPlain( val text: String ) : RichText { - override val markdown: String - get() = text.escapeRichMarkdown() - override val html: String - get() = text.toHtml() + override val markdown: String = markdown(text) + override val html: String = html(text) + + companion object { + fun markdown(text: String): String = text.escapeRichMarkdown() + fun html(text: String): String = text.toHtml() + } } /** @@ -51,10 +54,13 @@ data class RichTextPlain( data class RichTextGroup( val parts: List ) : RichText { - override val markdown: String - get() = parts.joinToString(separator = "") { it.markdown } - override val html: String - get() = parts.joinToString(separator = "") { it.html } + override val markdown: String = markdown(parts) + override val html: String = html(parts) + + companion object { + fun markdown(parts: List): String = parts.joinToString(separator = "") { it.markdown } + fun html(parts: List): String = parts.joinToString(separator = "") { it.html } + } } /** diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt index 67f77caa8c..d607b020fb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt @@ -41,13 +41,13 @@ data class RichTextBold( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "**${text.markdown}**" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "bold" + fun markdown(text: RichText): String = "**${text.markdown}**" + fun html(text: RichText): String = "${text.html}" } } @@ -65,13 +65,13 @@ data class RichTextItalic( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "*${text.markdown}*" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "italic" + fun markdown(text: RichText): String = "*${text.markdown}*" + fun html(text: RichText): String = "${text.html}" } } @@ -89,13 +89,13 @@ data class RichTextUnderline( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "${text.markdown}" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "underline" + fun markdown(text: RichText): String = "${text.markdown}" + fun html(text: RichText): String = "${text.html}" } } @@ -113,13 +113,13 @@ data class RichTextStrikethrough( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "~~${text.markdown}~~" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "strikethrough" + fun markdown(text: RichText): String = "~~${text.markdown}~~" + fun html(text: RichText): String = "${text.html}" } } @@ -137,13 +137,13 @@ data class RichTextSpoiler( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "||${text.markdown}||" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "spoiler" + fun markdown(text: RichText): String = "||${text.markdown}||" + fun html(text: RichText): String = "${text.html}" } } @@ -161,13 +161,13 @@ data class RichTextSubscript( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "${text.markdown}" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "subscript" + fun markdown(text: RichText): String = "${text.markdown}" + fun html(text: RichText): String = "${text.html}" } } @@ -185,13 +185,13 @@ data class RichTextSuperscript( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "${text.markdown}" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "superscript" + fun markdown(text: RichText): String = "${text.markdown}" + fun html(text: RichText): String = "${text.html}" } } @@ -209,13 +209,13 @@ data class RichTextMarked( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "==${text.markdown}==" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "marked" + fun markdown(text: RichText): String = "==${text.markdown}==" + fun html(text: RichText): String = "${text.html}" } } @@ -233,13 +233,13 @@ data class RichTextCode( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "`${text.source}`" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "code" + fun markdown(text: RichText): String = "`${text.source}`" + fun html(text: RichText): String = "${text.html}" } } @@ -261,13 +261,15 @@ data class RichTextDateTime( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "![${text.markdown}](tg://time?unix=$unixTime&format=$dateTimeFormat)" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text, unixTime, dateTimeFormat) + override val html: String = html(text, unixTime, dateTimeFormat) companion object { const val TYPE = "date_time" + fun markdown(text: RichText, unixTime: Long, dateTimeFormat: String): String = + "![${text.markdown}](tg://time?unix=$unixTime&format=$dateTimeFormat)" + fun html(text: RichText, unixTime: Long, dateTimeFormat: String): String = + "${text.html}" } } @@ -287,13 +289,15 @@ data class RichTextTextMention( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "[${text.markdown}]($internalUserLinkBeginning${user.id.chatId.long})" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text, user) + override val html: String = html(text, user) companion object { const val TYPE = "text_mention" + fun markdown(text: RichText, user: User): String = + "[${text.markdown}]($internalUserLinkBeginning${user.id.chatId.long})" + fun html(text: RichText, user: User): String = + "${text.html}" } } @@ -313,13 +317,15 @@ data class RichTextCustomEmoji( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "![${alternativeText.escapeRichMarkdown()}](tg://emoji?id=${customEmojiId.string})" - override val html: String - get() = "${alternativeText.toHtml()}" + override val markdown: String = markdown(customEmojiId, alternativeText) + override val html: String = html(customEmojiId, alternativeText) companion object { const val TYPE = "custom_emoji" + fun markdown(customEmojiId: CustomEmojiId, alternativeText: String): String = + "![${alternativeText.escapeRichMarkdown()}](tg://emoji?id=${customEmojiId.string})" + fun html(customEmojiId: CustomEmojiId, alternativeText: String): String = + "${alternativeText.toHtml()}" } } @@ -337,13 +343,13 @@ data class RichTextMathematicalExpression( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "\$$expression\$" - override val html: String - get() = "$expression" + override val markdown: String = markdown(expression) + override val html: String = html(expression) companion object { const val TYPE = "mathematical_expression" + fun markdown(expression: String): String = "\$$expression\$" + fun html(expression: String): String = "$expression" } } @@ -363,13 +369,13 @@ data class RichTextUrl( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "[${text.markdown}]($url)" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text, url) + override val html: String = html(text, url) companion object { const val TYPE = "url" + fun markdown(text: RichText, url: String): String = "[${text.markdown}]($url)" + fun html(text: RichText, url: String): String = "${text.html}" } } @@ -389,13 +395,13 @@ data class RichTextEmailAddress( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "[${text.markdown}](mailto:$emailAddress)" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text, emailAddress) + override val html: String = html(text, emailAddress) companion object { const val TYPE = "email_address" + fun markdown(text: RichText, emailAddress: String): String = "[${text.markdown}](mailto:$emailAddress)" + fun html(text: RichText, emailAddress: String): String = "${text.html}" } } @@ -415,13 +421,13 @@ data class RichTextPhoneNumber( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "[${text.markdown}](tel:$phoneNumber)" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text, phoneNumber) + override val html: String = html(text, phoneNumber) companion object { const val TYPE = "phone_number" + fun markdown(text: RichText, phoneNumber: String): String = "[${text.markdown}](tel:$phoneNumber)" + fun html(text: RichText, phoneNumber: String): String = "${text.html}" } } @@ -441,13 +447,13 @@ data class RichTextBankCardNumber( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = text.markdown - override val html: String - get() = text.html + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "bank_card_number" + fun markdown(text: RichText): String = text.markdown + fun html(text: RichText): String = text.html } } @@ -467,13 +473,13 @@ data class RichTextMention( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = text.markdown - override val html: String - get() = text.html + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "mention" + fun markdown(text: RichText): String = text.markdown + fun html(text: RichText): String = text.html } } @@ -493,13 +499,13 @@ data class RichTextHashtag( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = text.markdown - override val html: String - get() = text.html + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "hashtag" + fun markdown(text: RichText): String = text.markdown + fun html(text: RichText): String = text.html } } @@ -519,13 +525,13 @@ data class RichTextCashtag( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = text.markdown - override val html: String - get() = text.html + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "cashtag" + fun markdown(text: RichText): String = text.markdown + fun html(text: RichText): String = text.html } } @@ -545,13 +551,13 @@ data class RichTextBotCommand( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = text.markdown - override val html: String - get() = text.html + override val markdown: String = markdown(text) + override val html: String = html(text) companion object { const val TYPE = "bot_command" + fun markdown(text: RichText): String = text.markdown + fun html(text: RichText): String = text.html } } @@ -569,13 +575,13 @@ data class RichTextAnchor( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "" - override val html: String - get() = "" + override val markdown: String = markdown(name) + override val html: String = html(name) companion object { const val TYPE = "anchor" + fun markdown(name: String): String = "" + fun html(name: String): String = "" } } @@ -595,13 +601,13 @@ data class RichTextAnchorLink( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "[${text.markdown}](#$anchorName)" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text, anchorName) + override val html: String = html(text, anchorName) companion object { const val TYPE = "anchor_link" + fun markdown(text: RichText, anchorName: String): String = "[${text.markdown}](#$anchorName)" + fun html(text: RichText, anchorName: String): String = "${text.html}" } } @@ -621,13 +627,13 @@ data class RichTextReference( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "${text.markdown}" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text, name) + override val html: String = html(text, name) companion object { const val TYPE = "reference" + fun markdown(text: RichText, name: String): String = "${text.markdown}" + fun html(text: RichText, name: String): String = "${text.html}" } } @@ -647,12 +653,12 @@ data class RichTextReferenceLink( @SerialName(typeField) override val type: String = TYPE - override val markdown: String - get() = "[${text.markdown}](#$referenceName)" - override val html: String - get() = "${text.html}" + override val markdown: String = markdown(text, referenceName) + override val html: String = html(text, referenceName) companion object { const val TYPE = "reference_link" + fun markdown(text: RichText, referenceName: String): String = "[${text.markdown}](#$referenceName)" + fun html(text: RichText, referenceName: String): String = "${text.html}" } } From 88a54350dfbc9fa339bc6e4be7e765823958d650 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 30 Jun 2026 21:59:18 +0600 Subject: [PATCH 18/27] Rename RichText source to rawText and move it into members Replace the RichText.source extension property (a when over every subtype) with a rawText member declared on RichText and implemented directly by each inheritor: RichTextPlain.rawText = text, the wrapping entities delegate to text.rawText, and custom emoji / mathematical expression / anchor fall back to their own representation. Update the RichBlockPreformatted and media markdown builders and the formatting tests accordingly. Co-Authored-By: Claude Opus 4.8 --- tgbotapi.core/api/tgbotapi.core.api | 29 ++++++++++++++- .../types/rich/RichBlockFormatting.kt | 2 +- .../inmo/tgbotapi/types/rich/RichBlocks.kt | 2 +- .../dev/inmo/tgbotapi/types/rich/RichText.kt | 9 +++++ .../tgbotapi/types/rich/RichTextEntities.kt | 27 +++++++++++++- .../tgbotapi/types/rich/RichTextFormatting.kt | 36 ------------------- .../types/rich/RichTextFormattingTest.kt | 10 +++--- 7 files changed, 70 insertions(+), 45 deletions(-) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 2994b3843a..4a0a2d0415 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -35388,6 +35388,7 @@ public abstract interface class dev/inmo/tgbotapi/types/rich/RichText { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichText$Companion; public abstract fun getHtml ()Ljava/lang/String; public abstract fun getMarkdown ()Ljava/lang/String; + public abstract fun getRawText ()Ljava/lang/String; } public final class dev/inmo/tgbotapi/types/rich/RichText$Companion { @@ -35405,6 +35406,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextAnchor : dev/inmo/tgbota public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; public final fun getName ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -35439,6 +35441,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextAnchorLink : dev/inmo/tg public final fun getAnchorName ()Ljava/lang/String; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35474,6 +35477,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextBankCardNumber : dev/inm public final fun getBankCardNumber ()Ljava/lang/String; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35507,6 +35511,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextBold : dev/inmo/tgbotapi public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35542,6 +35547,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextBotCommand : dev/inmo/tg public final fun getBotCommand ()Ljava/lang/String; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35632,6 +35638,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextCashtag : dev/inmo/tgbot public final fun getCashtag ()Ljava/lang/String; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35665,6 +35672,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextCode : dev/inmo/tgbotapi public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35701,6 +35709,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextCustomEmoji : dev/inmo/t public final fun getCustomEmojiId-dDnjveI ()Ljava/lang/String; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -35736,6 +35745,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextDateTime : dev/inmo/tgbo public final fun getDateTimeFormat ()Ljava/lang/String; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public final fun getUnixTime ()J @@ -35782,6 +35792,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextEmailAddress : dev/inmo/ public final fun getEmailAddress ()Ljava/lang/String; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35822,7 +35833,6 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextEntitySerializer : kotli public final class dev/inmo/tgbotapi/types/rich/RichTextFormattingKt { public static final fun escapeRichMarkdown (Ljava/lang/String;)Ljava/lang/String; - public static final fun getSource (Ldev/inmo/tgbotapi/types/rich/RichText;)Ljava/lang/String; } public final class dev/inmo/tgbotapi/types/rich/RichTextGroup : dev/inmo/tgbotapi/types/rich/RichText { @@ -35835,6 +35845,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextGroup : dev/inmo/tgbotap public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; public final fun getParts ()Ljava/util/List; + public fun getRawText ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -35868,6 +35879,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextHashtag : dev/inmo/tgbot public final fun getHashtag ()Ljava/lang/String; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35931,6 +35943,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextItalic : dev/inmo/tgbota public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35964,6 +35977,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextMarked : dev/inmo/tgbota public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35998,6 +36012,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextMathematicalExpression : public final fun getExpression ()Ljava/lang/String; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -36031,6 +36046,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextMention : dev/inmo/tgbot public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public final fun getUsername ()Ljava/lang/String; @@ -36067,6 +36083,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextPhoneNumber : dev/inmo/t public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; public final fun getPhoneNumber ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -36099,6 +36116,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextPlain : dev/inmo/tgbotap public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -36133,6 +36151,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextReference : dev/inmo/tgb public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; public final fun getName ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -36167,6 +36186,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextReferenceLink : dev/inmo public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getReferenceName ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; @@ -36210,6 +36230,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextSpoiler : dev/inmo/tgbot public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -36243,6 +36264,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextStrikethrough : dev/inmo public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -36276,6 +36298,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextSubscript : dev/inmo/tgb public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -36309,6 +36332,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextSuperscript : dev/inmo/t public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -36343,6 +36367,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextTextMention : dev/inmo/t public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public final fun getUser ()Ldev/inmo/tgbotapi/types/chat/User; @@ -36377,6 +36402,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextUnderline : dev/inmo/tgb public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -36411,6 +36437,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextUrl : dev/inmo/tgbotapi/ public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public final fun getUrl ()Ljava/lang/String; diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt index bfd64293ea..13d6601104 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlockFormatting.kt @@ -45,7 +45,7 @@ internal fun richMediaContainerHtml(tag: String, blocks: List, captio } internal fun richMediaMarkdown(source: String, caption: RichBlockCaption?): String = - caption?.let { "![](" + source + " \"" + it.text.source + "\")" } ?: "![]($source)" + caption?.let { "![](" + source + " \"" + it.text.rawText + "\")" } ?: "![]($source)" internal fun richMediaHtml(tag: String, source: String, spoiler: Boolean, selfClosing: Boolean, caption: RichBlockCaption?): String { val spoilerAttribute = if (spoiler) " tg-spoiler" else "" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt index f74b61f22b..844b48d558 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt @@ -109,7 +109,7 @@ data class RichBlockPreformatted( companion object { const val TYPE = "pre" - fun markdown(text: RichText, language: String?): String = "```" + (language ?: "") + "\n" + text.source + "\n```" + fun markdown(text: RichText, language: String?): String = "```" + (language ?: "") + "\n" + text.rawText + "\n```" fun html(text: RichText, language: String?): String = language?.let { "
${text.html}
" } ?: "
${text.html}
" } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt index 00dec95955..800d8dba4e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichText.kt @@ -20,6 +20,13 @@ import kotlinx.serialization.json.* @Serializable(RichTextSerializer::class) @ClassCastsIncluded sealed interface RichText { + /** + * Plain (unformatted) text of this [RichText]. For [RichTextEntity]s without an inner [RichText] it falls back to + * the most meaningful textual representation: alternative text for custom emojis, the expression for mathematical + * expressions and an empty string for anchors. + */ + val rawText: String + /** * [Rich Markdown style](https://core.telegram.org/bots/api#rich-markdown-style) representation of this [RichText]. */ @@ -38,6 +45,7 @@ sealed interface RichText { data class RichTextPlain( val text: String ) : RichText { + override val rawText: String = text override val markdown: String = markdown(text) override val html: String = html(text) @@ -54,6 +62,7 @@ data class RichTextPlain( data class RichTextGroup( val parts: List ) : RichText { + override val rawText: String = parts.joinToString(separator = "") { it.rawText } override val markdown: String = markdown(parts) override val html: String = html(parts) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt index d607b020fb..a708074dad 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt @@ -41,6 +41,7 @@ data class RichTextBold( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) @@ -65,6 +66,7 @@ data class RichTextItalic( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) @@ -89,6 +91,7 @@ data class RichTextUnderline( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) @@ -113,6 +116,7 @@ data class RichTextStrikethrough( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) @@ -137,6 +141,7 @@ data class RichTextSpoiler( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) @@ -161,6 +166,7 @@ data class RichTextSubscript( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) @@ -185,6 +191,7 @@ data class RichTextSuperscript( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) @@ -209,6 +216,7 @@ data class RichTextMarked( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) @@ -233,12 +241,13 @@ data class RichTextCode( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) companion object { const val TYPE = "code" - fun markdown(text: RichText): String = "`${text.source}`" + fun markdown(text: RichText): String = "`${text.rawText}`" fun html(text: RichText): String = "${text.html}" } } @@ -261,6 +270,7 @@ data class RichTextDateTime( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text, unixTime, dateTimeFormat) override val html: String = html(text, unixTime, dateTimeFormat) @@ -289,6 +299,7 @@ data class RichTextTextMention( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text, user) override val html: String = html(text, user) @@ -317,6 +328,7 @@ data class RichTextCustomEmoji( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = alternativeText override val markdown: String = markdown(customEmojiId, alternativeText) override val html: String = html(customEmojiId, alternativeText) @@ -343,6 +355,7 @@ data class RichTextMathematicalExpression( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = expression override val markdown: String = markdown(expression) override val html: String = html(expression) @@ -369,6 +382,7 @@ data class RichTextUrl( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text, url) override val html: String = html(text, url) @@ -395,6 +409,7 @@ data class RichTextEmailAddress( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text, emailAddress) override val html: String = html(text, emailAddress) @@ -421,6 +436,7 @@ data class RichTextPhoneNumber( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text, phoneNumber) override val html: String = html(text, phoneNumber) @@ -447,6 +463,7 @@ data class RichTextBankCardNumber( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) @@ -473,6 +490,7 @@ data class RichTextMention( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) @@ -499,6 +517,7 @@ data class RichTextHashtag( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) @@ -525,6 +544,7 @@ data class RichTextCashtag( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) @@ -551,6 +571,7 @@ data class RichTextBotCommand( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text) override val html: String = html(text) @@ -575,6 +596,7 @@ data class RichTextAnchor( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = "" override val markdown: String = markdown(name) override val html: String = html(name) @@ -601,6 +623,7 @@ data class RichTextAnchorLink( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text, anchorName) override val html: String = html(text, anchorName) @@ -627,6 +650,7 @@ data class RichTextReference( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text, name) override val html: String = html(text, name) @@ -653,6 +677,7 @@ data class RichTextReferenceLink( @SerialName(typeField) override val type: String = TYPE + override val rawText: String = text.rawText override val markdown: String = markdown(text, referenceName) override val html: String = html(text, referenceName) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormatting.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormatting.kt index 3c031ecf50..add7ec3345 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormatting.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormatting.kt @@ -21,39 +21,3 @@ fun String.escapeRichMarkdown(): String = buildString { append(character) } } - -/** - * Plain (unformatted) text of this [RichText]. For [RichTextEntity]s without an inner [RichText] it falls back to the - * most meaningful textual representation: alternative text for custom emojis, the expression for mathematical - * expressions and an empty string for anchors. - */ -val RichText.source: String - get() = when (this) { - is RichTextPlain -> text - is RichTextGroup -> parts.joinToString(separator = "") { it.source } - is RichTextCustomEmoji -> alternativeText - is RichTextMathematicalExpression -> expression - is RichTextAnchor -> "" - is RichTextBold -> text.source - is RichTextItalic -> text.source - is RichTextUnderline -> text.source - is RichTextStrikethrough -> text.source - is RichTextSpoiler -> text.source - is RichTextSubscript -> text.source - is RichTextSuperscript -> text.source - is RichTextMarked -> text.source - is RichTextCode -> text.source - is RichTextDateTime -> text.source - is RichTextTextMention -> text.source - is RichTextUrl -> text.source - is RichTextEmailAddress -> text.source - is RichTextPhoneNumber -> text.source - is RichTextBankCardNumber -> text.source - is RichTextMention -> text.source - is RichTextHashtag -> text.source - is RichTextCashtag -> text.source - is RichTextBotCommand -> text.source - is RichTextAnchorLink -> text.source - is RichTextReference -> text.source - is RichTextReferenceLink -> text.source - } diff --git a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormattingTest.kt b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormattingTest.kt index ff5a77f6d1..18c8d288c7 100644 --- a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormattingTest.kt +++ b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormattingTest.kt @@ -209,13 +209,13 @@ class RichTextFormattingTest { } @Test - fun sourceExtractsPlainText() { - assertEquals("x", RichTextBold(RichTextPlain("x")).source) - assertEquals("alt", RichTextCustomEmoji(CustomEmojiId("1"), "alt").source) - assertEquals("e", RichTextMathematicalExpression("e").source) + fun rawTextExtractsPlainText() { + assertEquals("x", RichTextBold(RichTextPlain("x")).rawText) + assertEquals("alt", RichTextCustomEmoji(CustomEmojiId("1"), "alt").rawText) + assertEquals("e", RichTextMathematicalExpression("e").rawText) assertEquals( "a b", - RichTextGroup(listOf(RichTextPlain("a "), RichTextBold(RichTextPlain("b")))).source + RichTextGroup(listOf(RichTextPlain("a "), RichTextBold(RichTextPlain("b")))).rawText ) } } From c3495d8817b6fdec9dda8d362e6303fb2911e3d1 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 30 Jun 2026 22:01:20 +0600 Subject: [PATCH 19/27] Add HELPERS rule preferring members over when-dispatch extensions Document that a property/method which can live on an interface/class must be declared there and overridden per implementation, instead of a common extension that dispatches with a when over every subtype; shared logic goes into a companion-object function or an internal top-level helper. Co-Authored-By: Claude Opus 4.8 --- agents/HELPERS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/agents/HELPERS.md b/agents/HELPERS.md index c75169f992..d9e2d00662 100644 --- a/agents/HELPERS.md +++ b/agents/HELPERS.md @@ -48,3 +48,7 @@ Each section can be ommited if there are no any changes in the section. In case * `Core`: * (`Guest mode`) // change data ``` + +--- + +When a property (or method) can be declared on an interface/class and implemented by each inheritor - it MUST be declared there and overridden per implementation. DO NOT implement such behaviour as a common extension property/function that dispatches with a `when (this)` over every subtype: those branches silently drift out of sync when new subtypes are added and are not part of the type contract. If a part of the implementation is reused across several inheritors, keep that part in a shared helper (a companion-object function of the owner, or an `internal` top-level function for logic shared between different types) and let the overrides reuse it. From edad79ace8218017c4b4ab050eac164cd9c6b57c Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 30 Jun 2026 22:33:33 +0600 Subject: [PATCH 20/27] Add HELPERS rules: work in main worktree, one subagent per subtask Document two working rules: all work must be done in the normal (main) worktree rather than a separate `.claude/worktrees` worktree, and a prompt that lists several subtasks must run each subtask as its own subagent. Co-Authored-By: Claude Opus 4.8 --- agents/HELPERS.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/agents/HELPERS.md b/agents/HELPERS.md index d9e2d00662..b38f6d2394 100644 --- a/agents/HELPERS.md +++ b/agents/HELPERS.md @@ -52,3 +52,11 @@ Each section can be ommited if there are no any changes in the section. In case --- When a property (or method) can be declared on an interface/class and implemented by each inheritor - it MUST be declared there and overridden per implementation. DO NOT implement such behaviour as a common extension property/function that dispatches with a `when (this)` over every subtype: those branches silently drift out of sync when new subtypes are added and are not part of the type contract. If a part of the implementation is reused across several inheritors, keep that part in a shared helper (a companion-object function of the owner, or an `internal` top-level function for logic shared between different types) and let the overrides reuse it. + +--- + +All work MUST be performed in the normal (main) working worktree of the repository. DO NOT create or do the work inside a separate worktree (for example `.claude/worktrees/...`): commits made there leave the main checkout behind and force an extra fast-forward/pull to land the changes. If some environment forces an isolated worktree, fast-forward the main branch onto those commits and continue in the main worktree. + +--- + +When a prompt contains a list of several subtasks, run each subtask as its own subagent (one subagent per subtask) instead of doing all of them inline in the main thread. From 3a05a88d4fb7333ed89dfaf63c3265fdd13a1171 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 1 Jul 2026 01:16:36 +0600 Subject: [PATCH 21/27] Modify markdown function to add newlines --- .../kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt index 844b48d558..8f9b2d6d2e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt @@ -54,7 +54,7 @@ data class RichBlockParagraph( companion object { const val TYPE = "paragraph" - fun markdown(text: RichText): String = text.markdown + fun markdown(text: RichText): String = "\n${text.markdown}\n" fun html(text: RichText): String = "

${text.html}

" } } From b054f3d1b5a46a81419b29d1673efbcafee49b45 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 1 Jul 2026 11:25:43 +0600 Subject: [PATCH 22/27] Revert "Modify markdown function to add newlines" This reverts commit 3a05a88d4fb7333ed89dfaf63c3265fdd13a1171. --- .../kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt index 8f9b2d6d2e..844b48d558 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt @@ -54,7 +54,7 @@ data class RichBlockParagraph( companion object { const val TYPE = "paragraph" - fun markdown(text: RichText): String = "\n${text.markdown}\n" + fun markdown(text: RichText): String = text.markdown fun html(text: RichText): String = "

${text.html}

" } } From 390770ca80cff1c1bd2a880fd48de629a4be2753 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 1 Jul 2026 12:46:16 +0600 Subject: [PATCH 23/27] refactor/fixes in rich parts --- tgbotapi.core/api/tgbotapi.core.api | 24 +++++++------- .../inmo/tgbotapi/types/rich/RichBlocks.kt | 6 ++-- .../inmo/tgbotapi/types/rich/RichTextDsl.kt | 33 ++++++++++--------- .../tgbotapi/types/rich/RichTextEntities.kt | 11 ++++--- .../types/RichMessageSerializationTest.kt | 2 +- .../tgbotapi/types/rich/RichTextDslTest.kt | 2 +- .../types/rich/RichTextFormattingTest.kt | 3 +- 7 files changed, 42 insertions(+), 39 deletions(-) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 4a0a2d0415..5549edbcc6 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -35105,8 +35105,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockSectionHeading : dev/in public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading;Ldev/inmo/tgbotapi/types/rich/RichText;IILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockSectionHeading; public fun equals (Ljava/lang/Object;)Z public fun getHtml ()Ljava/lang/String; + public final fun getLevel ()I public fun getMarkdown ()Ljava/lang/String; - public final fun getSize ()I public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35369,8 +35369,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlocksBuilder { public final fun divider ()V public final fun footer (Ljava/lang/String;)V public final fun footer (Lkotlin/jvm/functions/Function1;)V - public final fun heading (ILjava/lang/String;)V - public final fun heading (ILkotlin/jvm/functions/Function1;)V + public final fun heading (Ljava/lang/String;I)V + public final fun heading (Lkotlin/jvm/functions/Function1;I)V public final fun list (Lkotlin/jvm/functions/Function1;)V public final fun mathematicalExpression (Ljava/lang/String;)V public final fun paragraph (Ljava/lang/String;)V @@ -35589,8 +35589,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextBuilder { public final fun code (Ljava/lang/String;)V public final fun code (Lkotlin/jvm/functions/Function1;)V public final fun customEmoji-R1fjqgo (Ljava/lang/String;Ljava/lang/String;)V - public final fun dateTime (JLjava/lang/String;Ljava/lang/String;)V - public final fun dateTime (JLjava/lang/String;Lkotlin/jvm/functions/Function1;)V + public final fun dateTime (Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/lang/String;)V + public final fun dateTime (Lkotlin/jvm/functions/Function1;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/lang/String;)V public final fun email (Ljava/lang/String;Ljava/lang/String;)V public final fun email (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public final fun hashtag (Ljava/lang/String;Ljava/lang/String;)V @@ -35735,12 +35735,12 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextCustomEmoji$Companion { public final class dev/inmo/tgbotapi/types/rich/RichTextDateTime : dev/inmo/tgbotapi/types/rich/RichTextEntity { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichTextDateTime$Companion; public static final field TYPE Ljava/lang/String; - public fun (Ldev/inmo/tgbotapi/types/rich/RichText;JLjava/lang/String;)V + public fun (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/lang/String;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/rich/RichText; - public final fun component2 ()J + public final fun component2 ()Ldev/inmo/tgbotapi/types/TelegramDate; public final fun component3 ()Ljava/lang/String; - public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;JLjava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextDateTime; - public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextDateTime;Ldev/inmo/tgbotapi/types/rich/RichText;JLjava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextDateTime; + public final fun copy (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/rich/RichTextDateTime; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichTextDateTime;Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichTextDateTime; public fun equals (Ljava/lang/Object;)Z public final fun getDateTimeFormat ()Ljava/lang/String; public fun getHtml ()Ljava/lang/String; @@ -35748,7 +35748,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextDateTime : dev/inmo/tgbo public fun getRawText ()Ljava/lang/String; public final fun getText ()Ldev/inmo/tgbotapi/types/rich/RichText; public fun getType ()Ljava/lang/String; - public final fun getUnixTime ()J + public final fun getUnixTime ()Ldev/inmo/tgbotapi/types/TelegramDate; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -35765,8 +35765,8 @@ public final synthetic class dev/inmo/tgbotapi/types/rich/RichTextDateTime$$seri } public final class dev/inmo/tgbotapi/types/rich/RichTextDateTime$Companion { - public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;JLjava/lang/String;)Ljava/lang/String; - public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;JLjava/lang/String;)Ljava/lang/String; + public final fun html (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/lang/String;)Ljava/lang/String; + public final fun markdown (Ldev/inmo/tgbotapi/types/rich/RichText;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/lang/String;)Ljava/lang/String; public final fun serializer ()Lkotlinx/serialization/KSerializer; } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt index 844b48d558..8db919ee6e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt @@ -72,14 +72,14 @@ data class RichBlockSectionHeading( * Relative size of the text font; 1-6, 1 is the largest, 6 is the smallest. */ @SerialName(sizeField) - val size: Int + val level: Int ) : RichBlock { @EncodeDefault @SerialName(typeField) override val type: String = TYPE - override val markdown: String = markdown(text, size) - override val html: String = html(text, size) + override val markdown: String = markdown(text, level) + override val html: String = html(text, level) companion object { const val TYPE = "heading" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDsl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDsl.kt index 88805f81f7..37383b6b1f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDsl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDsl.kt @@ -1,6 +1,7 @@ package dev.inmo.tgbotapi.types.rich import dev.inmo.tgbotapi.types.CustomEmojiId +import dev.inmo.tgbotapi.types.TelegramDate import dev.inmo.tgbotapi.types.chat.User /** @@ -56,12 +57,12 @@ class RichTextBuilder { fun code(text: String) = add(RichTextCode(RichTextPlain(text))) fun code(block: RichTextBuilder.() -> Unit) = add(RichTextCode(buildRichText(block))) - fun dateTime(unixTime: Long, dateTimeFormat: String, text: String) = + fun dateTime(text: String, unixTime: TelegramDate, dateTimeFormat: String) = add(RichTextDateTime(RichTextPlain(text), unixTime, dateTimeFormat)) - fun dateTime(unixTime: Long, dateTimeFormat: String, block: RichTextBuilder.() -> Unit) = + fun dateTime(unixTime: TelegramDate, dateTimeFormat: String, block: RichTextBuilder.() -> Unit) = add(RichTextDateTime(buildRichText(block), unixTime, dateTimeFormat)) - fun textMention(user: User, text: String) = add(RichTextTextMention(RichTextPlain(text), user)) + fun textMention(text: String, user: User) = add(RichTextTextMention(RichTextPlain(text), user)) fun textMention(user: User, block: RichTextBuilder.() -> Unit) = add(RichTextTextMention(buildRichText(block), user)) fun customEmoji(customEmojiId: CustomEmojiId, alternativeText: String) = @@ -69,44 +70,44 @@ class RichTextBuilder { fun mathematicalExpression(expression: String) = add(RichTextMathematicalExpression(expression)) - fun url(url: String, text: String) = add(RichTextUrl(RichTextPlain(text), url)) + fun url(text: String, url: String) = add(RichTextUrl(RichTextPlain(text), url)) fun url(url: String, block: RichTextBuilder.() -> Unit) = add(RichTextUrl(buildRichText(block), url)) - fun email(emailAddress: String, text: String) = add(RichTextEmailAddress(RichTextPlain(text), emailAddress)) + fun email(text: String, emailAddress: String) = add(RichTextEmailAddress(RichTextPlain(text), emailAddress)) fun email(emailAddress: String, block: RichTextBuilder.() -> Unit) = add(RichTextEmailAddress(buildRichText(block), emailAddress)) - fun phone(phoneNumber: String, text: String) = add(RichTextPhoneNumber(RichTextPlain(text), phoneNumber)) + fun phone(text: String, phoneNumber: String) = add(RichTextPhoneNumber(RichTextPlain(text), phoneNumber)) fun phone(phoneNumber: String, block: RichTextBuilder.() -> Unit) = add(RichTextPhoneNumber(buildRichText(block), phoneNumber)) - fun bankCard(bankCardNumber: String, text: String) = add(RichTextBankCardNumber(RichTextPlain(text), bankCardNumber)) + fun bankCard(text: String, bankCardNumber: String) = add(RichTextBankCardNumber(RichTextPlain(text), bankCardNumber)) fun bankCard(bankCardNumber: String, block: RichTextBuilder.() -> Unit) = add(RichTextBankCardNumber(buildRichText(block), bankCardNumber)) - fun mention(username: String, text: String) = add(RichTextMention(RichTextPlain(text), username)) + fun mention(text: String, username: String) = add(RichTextMention(RichTextPlain(text), username)) fun mention(username: String, block: RichTextBuilder.() -> Unit) = add(RichTextMention(buildRichText(block), username)) - fun hashtag(hashtag: String, text: String) = add(RichTextHashtag(RichTextPlain(text), hashtag)) + fun hashtag(text: String, hashtag: String) = add(RichTextHashtag(RichTextPlain(text), hashtag)) fun hashtag(hashtag: String, block: RichTextBuilder.() -> Unit) = add(RichTextHashtag(buildRichText(block), hashtag)) - fun cashtag(cashtag: String, text: String) = add(RichTextCashtag(RichTextPlain(text), cashtag)) + fun cashtag(text: String, cashtag: String) = add(RichTextCashtag(RichTextPlain(text), cashtag)) fun cashtag(cashtag: String, block: RichTextBuilder.() -> Unit) = add(RichTextCashtag(buildRichText(block), cashtag)) - fun botCommand(botCommand: String, text: String) = add(RichTextBotCommand(RichTextPlain(text), botCommand)) + fun botCommand(text: String, botCommand: String) = add(RichTextBotCommand(RichTextPlain(text), botCommand)) fun botCommand(botCommand: String, block: RichTextBuilder.() -> Unit) = add(RichTextBotCommand(buildRichText(block), botCommand)) fun anchor(name: String) = add(RichTextAnchor(name)) - fun anchorLink(anchorName: String, text: String) = add(RichTextAnchorLink(RichTextPlain(text), anchorName)) + fun anchorLink(text: String, anchorName: String) = add(RichTextAnchorLink(RichTextPlain(text), anchorName)) fun anchorLink(anchorName: String, block: RichTextBuilder.() -> Unit) = add(RichTextAnchorLink(buildRichText(block), anchorName)) - fun reference(name: String, text: String) = add(RichTextReference(RichTextPlain(text), name)) + fun reference(text: String, name: String) = add(RichTextReference(RichTextPlain(text), name)) fun reference(name: String, block: RichTextBuilder.() -> Unit) = add(RichTextReference(buildRichText(block), name)) - fun referenceLink(referenceName: String, text: String) = + fun referenceLink(text: String, referenceName: String) = add(RichTextReferenceLink(RichTextPlain(text), referenceName)) fun referenceLink(referenceName: String, block: RichTextBuilder.() -> Unit) = add(RichTextReferenceLink(buildRichText(block), referenceName)) @@ -163,8 +164,8 @@ class RichBlocksBuilder { fun paragraph(text: String) = add(RichBlockParagraph(RichTextPlain(text))) fun paragraph(block: RichTextBuilder.() -> Unit) = add(RichBlockParagraph(buildRichText(block))) - fun heading(size: Int, text: String) = add(RichBlockSectionHeading(RichTextPlain(text), size)) - fun heading(size: Int, block: RichTextBuilder.() -> Unit) = add(RichBlockSectionHeading(buildRichText(block), size)) + fun heading(text: String, level: Int) = add(RichBlockSectionHeading(RichTextPlain(text), level)) + fun heading(level: Int, block: RichTextBuilder.() -> Unit) = add(RichBlockSectionHeading(buildRichText(block), level)) fun preformatted(text: String, language: String? = null) = add(RichBlockPreformatted(RichTextPlain(text), language)) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt index a708074dad..d31d779c5c 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt @@ -16,6 +16,7 @@ import dev.inmo.tgbotapi.types.internalUserLinkBeginning import dev.inmo.tgbotapi.types.nameField import dev.inmo.tgbotapi.types.phoneNumberField import dev.inmo.tgbotapi.types.referenceNameField +import dev.inmo.tgbotapi.types.TelegramDate import dev.inmo.tgbotapi.types.textField import dev.inmo.tgbotapi.types.typeField import dev.inmo.tgbotapi.types.unixTimeField @@ -262,7 +263,7 @@ data class RichTextDateTime( @SerialName(textField) val text: RichText, @SerialName(unixTimeField) - val unixTime: Long, + val unixTime: TelegramDate, @SerialName(dateTimeFormatField) val dateTimeFormat: String ) : RichTextEntity { @@ -276,10 +277,10 @@ data class RichTextDateTime( companion object { const val TYPE = "date_time" - fun markdown(text: RichText, unixTime: Long, dateTimeFormat: String): String = - "![${text.markdown}](tg://time?unix=$unixTime&format=$dateTimeFormat)" - fun html(text: RichText, unixTime: Long, dateTimeFormat: String): String = - "${text.html}" + fun markdown(text: RichText, unixTime: TelegramDate, dateTimeFormat: String): String = + "![${text.markdown}](tg://time?unix=${unixTime.date}&format=$dateTimeFormat)" + fun html(text: RichText, unixTime: TelegramDate, dateTimeFormat: String): String = + "${text.html}" } } diff --git a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/RichMessageSerializationTest.kt b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/RichMessageSerializationTest.kt index 774a996e72..e8d9b25824 100644 --- a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/RichMessageSerializationTest.kt +++ b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/RichMessageSerializationTest.kt @@ -39,7 +39,7 @@ class RichMessageSerializationTest { val heading = message.blocks[1] as RichBlockSectionHeading assertEquals(RichTextPlain("Title"), heading.text) - assertEquals(1, heading.size) + assertEquals(1, heading.level) assertTrue(message.blocks[2] is RichBlockDivider) diff --git a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDslTest.kt b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDslTest.kt index c4f3ca274c..a32140c8ee 100644 --- a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDslTest.kt +++ b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextDslTest.kt @@ -39,7 +39,7 @@ class RichTextDslTest { @Test fun buildsBlocks() { val blocks = buildRichBlocks { - heading(1, "Title") + heading("Title", 1) paragraph { plain("Hello ") bold("world") diff --git a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormattingTest.kt b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormattingTest.kt index 18c8d288c7..77ddc4fe0e 100644 --- a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormattingTest.kt +++ b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/rich/RichTextFormattingTest.kt @@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.types.rich import dev.inmo.tgbotapi.types.ChatId import dev.inmo.tgbotapi.types.CustomEmojiId import dev.inmo.tgbotapi.types.RawChatId +import dev.inmo.tgbotapi.types.TelegramDate import dev.inmo.tgbotapi.types.chat.CommonUser import kotlin.test.Test import kotlin.test.assertEquals @@ -73,7 +74,7 @@ class RichTextFormattingTest { @Test fun dateTime() { - val entity = RichTextDateTime(RichTextPlain("now"), 1647531900L, "wDT") + val entity = RichTextDateTime(RichTextPlain("now"), TelegramDate(1647531900L), "wDT") assertEquals("![now](tg://time?unix=1647531900&format=wDT)", entity.markdown) assertEquals("now", entity.html) } From 7e4efcd645102d1dda3ca9a1500de8b7f1ff206d Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 1 Jul 2026 12:52:55 +0600 Subject: [PATCH 24/27] rewrite RichMessageContent.createResend onto sending of simple rich message --- .../message/content/RichMessageContent.kt | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt index 5b918a96f2..43ac45a337 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt @@ -1,14 +1,16 @@ package dev.inmo.tgbotapi.types.message.content -import dev.inmo.tgbotapi.requests.ForwardMessage import dev.inmo.tgbotapi.requests.abstracts.Request +import dev.inmo.tgbotapi.requests.send.SendRichMessage import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.SuggestedPostParameters import dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage +import dev.inmo.tgbotapi.types.rich.InputRichMessageMarkdown import dev.inmo.tgbotapi.types.rich.RichTextInfo +import dev.inmo.tgbotapi.types.rich.markdown import kotlinx.serialization.Serializable @Serializable @@ -30,15 +32,19 @@ data class RichMessageContent( replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> { - @Suppress("UNCHECKED_CAST") - return ForwardMessage( - chat.id, - toChatId = chatId, - messageId = messageId, + return SendRichMessage( + chatId = chatId, + richMessage = InputRichMessageMarkdown(richMessage.markdown, isRtl = richMessage.isRtl), threadId = messageThreadId, directMessageThreadId = directMessageThreadId, + businessConnectionId = businessConnectionId, disableNotification = disableNotification, - protectContent = protectContent - ) as Request> + protectContent = protectContent, + allowPaidBroadcast = allowPaidBroadcast, + effectId = effectId, + suggestedPostParameters = suggestedPostParameters, + replyParameters = replyParameters, + replyMarkup = replyMarkup + ) } } From 5341b2eccf55d04f078917ffb50a512327046d3a Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 1 Jul 2026 13:27:09 +0600 Subject: [PATCH 25/27] apiDump --- tgbotapi.core/api/tgbotapi.core.api | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 5549edbcc6..4937da0435 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -35369,8 +35369,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlocksBuilder { public final fun divider ()V public final fun footer (Ljava/lang/String;)V public final fun footer (Lkotlin/jvm/functions/Function1;)V + public final fun heading (ILkotlin/jvm/functions/Function1;)V public final fun heading (Ljava/lang/String;I)V - public final fun heading (Lkotlin/jvm/functions/Function1;I)V public final fun list (Lkotlin/jvm/functions/Function1;)V public final fun mathematicalExpression (Ljava/lang/String;)V public final fun paragraph (Ljava/lang/String;)V @@ -35589,8 +35589,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextBuilder { public final fun code (Ljava/lang/String;)V public final fun code (Lkotlin/jvm/functions/Function1;)V public final fun customEmoji-R1fjqgo (Ljava/lang/String;Ljava/lang/String;)V + public final fun dateTime (Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public final fun dateTime (Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/lang/String;)V - public final fun dateTime (Lkotlin/jvm/functions/Function1;Ldev/inmo/tgbotapi/types/TelegramDate;Ljava/lang/String;)V public final fun email (Ljava/lang/String;Ljava/lang/String;)V public final fun email (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public final fun hashtag (Ljava/lang/String;Ljava/lang/String;)V @@ -35617,8 +35617,8 @@ public final class dev/inmo/tgbotapi/types/rich/RichTextBuilder { public final fun subscript (Lkotlin/jvm/functions/Function1;)V public final fun superscript (Ljava/lang/String;)V public final fun superscript (Lkotlin/jvm/functions/Function1;)V - public final fun textMention (Ldev/inmo/tgbotapi/types/chat/User;Ljava/lang/String;)V public final fun textMention (Ldev/inmo/tgbotapi/types/chat/User;Lkotlin/jvm/functions/Function1;)V + public final fun textMention (Ljava/lang/String;Ldev/inmo/tgbotapi/types/chat/User;)V public final fun unaryPlus (Ldev/inmo/tgbotapi/types/rich/RichText;)V public final fun underline (Ljava/lang/String;)V public final fun underline (Lkotlin/jvm/functions/Function1;)V From 68987feabbe2c5aeda9a516a5ea23e634d4e1dd8 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 1 Jul 2026 14:25:39 +0600 Subject: [PATCH 26/27] improve richblocks api and let rich message content to be correctly resendable if there are no any media block inside --- tgbotapi.core/api/tgbotapi.core.api | 40 +++++++++---- .../message/content/RichMessageContent.kt | 56 ++++++++++++++----- .../dev/inmo/tgbotapi/types/rich/RichBlock.kt | 35 ++++++++++++ .../inmo/tgbotapi/types/rich/RichBlocks.kt | 32 +++++++---- tgbotapi.utils/api/tgbotapi.utils.api | 3 + .../extensions/utils/ClassCastsNew.kt | 7 +++ 6 files changed, 139 insertions(+), 34 deletions(-) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 4937da0435..fff5dbef04 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -34515,7 +34515,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockAnchor$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/rich/RichBlockAnimation : dev/inmo/tgbotapi/types/rich/RichBlock { +public final class dev/inmo/tgbotapi/types/rich/RichBlockAnimation : dev/inmo/tgbotapi/types/rich/RichBlockMedia { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockAnimation$Companion; public static final field TYPE Ljava/lang/String; public fun (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)V @@ -34527,10 +34527,11 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockAnimation : dev/inmo/tg public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockAnimation;Ldev/inmo/tgbotapi/types/files/AnimationFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockAnimation; public fun equals (Ljava/lang/Object;)Z public final fun getAnimation ()Ldev/inmo/tgbotapi/types/files/AnimationFile; - public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; public final fun getHasSpoiler ()Ljava/lang/Boolean; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getMedia ()Ldev/inmo/tgbotapi/types/files/TelegramMediaFile; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -34553,7 +34554,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockAnimation$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/rich/RichBlockAudio : dev/inmo/tgbotapi/types/rich/RichBlock { +public final class dev/inmo/tgbotapi/types/rich/RichBlockAudio : dev/inmo/tgbotapi/types/rich/RichBlockMedia { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockAudio$Companion; public static final field TYPE Ljava/lang/String; public fun (Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)V @@ -34564,9 +34565,10 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockAudio : dev/inmo/tgbota public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockAudio;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockAudio; public fun equals (Ljava/lang/Object;)Z public final fun getAudio ()Ldev/inmo/tgbotapi/types/files/AudioFile; - public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getMedia ()Ldev/inmo/tgbotapi/types/files/TelegramMediaFile; public fun getType ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -34798,6 +34800,11 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockFormattingKt { public static final fun toRichMarkdown (Ljava/util/List;)Ljava/lang/String; } +public final class dev/inmo/tgbotapi/types/rich/RichBlockKt { + public static final fun getSubBlocks (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ljava/util/List; + public static final fun search (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/rich/RichBlock; +} + public final class dev/inmo/tgbotapi/types/rich/RichBlockList : dev/inmo/tgbotapi/types/rich/RichBlock { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockList$Companion; public static final field TYPE Ljava/lang/String; @@ -34952,6 +34959,16 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression$ public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public abstract interface class dev/inmo/tgbotapi/types/rich/RichBlockMedia : dev/inmo/tgbotapi/types/rich/RichBlock { + public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockMedia$Companion; + public abstract fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public abstract fun getMedia ()Ldev/inmo/tgbotapi/types/files/TelegramMediaFile; +} + +public final class dev/inmo/tgbotapi/types/rich/RichBlockMedia$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/types/rich/RichBlockParagraph : dev/inmo/tgbotapi/types/rich/RichBlock { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph$Companion; public static final field TYPE Ljava/lang/String; @@ -34985,7 +35002,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockParagraph$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/rich/RichBlockPhoto : dev/inmo/tgbotapi/types/rich/RichBlock { +public final class dev/inmo/tgbotapi/types/rich/RichBlockPhoto : dev/inmo/tgbotapi/types/rich/RichBlockMedia { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto$Companion; public static final field TYPE Ljava/lang/String; public synthetic fun (Ljava/util/List;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -34996,10 +35013,11 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockPhoto : dev/inmo/tgbota public final fun copy-OKnyJrA (Ljava/util/List;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto; public static synthetic fun copy-OKnyJrA$default (Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto;Ljava/util/List;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto; public fun equals (Ljava/lang/Object;)Z - public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; public final fun getHasSpoiler ()Ljava/lang/Boolean; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getMedia ()Ldev/inmo/tgbotapi/types/files/TelegramMediaFile; public final fun getPhoto-bGlShw4 ()Ljava/util/List; public fun getType ()Ljava/lang/String; public fun hashCode ()I @@ -35281,7 +35299,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockThinking$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/rich/RichBlockVideo : dev/inmo/tgbotapi/types/rich/RichBlock { +public final class dev/inmo/tgbotapi/types/rich/RichBlockVideo : dev/inmo/tgbotapi/types/rich/RichBlockMedia { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockVideo$Companion; public static final field TYPE Ljava/lang/String; public fun (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)V @@ -35292,10 +35310,11 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockVideo : dev/inmo/tgbota public final fun copy (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ldev/inmo/tgbotapi/types/rich/RichBlockVideo; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockVideo;Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockVideo; public fun equals (Ljava/lang/Object;)Z - public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; public final fun getHasSpoiler ()Ljava/lang/Boolean; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getMedia ()Ldev/inmo/tgbotapi/types/files/TelegramMediaFile; public fun getType ()Ljava/lang/String; public final fun getVideo ()Ldev/inmo/tgbotapi/types/files/VideoFile; public fun hashCode ()I @@ -35319,7 +35338,7 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockVideo$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class dev/inmo/tgbotapi/types/rich/RichBlockVoiceNote : dev/inmo/tgbotapi/types/rich/RichBlock { +public final class dev/inmo/tgbotapi/types/rich/RichBlockVoiceNote : dev/inmo/tgbotapi/types/rich/RichBlockMedia { public static final field Companion Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote$Companion; public static final field TYPE Ljava/lang/String; public fun (Ldev/inmo/tgbotapi/types/files/VoiceFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)V @@ -35329,9 +35348,10 @@ public final class dev/inmo/tgbotapi/types/rich/RichBlockVoiceNote : dev/inmo/tg public final fun copy (Ldev/inmo/tgbotapi/types/files/VoiceFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;)Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote; public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote;Ldev/inmo/tgbotapi/types/files/VoiceFile;Ldev/inmo/tgbotapi/types/rich/RichBlockCaption;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/rich/RichBlockVoiceNote; public fun equals (Ljava/lang/Object;)Z - public final fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; + public fun getCaption ()Ldev/inmo/tgbotapi/types/rich/RichBlockCaption; public fun getHtml ()Ljava/lang/String; public fun getMarkdown ()Ljava/lang/String; + public fun getMedia ()Ldev/inmo/tgbotapi/types/files/TelegramMediaFile; public fun getType ()Ljava/lang/String; public final fun getVoiceNote ()Ldev/inmo/tgbotapi/types/files/VoiceFile; public fun hashCode ()I diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt index 43ac45a337..6727ef826f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/RichMessageContent.kt @@ -1,6 +1,8 @@ package dev.inmo.tgbotapi.types.message.content +import dev.inmo.tgbotapi.requests.ForwardMessage import dev.inmo.tgbotapi.requests.abstracts.Request +import dev.inmo.tgbotapi.requests.send.CopyMessage import dev.inmo.tgbotapi.requests.send.SendRichMessage import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId @@ -9,8 +11,14 @@ import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.message.SuggestedPostParameters import dev.inmo.tgbotapi.types.message.abstracts.ChatContentMessage import dev.inmo.tgbotapi.types.rich.InputRichMessageMarkdown +import dev.inmo.tgbotapi.types.rich.RichBlock +import dev.inmo.tgbotapi.types.rich.RichBlockAudio +import dev.inmo.tgbotapi.types.rich.RichBlockMedia +import dev.inmo.tgbotapi.types.rich.RichBlockPhoto +import dev.inmo.tgbotapi.types.rich.RichBlockVideo import dev.inmo.tgbotapi.types.rich.RichTextInfo import dev.inmo.tgbotapi.types.rich.markdown +import dev.inmo.tgbotapi.types.rich.search import kotlinx.serialization.Serializable @Serializable @@ -32,19 +40,39 @@ data class RichMessageContent( replyParameters: ReplyParameters?, replyMarkup: KeyboardMarkup? ): Request> { - return SendRichMessage( - chatId = chatId, - richMessage = InputRichMessageMarkdown(richMessage.markdown, isRtl = richMessage.isRtl), - threadId = messageThreadId, - directMessageThreadId = directMessageThreadId, - businessConnectionId = businessConnectionId, - disableNotification = disableNotification, - protectContent = protectContent, - allowPaidBroadcast = allowPaidBroadcast, - effectId = effectId, - suggestedPostParameters = suggestedPostParameters, - replyParameters = replyParameters, - replyMarkup = replyMarkup - ) + val isThereMedia = richMessage.blocks.any { + it.search { + this is RichBlockMedia + } != null + } + return if (isThereMedia) { + @Suppress("UNCHECKED_CAST") + ForwardMessage( + chat.id, + toChatId = chatId, + messageId = messageId, + threadId = messageThreadId, + directMessageThreadId = directMessageThreadId, + disableNotification = disableNotification, + protectContent = protectContent, + effectId = effectId, + suggestedPostParameters = suggestedPostParameters, + ) as Request> + } else { + SendRichMessage( + chatId = chatId, + richMessage = InputRichMessageMarkdown(richMessage.markdown, isRtl = richMessage.isRtl), + threadId = messageThreadId, + directMessageThreadId = directMessageThreadId, + businessConnectionId = businessConnectionId, + disableNotification = disableNotification, + protectContent = protectContent, + allowPaidBroadcast = allowPaidBroadcast, + effectId = effectId, + suggestedPostParameters = suggestedPostParameters, + replyParameters = replyParameters, + replyMarkup = replyMarkup + ) + } } } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlock.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlock.kt index 6ab799ec33..8b4af5b63d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlock.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlock.kt @@ -1,5 +1,7 @@ package dev.inmo.tgbotapi.types.rich +import dev.inmo.tgbotapi.requests.abstracts.FileId +import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.typeField import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded import kotlinx.serialization.DeserializationStrategy @@ -30,6 +32,39 @@ sealed interface RichBlock { val html: String } +@Serializable(RichBlockSerializer::class) +sealed interface RichBlockMedia : RichBlock { + val media: TelegramMediaFile + val caption: RichBlockCaption? +} + +/** + * The nested [RichBlock]s directly contained by this block, or an empty list for leaf blocks. Container blocks + * ([RichBlockList] via its [RichBlockListItem.blocks], [RichBlockBlockQuotation], [RichBlockCollage], + * [RichBlockSlideshow] and [RichBlockDetails]) expose their children here. + */ +val RichBlock.subBlocks: List + get() = when (this) { + is RichBlockList -> items.flatMap { it.blocks } + is RichBlockBlockQuotation -> blocks + is RichBlockCollage -> blocks + is RichBlockSlideshow -> blocks + is RichBlockDetails -> blocks + else -> emptyList() + } + +/** + * Walks this [RichBlock] and all of its [subBlocks] recursively (depth-first, this block first) and returns the first + * block for which [block] returns `true`, or `null` if none matches. + */ +fun RichBlock.search(block: RichBlock.() -> Boolean): RichBlock? { + if (block()) return this + for (child in subBlocks) { + child.search(block)?.let { return it } + } + return null +} + object RichBlockSerializer : JsonContentPolymorphicSerializer(RichBlock::class) { override fun selectDeserializer(element: JsonElement): DeserializationStrategy { return when (val type = element.jsonObject[typeField]?.jsonPrimitive?.content) { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt index 8db919ee6e..8310ae8bdc 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichBlocks.kt @@ -10,6 +10,7 @@ import dev.inmo.tgbotapi.types.expressionField import dev.inmo.tgbotapi.types.files.AnimationFile import dev.inmo.tgbotapi.types.files.AudioFile import dev.inmo.tgbotapi.types.files.PhotoFile +import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.files.VideoFile import dev.inmo.tgbotapi.types.files.VoiceFile import dev.inmo.tgbotapi.types.hasSpoilerField @@ -537,8 +538,8 @@ data class RichBlockAnimation( @SerialName(hasSpoilerField) val hasSpoiler: Boolean? = null, @SerialName(captionField) - val caption: RichBlockCaption? = null -) : RichBlock { + override val caption: RichBlockCaption? = null +) : RichBlockMedia { @EncodeDefault @SerialName(typeField) override val type: String = TYPE @@ -546,6 +547,9 @@ data class RichBlockAnimation( override val markdown: String = markdown(animation, caption) override val html: String = html(animation, hasSpoiler, caption) + override val media: TelegramMediaFile + get() = animation + companion object { const val TYPE = "animation" fun markdown(animation: AnimationFile, caption: RichBlockCaption?): String = @@ -565,14 +569,16 @@ data class RichBlockAudio( @SerialName(audioField) val audio: AudioFile, @SerialName(captionField) - val caption: RichBlockCaption? = null -) : RichBlock { + override val caption: RichBlockCaption? = null +) : RichBlockMedia { @EncodeDefault @SerialName(typeField) override val type: String = TYPE override val markdown: String = markdown(audio, caption) override val html: String = html(audio, caption) + override val media: TelegramMediaFile + get() = audio companion object { const val TYPE = "audio" @@ -595,14 +601,16 @@ data class RichBlockPhoto( @SerialName(hasSpoilerField) val hasSpoiler: Boolean? = null, @SerialName(captionField) - val caption: RichBlockCaption? = null -) : RichBlock { + override val caption: RichBlockCaption? = null +) : RichBlockMedia { @EncodeDefault @SerialName(typeField) override val type: String = TYPE override val markdown: String = markdown(photo, caption) override val html: String = html(photo, hasSpoiler, caption) + override val media: TelegramMediaFile + get() = photo companion object { const val TYPE = "photo" @@ -625,14 +633,16 @@ data class RichBlockVideo( @SerialName(hasSpoilerField) val hasSpoiler: Boolean? = null, @SerialName(captionField) - val caption: RichBlockCaption? = null -) : RichBlock { + override val caption: RichBlockCaption? = null +) : RichBlockMedia { @EncodeDefault @SerialName(typeField) override val type: String = TYPE override val markdown: String = markdown(video, caption) override val html: String = html(video, hasSpoiler, caption) + override val media: TelegramMediaFile + get() = video companion object { const val TYPE = "video" @@ -653,14 +663,16 @@ data class RichBlockVoiceNote( @SerialName(voiceNoteField) val voiceNote: VoiceFile, @SerialName(captionField) - val caption: RichBlockCaption? = null -) : RichBlock { + override val caption: RichBlockCaption? = null +) : RichBlockMedia { @EncodeDefault @SerialName(typeField) override val type: String = TYPE override val markdown: String = markdown(voiceNote, caption) override val html: String = html(voiceNote, caption) + override val media: TelegramMediaFile + get() = voiceNote companion object { const val TYPE = "voice_note" diff --git a/tgbotapi.utils/api/tgbotapi.utils.api b/tgbotapi.utils/api/tgbotapi.utils.api index 47171990f2..ae36749687 100644 --- a/tgbotapi.utils/api/tgbotapi.utils.api +++ b/tgbotapi.utils/api/tgbotapi.utils.api @@ -2094,6 +2094,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifRichBlockList (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifRichBlockMap (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifRichBlockMathematicalExpression (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifRichBlockMedia (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifRichBlockParagraph (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifRichBlockPhoto (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifRichBlockPreformatted (Ldev/inmo/tgbotapi/types/rich/RichBlock;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -2769,6 +2770,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun richBlockMapOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockMap; public static final fun richBlockMathematicalExpressionOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression; public static final fun richBlockMathematicalExpressionOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockMathematicalExpression; + public static final fun richBlockMediaOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockMedia; + public static final fun richBlockMediaOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockMedia; public static final fun richBlockParagraphOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph; public static final fun richBlockParagraphOrThrow (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockParagraph; public static final fun richBlockPhotoOrNull (Ldev/inmo/tgbotapi/types/rich/RichBlock;)Ldev/inmo/tgbotapi/types/rich/RichBlockPhoto; 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 3a94bb90f9..8670209609 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 @@ -562,6 +562,7 @@ import dev.inmo.tgbotapi.types.rich.RichBlockFooter import dev.inmo.tgbotapi.types.rich.RichBlockList import dev.inmo.tgbotapi.types.rich.RichBlockMap import dev.inmo.tgbotapi.types.rich.RichBlockMathematicalExpression +import dev.inmo.tgbotapi.types.rich.RichBlockMedia import dev.inmo.tgbotapi.types.rich.RichBlockParagraph import dev.inmo.tgbotapi.types.rich.RichBlockPhoto import dev.inmo.tgbotapi.types.rich.RichBlockPreformatted @@ -3629,6 +3630,12 @@ public inline fun RichBlock.richBlockThinkingOrThrow(): RichBlockThinking = this public inline fun RichBlock.ifRichBlockThinking(block: (RichBlockThinking) -> T): T? = richBlockThinkingOrNull() ?.let(block) +public inline fun RichBlock.richBlockMediaOrNull(): RichBlockMedia? = this as? dev.inmo.tgbotapi.types.rich.RichBlockMedia + +public inline fun RichBlock.richBlockMediaOrThrow(): RichBlockMedia = this as dev.inmo.tgbotapi.types.rich.RichBlockMedia + +public inline fun RichBlock.ifRichBlockMedia(block: (RichBlockMedia) -> T): T? = richBlockMediaOrNull() ?.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 From fc764d1f95fab2cf34c1f4e14f4db1d27619762f Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 1 Jul 2026 15:42:11 +0600 Subject: [PATCH 27/27] add note about support of telegram bot api 10.1 and fix changelogs --- CHANGELOG.md | 16 +++++++++++++--- README.md | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5045a16cd..4af48acdc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,21 @@ **THIS UPDATE CONTAINS SUPPORT OF [TELEGRAM BOTS API 10.1](https://core.telegram.org/bots/api-changelog#june-11-2026)** +**Breaking changes**: + +* `EditTextChatMessage.text` changed from `String` to `String?` (rich edits carry no text) — implementations overriding it must widen the type and readers must handle `null` +* `EditChatMessageText.text` changed from `String` to `String?`; its `textSources` is now `null` when there is no text — code reading `text` as non-null must handle `null` +* `ExtendedBot` gained the `supportsJoinRequestQueries` field inserted between `supportsGuestQueries` and `canConnectToBusiness` — positional constructor calls and `componentN` destructuring shift and must be updated + +**Migration advice**: Handle nullable `text` on `EditTextChatMessage`/`EditChatMessageText`; construct `ExtendedBot` with named arguments + * `Core`: - * (`Rich Messages`) Added `RichText` (`RichTextPlain`, `RichTextGroup`, `RichTextEntity`) hierarchy with all 24 `RichText*` entity types and a recursive serializer supporting plain strings, arrays and typed objects - * (`Rich Messages`) Added `RichBlock` hierarchy with all 21 `RichBlock*` types plus `RichBlockCaption`, `RichBlockTableCell` and `RichBlockListItem` - * (`Rich Messages`) Added `RichMessage` type and `RichMessageContent` message content; parsed `rich_message` in `RawMessage`; added `RichMessageContentMessage` typealias + * (`Rich Messages`) Added `RichText` (`RichTextPlain`, `RichTextGroup`, `RichTextEntity`) hierarchy with all 25 `RichText*` entity types and a recursive serializer supporting plain strings, arrays and typed objects; every `RichText` exposes `rawText`, `markdown` and `html` renderings + * (`Rich Messages`) Added `RichBlock` hierarchy with all 21 `RichBlock*` types plus `RichBlockCaption`, `RichBlockTableCell` and `RichBlockListItem`; every `RichBlock` exposes `markdown`/`html` source, the `RichBlockMedia` marker interface and `subBlocks`/`search` navigation helpers + * (`Rich Messages`) Added `RichTextInfo` type (with `markdown`/`html` source built from its blocks) and `RichMessageContent` message content; `RichMessageContent.createResend` re-sends the content (forwarded when it contains media blocks, otherwise re-built through `SendRichMessage`); parsed `rich_message` in `RawMessage`; added `RichMessageContentMessage` typealias * (`Rich Messages`) Added `InputRichMessage` (internal constructor with `InputRichMessageHTML`/`InputRichMessageMarkdown` factories) and `InputRichMessageContent` usable as `InputMessageContent` + * (`Rich Messages`) Added Rich Messages DSL builders `buildRichText`/`RichTextBuilder`, `buildRichBlocks`/`RichBlocksBuilder`, `buildRichTextInfo` and `RichBlockListBuilder` (marked with the `@RichTextDsl` DSL marker) + * (`Rich Messages`) Added Rich Markdown/HTML source helpers `String.escapeRichMarkdown()` and `List.toRichMarkdown()`/`toRichHtml()` * (`Rich Messages`) Added `SendRichMessage` and `SendRichMessageDraft` requests * (`Rich Messages`) Added `richMessage` parameter to `EditChatMessageText`; its `text` is now nullable (per API) and the `EditChatMessageRichText` factory builds a rich edit; widened `EditTextChatMessage.text` to nullable * (`Polls`) Added `Link` type (`dev.inmo.tgbotapi.types.Link`) implementing `PollMedia`, carrying the `url` of a link attached to a poll option diff --git a/README.md b/README.md index 31c591b431..3c0c771d00 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TelegramBotAPI [![Maven Central Version](https://img.shields.io/maven-central/v/dev.inmo/tgbotapi)](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-10.0-blue)](https://core.telegram.org/bots/api-changelog#may-8-2026) +# TelegramBotAPI [![Maven Central Version](https://img.shields.io/maven-central/v/dev.inmo/tgbotapi)](https://central.sonatype.com/artifact/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-10.1-blue)](https://core.telegram.org/bots/api-changelog#june-11-2026) | 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=Mk&message=Docs&color=blue&logo=mkdocs)](https://docs.inmo.dev/tgbotapi/index.html) | |:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|