From 21ba1cca30b9dbc3546e4da344b6070eae84dca2 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Mon, 12 Aug 2024 23:46:53 +0200 Subject: [PATCH 01/19] Delay after executing action in sendActionDSL --- .../dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt index 17d5e175e8..ee38522ff6 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt @@ -24,10 +24,10 @@ public suspend fun TelegramBot.withAction( } val botActionJob = CoroutineScope(currentCoroutineContext()).launch { while (isActive) { - delay(refreshTime) safelyWithoutExceptions { execute(actionRequest) } + delay(refreshTime) } } val result = safelyWithResult { block() } From f58a28d0624c193d4ae9d4c4591c8f4b6813bdf2 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 14 Aug 2024 19:29:56 +0600 Subject: [PATCH 02/19] start 17.0.0 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fd9c68fe4..9b499db4ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # TelegramBotAPI changelog +## 17.0.0 + ## 16.0.0 **THIS UPDATE CONTAINS KOTLIN UPDATE UP TO 2.0** diff --git a/gradle.properties b/gradle.properties index 831213f6b3..f7e2118aea 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=16.0.0 +library_version=17.0.0 From b469b1c7898026335bd08ad95e166ab677df216e Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 14 Aug 2024 19:47:29 +0600 Subject: [PATCH 03/19] start implementation of superchannels --- .../dev/inmo/tgbotapi/abstracts/FromUser.kt | 16 +- .../dev/inmo/tgbotapi/abstracts/WithUser.kt | 12 +- .../dev/inmo/tgbotapi/types/RawChatId.kt | 1 + .../message/ChannelContentMessageImpl.kt | 5 +- .../inmo/tgbotapi/types/message/RawMessage.kt | 19 +- .../abstracts/ChannelContentMessage.kt | 2 +- .../message/abstracts/FromUserMessage.kt | 5 +- .../inmo/tgbotapi/utils/TelegramFakeUser.kt | 14 + .../MediaGroupContentMessageCreator.kt | 1 + .../extensions/utils/ClassCastsNew.kt | 528 ++++++++++-------- .../extensions/utils/ClassCastsNewAny.kt | 20 + .../utils/extensions/raw/Message.kt | 2 +- 12 files changed, 378 insertions(+), 247 deletions(-) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/TelegramFakeUser.kt diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/FromUser.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/FromUser.kt index aae284a45e..6bdb6dcde8 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/FromUser.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/FromUser.kt @@ -6,11 +6,23 @@ import dev.inmo.tgbotapi.types.chat.User * Inheritors of this interface have some [User] as a source of data. For example, any [dev.inmo.tgbotapi.types.queries.callback.CallbackQuery] * have [User] as the source of that query */ -interface FromUser : WithUser { +interface OptionallyFromUser : OptionallyWithUser { /** * The source [User] of this type */ - val from: User + val from: User? + override val user: User? + get() = from +} +/** + * Inheritors of this interface have some [User] as a source of data. For example, any [dev.inmo.tgbotapi.types.queries.callback.CallbackQuery] + * have [User] as the source of that query + */ +interface FromUser : OptionallyFromUser, WithUser { + /** + * The source [User] of this type + */ + override val from: User override val user: User get() = from } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/WithUser.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/WithUser.kt index fb107ead22..ab84ded0f1 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/WithUser.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/WithUser.kt @@ -9,6 +9,14 @@ import dev.inmo.tgbotapi.types.chat.User * @see FromUser */ @ClassCastsIncluded(excludeRegex = ".*Impl") -interface WithUser { - val user: User +interface OptionallyWithUser { + val user: User? +} +/** + * All inheritors of this type have [User] in their data as one of the main data + * + * @see FromUser + */ +interface WithUser : OptionallyWithUser { + override val user: User } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/RawChatId.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/RawChatId.kt index e8ccc5a40b..d6e8cabba4 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/RawChatId.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/RawChatId.kt @@ -10,6 +10,7 @@ value class RawChatId( ) { companion object { val DefaultUserId = RawChatId(136817688L) // I do not know why, it is Telegram crutch + val FakeUserId = RawChatId(777000L) // Brought with Telegram Bot API 7.9 as backward compatibility value for from field } override fun toString(): String { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelContentMessageImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelContentMessageImpl.kt index 1a9fd81ac6..50bea7370e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelContentMessageImpl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelContentMessageImpl.kt @@ -5,11 +5,13 @@ import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.chat.CommonBot import dev.inmo.tgbotapi.types.chat.PreviewChannelChat +import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.message.abstracts.* import dev.inmo.tgbotapi.types.message.content.MessageContent data class ChannelContentMessageImpl( override val messageId: MessageId, + override val from: User?, override val chat: PreviewChannelChat, override val content: T, override val date: DateTime, @@ -25,6 +27,7 @@ data class ChannelContentMessageImpl( ) : ChannelContentMessage { constructor( messageId: MessageId, + from: User?, chat: PreviewChannelChat, content: T, date: DateTime, @@ -38,6 +41,6 @@ data class ChannelContentMessageImpl( mediaGroupId: MediaGroupId?, fromOffline: Boolean, ) : this( - messageId, chat, content, date, editDate, hasProtectedContent, forwardInfo.messageOrigin(), replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, senderBot, authorSignature, mediaGroupId, fromOffline + messageId, from, chat, content, date, editDate, hasProtectedContent, forwardInfo.messageOrigin(), replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, senderBot, authorSignature, mediaGroupId, fromOffline ) } 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 2c42e9e2f0..ae73502f94 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 @@ -37,6 +37,7 @@ import dev.inmo.tgbotapi.types.request.ChatShared import dev.inmo.tgbotapi.types.request.UsersShared import dev.inmo.tgbotapi.types.stories.Story import dev.inmo.tgbotapi.types.venue.Venue +import dev.inmo.tgbotapi.utils.isFakeTelegramUser import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlin.reflect.KClass @@ -160,6 +161,7 @@ internal data class RawMessage( private val giveaway_created: GiveawayCreated? = null, private val giveaway_completed: GiveawayPrivateResults? = null, ) { + private val checkedFrom = from ?.takeIf { !it.isFakeTelegramUser() } private val content: MessageContent? by lazy { val adaptedCaptionEntities = caption ?.let { (caption_entities ?: emptyList()).asTextSources(caption) @@ -298,14 +300,14 @@ internal data class RawMessage( when (chat) { is PreviewSupergroupChat -> CommonSupergroupEventMessage( messageId, - from ?: error("Supergroup events are expected to contain 'from' field"), + checkedFrom ?: from ?: error("Supergroup events are expected to contain 'from' field"), chat, chatEvent as? SupergroupEvent ?: throwWrongChatEvent(SupergroupEvent::class, chatEvent), date.asDate ) is PreviewGroupChat -> CommonGroupEventMessage( messageId, - from ?: error("Supergroup events are expected to contain 'from' field"), + checkedFrom ?: from ?: error("Supergroup events are expected to contain 'from' field"), chat, chatEvent as? GroupEvent ?: throwWrongChatEvent(GroupChat::class, chatEvent), date.asDate @@ -337,6 +339,7 @@ internal data class RawMessage( is PreviewPublicChat -> when (chat) { is PreviewChannelChat -> ChannelContentMessageImpl( messageId = messageId, + from = checkedFrom ?: from, chat = chat, content = content, date = date.asDate, @@ -396,7 +399,7 @@ internal data class RawMessage( chat = actualForumChat, messageId = messageId, threadId = messageThreadId, - from = from ?: error("It is expected that in messages from non anonymous users and channels user must be specified"), + from = checkedFrom ?: from ?: error("It is expected that in messages from non anonymous users and channels user must be specified"), date = date.asDate, forwardOrigin = forward_origin, editDate = edit_date ?.asDate, @@ -465,7 +468,7 @@ internal data class RawMessage( null -> CommonGroupContentMessageImpl( chat = chat, messageId = messageId, - from = from ?: error("It is expected that in messages from non anonymous users and channels user must be specified"), + from = checkedFrom ?: from ?: error("It is expected that in messages from non anonymous users and channels user must be specified"), date = date.asDate, forwardOrigin = forward_origin, editDate = edit_date ?.asDate, @@ -534,7 +537,7 @@ internal data class RawMessage( null -> CommonGroupContentMessageImpl( chat = chat, messageId = messageId, - from = from ?: error("It is expected that in messages from non anonymous users and channels user must be specified"), + from = checkedFrom ?: from ?: error("It is expected that in messages from non anonymous users and channels user must be specified"), date = date.asDate, forwardOrigin = forward_origin, editDate = edit_date ?.asDate, @@ -552,7 +555,7 @@ internal data class RawMessage( is PreviewPrivateChat -> if (business_connection_id == null) { PrivateContentMessageImpl( messageId = messageId, - from = from ?: error("Was detected common message, but owner (sender) of the message was not found"), + from = checkedFrom ?: from ?: error("Was detected common message, but owner (sender) of the message was not found"), chat = chat, content = content, date = date.asDate, @@ -569,7 +572,7 @@ internal data class RawMessage( } else { BusinessContentMessageImpl( messageId = messageId, - from = from ?: error("Was detected common message, but owner (sender) of the message was not found"), + from = checkedFrom ?: from ?: error("Was detected common message, but owner (sender) of the message was not found"), chat = BusinessChatImpl( chat.id.toBusinessChatId(business_connection_id), chat @@ -594,7 +597,7 @@ internal data class RawMessage( PassportMessage( messageId, chat, - from ?: error("For passport must be provided user, but got null"), + checkedFrom ?: from ?: error("For passport must be provided user, but got null"), date.asDate, passport_data ) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage.kt index 1cb54a4762..435466e558 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage.kt @@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.types.chat.ChannelChat import dev.inmo.tgbotapi.types.chat.PreviewChannelChat import dev.inmo.tgbotapi.types.message.content.MessageContent -interface ChannelContentMessage : PossiblySentViaBotCommonMessage, SignedMessage, WithSenderChatMessage { +interface ChannelContentMessage : PossiblySentViaBotCommonMessage, SignedMessage, WithSenderChatMessage, OptionallyFromUserMessage { override val chat: PreviewChannelChat override val senderChat: PreviewChannelChat get() = chat diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/FromUserMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/FromUserMessage.kt index 4c568b1c50..f5db3a0433 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/FromUserMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/FromUserMessage.kt @@ -1,5 +1,8 @@ package dev.inmo.tgbotapi.types.message.abstracts import dev.inmo.tgbotapi.abstracts.FromUser +import dev.inmo.tgbotapi.abstracts.OptionallyFromUser -interface FromUserMessage : FromUser, AccessibleMessage +interface OptionallyFromUserMessage : OptionallyFromUser, AccessibleMessage + +interface FromUserMessage : OptionallyFromUserMessage, FromUser diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/TelegramFakeUser.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/TelegramFakeUser.kt new file mode 100644 index 0000000000..9f3306ea06 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/TelegramFakeUser.kt @@ -0,0 +1,14 @@ +package dev.inmo.tgbotapi.utils + +import dev.inmo.tgbotapi.types.RawChatId +import dev.inmo.tgbotapi.types.UserId +import dev.inmo.tgbotapi.types.chat.CommonUser +import dev.inmo.tgbotapi.types.chat.User + +val TelegramFakeUser = CommonUser( + id = UserId(RawChatId.FakeUserId), + firstName = "Telegram" +) + +fun User.isFakeTelegramUser() = id == TelegramFakeUser.id && firstName == TelegramFakeUser.firstName + diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/extensions/MediaGroupContentMessageCreator.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/extensions/MediaGroupContentMessageCreator.kt index 3770eeb27c..b131db0432 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/extensions/MediaGroupContentMessageCreator.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/extensions/MediaGroupContentMessageCreator.kt @@ -17,6 +17,7 @@ fun List>.asMedia return when (sourceMessage) { is ChannelContentMessage -> ChannelContentMessageImpl( messageId = sourceMessage.messageId, + from = sourceMessage.from, chat = sourceMessage.chat, content = content, date = sourceMessage.date, 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 e1059824f9..3386b01d4a 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 @@ -11,6 +11,8 @@ package dev.inmo.tgbotapi.extensions.utils import dev.inmo.tgbotapi.abstracts.CommonSendInvoiceData import dev.inmo.tgbotapi.abstracts.FromUser +import dev.inmo.tgbotapi.abstracts.OptionallyFromUser +import dev.inmo.tgbotapi.abstracts.OptionallyWithUser import dev.inmo.tgbotapi.abstracts.WithUser import dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink @@ -296,6 +298,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.GroupContentMessage import dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage import dev.inmo.tgbotapi.types.message.abstracts.InaccessibleMessage import dev.inmo.tgbotapi.types.message.abstracts.Message +import dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage import dev.inmo.tgbotapi.types.message.abstracts.PossiblyEditedMessage import dev.inmo.tgbotapi.types.message.abstracts.PossiblyForwardedMessage import dev.inmo.tgbotapi.types.message.abstracts.PossiblyMediaGroupMessage @@ -525,519 +528,573 @@ public inline fun CommonSendInvoiceData.ifInputInvoiceMessageContent(block: (InputInvoiceMessageContent) -> T): T? = inputInvoiceMessageContentOrNull() ?.let(block) -public inline fun WithUser.fromUserOrNull(): FromUser? = this as? +public inline fun OptionallyWithUser.optionallyFromUserOrNull(): OptionallyFromUser? = this as? + dev.inmo.tgbotapi.abstracts.OptionallyFromUser + +public inline fun OptionallyWithUser.optionallyFromUserOrThrow(): OptionallyFromUser = this as + dev.inmo.tgbotapi.abstracts.OptionallyFromUser + +public inline fun OptionallyWithUser.ifOptionallyFromUser(block: (OptionallyFromUser) -> T): T? + = optionallyFromUserOrNull() ?.let(block) + +public inline fun OptionallyWithUser.fromUserOrNull(): FromUser? = this as? dev.inmo.tgbotapi.abstracts.FromUser -public inline fun WithUser.fromUserOrThrow(): FromUser = this as +public inline fun OptionallyWithUser.fromUserOrThrow(): FromUser = this as dev.inmo.tgbotapi.abstracts.FromUser -public inline fun WithUser.ifFromUser(block: (FromUser) -> T): T? = fromUserOrNull() +public inline fun OptionallyWithUser.ifFromUser(block: (FromUser) -> T): T? = fromUserOrNull() ?.let(block) -public inline fun WithUser.chatInviteLinkOrNull(): ChatInviteLink? = this as? +public inline fun OptionallyWithUser.withUserOrNull(): WithUser? = this as? + dev.inmo.tgbotapi.abstracts.WithUser + +public inline fun OptionallyWithUser.withUserOrThrow(): WithUser = this as + dev.inmo.tgbotapi.abstracts.WithUser + +public inline fun OptionallyWithUser.ifWithUser(block: (WithUser) -> T): T? = withUserOrNull() + ?.let(block) + +public inline fun OptionallyWithUser.chatInviteLinkOrNull(): ChatInviteLink? = this as? dev.inmo.tgbotapi.types.ChatInviteLink -public inline fun WithUser.chatInviteLinkOrThrow(): ChatInviteLink = this as +public inline fun OptionallyWithUser.chatInviteLinkOrThrow(): ChatInviteLink = this as dev.inmo.tgbotapi.types.ChatInviteLink -public inline fun WithUser.ifChatInviteLink(block: (ChatInviteLink) -> T): T? = +public inline fun OptionallyWithUser.ifChatInviteLink(block: (ChatInviteLink) -> T): T? = chatInviteLinkOrNull() ?.let(block) -public inline fun WithUser.secondaryChatInviteLinkOrNull(): SecondaryChatInviteLink? = this as? - dev.inmo.tgbotapi.types.SecondaryChatInviteLink +public inline fun OptionallyWithUser.secondaryChatInviteLinkOrNull(): SecondaryChatInviteLink? = + this as? dev.inmo.tgbotapi.types.SecondaryChatInviteLink -public inline fun WithUser.secondaryChatInviteLinkOrThrow(): SecondaryChatInviteLink = this as - dev.inmo.tgbotapi.types.SecondaryChatInviteLink - -public inline fun WithUser.ifSecondaryChatInviteLink(block: (SecondaryChatInviteLink) -> T): T? - = secondaryChatInviteLinkOrNull() ?.let(block) - -public inline fun WithUser.primaryInviteLinkOrNull(): PrimaryInviteLink? = this as? - dev.inmo.tgbotapi.types.PrimaryInviteLink - -public inline fun WithUser.primaryInviteLinkOrThrow(): PrimaryInviteLink = this as - dev.inmo.tgbotapi.types.PrimaryInviteLink - -public inline fun WithUser.ifPrimaryInviteLink(block: (PrimaryInviteLink) -> T): T? = - primaryInviteLinkOrNull() ?.let(block) - -public inline fun WithUser.chatInviteLinkWithJoinRequestOrNull(): ChatInviteLinkWithJoinRequest? = - this as? dev.inmo.tgbotapi.types.ChatInviteLinkWithJoinRequest - -public inline fun WithUser.chatInviteLinkWithJoinRequestOrThrow(): ChatInviteLinkWithJoinRequest = - this as dev.inmo.tgbotapi.types.ChatInviteLinkWithJoinRequest +public inline fun OptionallyWithUser.secondaryChatInviteLinkOrThrow(): SecondaryChatInviteLink = + this as dev.inmo.tgbotapi.types.SecondaryChatInviteLink public inline fun - WithUser.ifChatInviteLinkWithJoinRequest(block: (ChatInviteLinkWithJoinRequest) -> T): T? = - chatInviteLinkWithJoinRequestOrNull() ?.let(block) + OptionallyWithUser.ifSecondaryChatInviteLink(block: (SecondaryChatInviteLink) -> T): T? = + secondaryChatInviteLinkOrNull() ?.let(block) -public inline fun WithUser.chatInviteLinkWithLimitedMembersOrNull(): +public inline fun OptionallyWithUser.primaryInviteLinkOrNull(): PrimaryInviteLink? = this as? + dev.inmo.tgbotapi.types.PrimaryInviteLink + +public inline fun OptionallyWithUser.primaryInviteLinkOrThrow(): PrimaryInviteLink = this as + dev.inmo.tgbotapi.types.PrimaryInviteLink + +public inline fun OptionallyWithUser.ifPrimaryInviteLink(block: (PrimaryInviteLink) -> T): T? = + primaryInviteLinkOrNull() ?.let(block) + +public inline fun OptionallyWithUser.chatInviteLinkWithJoinRequestOrNull(): + ChatInviteLinkWithJoinRequest? = this as? dev.inmo.tgbotapi.types.ChatInviteLinkWithJoinRequest + +public inline fun OptionallyWithUser.chatInviteLinkWithJoinRequestOrThrow(): + ChatInviteLinkWithJoinRequest = this as dev.inmo.tgbotapi.types.ChatInviteLinkWithJoinRequest + +public inline fun + OptionallyWithUser.ifChatInviteLinkWithJoinRequest(block: (ChatInviteLinkWithJoinRequest) -> T): + T? = chatInviteLinkWithJoinRequestOrNull() ?.let(block) + +public inline fun OptionallyWithUser.chatInviteLinkWithLimitedMembersOrNull(): ChatInviteLinkWithLimitedMembers? = this as? dev.inmo.tgbotapi.types.ChatInviteLinkWithLimitedMembers -public inline fun WithUser.chatInviteLinkWithLimitedMembersOrThrow(): +public inline fun OptionallyWithUser.chatInviteLinkWithLimitedMembersOrThrow(): ChatInviteLinkWithLimitedMembers = this as dev.inmo.tgbotapi.types.ChatInviteLinkWithLimitedMembers public inline fun - WithUser.ifChatInviteLinkWithLimitedMembers(block: (ChatInviteLinkWithLimitedMembers) -> T): T? - = chatInviteLinkWithLimitedMembersOrNull() ?.let(block) + OptionallyWithUser.ifChatInviteLinkWithLimitedMembers(block: (ChatInviteLinkWithLimitedMembers) -> T): + T? = chatInviteLinkWithLimitedMembersOrNull() ?.let(block) -public inline fun WithUser.chatInviteLinkUnlimitedOrNull(): ChatInviteLinkUnlimited? = this as? - dev.inmo.tgbotapi.types.ChatInviteLinkUnlimited +public inline fun OptionallyWithUser.chatInviteLinkUnlimitedOrNull(): ChatInviteLinkUnlimited? = + this as? dev.inmo.tgbotapi.types.ChatInviteLinkUnlimited -public inline fun WithUser.chatInviteLinkUnlimitedOrThrow(): ChatInviteLinkUnlimited = this as - dev.inmo.tgbotapi.types.ChatInviteLinkUnlimited +public inline fun OptionallyWithUser.chatInviteLinkUnlimitedOrThrow(): ChatInviteLinkUnlimited = + this as dev.inmo.tgbotapi.types.ChatInviteLinkUnlimited -public inline fun WithUser.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T): T? - = chatInviteLinkUnlimitedOrNull() ?.let(block) +public inline fun + OptionallyWithUser.ifChatInviteLinkUnlimited(block: (ChatInviteLinkUnlimited) -> T): T? = + chatInviteLinkUnlimitedOrNull() ?.let(block) -public inline fun WithUser.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this as? - dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult +public inline fun OptionallyWithUser.baseChosenInlineResultOrNull(): BaseChosenInlineResult? = this + as? dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult -public inline fun WithUser.baseChosenInlineResultOrThrow(): BaseChosenInlineResult = this as - dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult +public inline fun OptionallyWithUser.baseChosenInlineResultOrThrow(): BaseChosenInlineResult = this + as dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.BaseChosenInlineResult -public inline fun WithUser.ifBaseChosenInlineResult(block: (BaseChosenInlineResult) -> T): T? = +public inline fun + OptionallyWithUser.ifBaseChosenInlineResult(block: (BaseChosenInlineResult) -> T): T? = baseChosenInlineResultOrNull() ?.let(block) -public inline fun WithUser.chosenInlineResultOrNull(): ChosenInlineResult? = this as? +public inline fun OptionallyWithUser.chosenInlineResultOrNull(): ChosenInlineResult? = this as? dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult -public inline fun WithUser.chosenInlineResultOrThrow(): ChosenInlineResult = this as +public inline fun OptionallyWithUser.chosenInlineResultOrThrow(): ChosenInlineResult = this as dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult -public inline fun WithUser.ifChosenInlineResult(block: (ChosenInlineResult) -> T): T? = - chosenInlineResultOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifChosenInlineResult(block: (ChosenInlineResult) -> T): T? + = chosenInlineResultOrNull() ?.let(block) -public inline fun WithUser.locationChosenInlineResultOrNull(): LocationChosenInlineResult? = this - as? dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult +public inline fun OptionallyWithUser.locationChosenInlineResultOrNull(): LocationChosenInlineResult? + = this as? dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult -public inline fun WithUser.locationChosenInlineResultOrThrow(): LocationChosenInlineResult = this as - dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult +public inline fun OptionallyWithUser.locationChosenInlineResultOrThrow(): LocationChosenInlineResult + = this as dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.LocationChosenInlineResult public inline fun - WithUser.ifLocationChosenInlineResult(block: (LocationChosenInlineResult) -> T): T? = + OptionallyWithUser.ifLocationChosenInlineResult(block: (LocationChosenInlineResult) -> T): T? = locationChosenInlineResultOrNull() ?.let(block) -public inline fun WithUser.baseInlineQueryOrNull(): BaseInlineQuery? = this as? +public inline fun OptionallyWithUser.baseInlineQueryOrNull(): BaseInlineQuery? = this as? dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery -public inline fun WithUser.baseInlineQueryOrThrow(): BaseInlineQuery = this as +public inline fun OptionallyWithUser.baseInlineQueryOrThrow(): BaseInlineQuery = this as dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery -public inline fun WithUser.ifBaseInlineQuery(block: (BaseInlineQuery) -> T): T? = +public inline fun OptionallyWithUser.ifBaseInlineQuery(block: (BaseInlineQuery) -> T): T? = baseInlineQueryOrNull() ?.let(block) -public inline fun WithUser.inlineQueryOrNull(): InlineQuery? = this as? +public inline fun OptionallyWithUser.inlineQueryOrNull(): InlineQuery? = this as? dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery -public inline fun WithUser.inlineQueryOrThrow(): InlineQuery = this as +public inline fun OptionallyWithUser.inlineQueryOrThrow(): InlineQuery = this as dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery -public inline fun WithUser.ifInlineQuery(block: (InlineQuery) -> T): T? = inlineQueryOrNull() - ?.let(block) +public inline fun OptionallyWithUser.ifInlineQuery(block: (InlineQuery) -> T): T? = + inlineQueryOrNull() ?.let(block) -public inline fun WithUser.locationInlineQueryOrNull(): LocationInlineQuery? = this as? +public inline fun OptionallyWithUser.locationInlineQueryOrNull(): LocationInlineQuery? = this as? dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery -public inline fun WithUser.locationInlineQueryOrThrow(): LocationInlineQuery = this as +public inline fun OptionallyWithUser.locationInlineQueryOrThrow(): LocationInlineQuery = this as dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery -public inline fun WithUser.ifLocationInlineQuery(block: (LocationInlineQuery) -> T): T? = - locationInlineQueryOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifLocationInlineQuery(block: (LocationInlineQuery) -> T): + T? = locationInlineQueryOrNull() ?.let(block) -public inline fun WithUser.chatJoinRequestOrNull(): ChatJoinRequest? = this as? +public inline fun OptionallyWithUser.chatJoinRequestOrNull(): ChatJoinRequest? = this as? dev.inmo.tgbotapi.types.chat.ChatJoinRequest -public inline fun WithUser.chatJoinRequestOrThrow(): ChatJoinRequest = this as +public inline fun OptionallyWithUser.chatJoinRequestOrThrow(): ChatJoinRequest = this as dev.inmo.tgbotapi.types.chat.ChatJoinRequest -public inline fun WithUser.ifChatJoinRequest(block: (ChatJoinRequest) -> T): T? = +public inline fun OptionallyWithUser.ifChatJoinRequest(block: (ChatJoinRequest) -> T): T? = chatJoinRequestOrNull() ?.let(block) -public inline fun WithUser.administratorChatMemberOrNull(): AdministratorChatMember? = this as? - dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember +public inline fun OptionallyWithUser.administratorChatMemberOrNull(): AdministratorChatMember? = + this as? dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember -public inline fun WithUser.administratorChatMemberOrThrow(): AdministratorChatMember = this as - dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember +public inline fun OptionallyWithUser.administratorChatMemberOrThrow(): AdministratorChatMember = + this as dev.inmo.tgbotapi.types.chat.member.AdministratorChatMember -public inline fun WithUser.ifAdministratorChatMember(block: (AdministratorChatMember) -> T): T? - = administratorChatMemberOrNull() ?.let(block) +public inline fun + OptionallyWithUser.ifAdministratorChatMember(block: (AdministratorChatMember) -> T): T? = + administratorChatMemberOrNull() ?.let(block) -public inline fun WithUser.bannedChatMemberOrNull(): BannedChatMember? = this as? +public inline fun OptionallyWithUser.bannedChatMemberOrNull(): BannedChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.BannedChatMember -public inline fun WithUser.bannedChatMemberOrThrow(): BannedChatMember = this as +public inline fun OptionallyWithUser.bannedChatMemberOrThrow(): BannedChatMember = this as dev.inmo.tgbotapi.types.chat.member.BannedChatMember -public inline fun WithUser.ifBannedChatMember(block: (BannedChatMember) -> T): T? = +public inline fun OptionallyWithUser.ifBannedChatMember(block: (BannedChatMember) -> T): T? = bannedChatMemberOrNull() ?.let(block) -public inline fun WithUser.chatMemberOrNull(): ChatMember? = this as? +public inline fun OptionallyWithUser.chatMemberOrNull(): ChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.ChatMember -public inline fun WithUser.chatMemberOrThrow(): ChatMember = this as +public inline fun OptionallyWithUser.chatMemberOrThrow(): ChatMember = this as dev.inmo.tgbotapi.types.chat.member.ChatMember -public inline fun WithUser.ifChatMember(block: (ChatMember) -> T): T? = chatMemberOrNull() - ?.let(block) +public inline fun OptionallyWithUser.ifChatMember(block: (ChatMember) -> T): T? = + chatMemberOrNull() ?.let(block) -public inline fun WithUser.chatMemberUpdatedOrNull(): ChatMemberUpdated? = this as? +public inline fun OptionallyWithUser.chatMemberUpdatedOrNull(): ChatMemberUpdated? = this as? dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated -public inline fun WithUser.chatMemberUpdatedOrThrow(): ChatMemberUpdated = this as +public inline fun OptionallyWithUser.chatMemberUpdatedOrThrow(): ChatMemberUpdated = this as dev.inmo.tgbotapi.types.chat.member.ChatMemberUpdated -public inline fun WithUser.ifChatMemberUpdated(block: (ChatMemberUpdated) -> T): T? = +public inline fun OptionallyWithUser.ifChatMemberUpdated(block: (ChatMemberUpdated) -> T): T? = chatMemberUpdatedOrNull() ?.let(block) -public inline fun WithUser.kickedChatMemberOrNull(): KickedChatMember? = this as? +public inline fun OptionallyWithUser.kickedChatMemberOrNull(): KickedChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.KickedChatMember -public inline fun WithUser.kickedChatMemberOrThrow(): KickedChatMember = this as +public inline fun OptionallyWithUser.kickedChatMemberOrThrow(): KickedChatMember = this as dev.inmo.tgbotapi.types.chat.member.KickedChatMember -public inline fun WithUser.ifKickedChatMember(block: (KickedChatMember) -> T): T? = +public inline fun OptionallyWithUser.ifKickedChatMember(block: (KickedChatMember) -> T): T? = kickedChatMemberOrNull() ?.let(block) -public inline fun WithUser.leftChatMemberOrNull(): LeftChatMember? = this as? +public inline fun OptionallyWithUser.leftChatMemberOrNull(): LeftChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.LeftChatMember -public inline fun WithUser.leftChatMemberOrThrow(): LeftChatMember = this as +public inline fun OptionallyWithUser.leftChatMemberOrThrow(): LeftChatMember = this as dev.inmo.tgbotapi.types.chat.member.LeftChatMember -public inline fun WithUser.ifLeftChatMember(block: (LeftChatMember) -> T): T? = +public inline fun OptionallyWithUser.ifLeftChatMember(block: (LeftChatMember) -> T): T? = leftChatMemberOrNull() ?.let(block) -public inline fun WithUser.memberChatMemberOrNull(): MemberChatMember? = this as? +public inline fun OptionallyWithUser.memberChatMemberOrNull(): MemberChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.MemberChatMember -public inline fun WithUser.memberChatMemberOrThrow(): MemberChatMember = this as +public inline fun OptionallyWithUser.memberChatMemberOrThrow(): MemberChatMember = this as dev.inmo.tgbotapi.types.chat.member.MemberChatMember -public inline fun WithUser.ifMemberChatMember(block: (MemberChatMember) -> T): T? = +public inline fun OptionallyWithUser.ifMemberChatMember(block: (MemberChatMember) -> T): T? = memberChatMemberOrNull() ?.let(block) -public inline fun WithUser.ownerChatMemberOrNull(): OwnerChatMember? = this as? +public inline fun OptionallyWithUser.ownerChatMemberOrNull(): OwnerChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.OwnerChatMember -public inline fun WithUser.ownerChatMemberOrThrow(): OwnerChatMember = this as +public inline fun OptionallyWithUser.ownerChatMemberOrThrow(): OwnerChatMember = this as dev.inmo.tgbotapi.types.chat.member.OwnerChatMember -public inline fun WithUser.ifOwnerChatMember(block: (OwnerChatMember) -> T): T? = +public inline fun OptionallyWithUser.ifOwnerChatMember(block: (OwnerChatMember) -> T): T? = ownerChatMemberOrNull() ?.let(block) -public inline fun WithUser.restrictedChatMemberOrNull(): RestrictedChatMember? = this as? +public inline fun OptionallyWithUser.restrictedChatMemberOrNull(): RestrictedChatMember? = this as? dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember -public inline fun WithUser.restrictedChatMemberOrThrow(): RestrictedChatMember = this as +public inline fun OptionallyWithUser.restrictedChatMemberOrThrow(): RestrictedChatMember = this as dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember -public inline fun WithUser.ifRestrictedChatMember(block: (RestrictedChatMember) -> T): T? = - restrictedChatMemberOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifRestrictedChatMember(block: (RestrictedChatMember) -> T): + T? = restrictedChatMemberOrNull() ?.let(block) -public inline fun WithUser.specialRightsChatMemberOrNull(): SpecialRightsChatMember? = this as? - dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember +public inline fun OptionallyWithUser.specialRightsChatMemberOrNull(): SpecialRightsChatMember? = + this as? dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember -public inline fun WithUser.specialRightsChatMemberOrThrow(): SpecialRightsChatMember = this as - dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember +public inline fun OptionallyWithUser.specialRightsChatMemberOrThrow(): SpecialRightsChatMember = + this as dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember -public inline fun WithUser.ifSpecialRightsChatMember(block: (SpecialRightsChatMember) -> T): T? - = specialRightsChatMemberOrNull() ?.let(block) +public inline fun + OptionallyWithUser.ifSpecialRightsChatMember(block: (SpecialRightsChatMember) -> T): T? = + specialRightsChatMemberOrNull() ?.let(block) -public inline fun WithUser.leftChatMemberEventOrNull(): LeftChatMemberEvent? = this as? +public inline fun OptionallyWithUser.leftChatMemberEventOrNull(): LeftChatMemberEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent -public inline fun WithUser.leftChatMemberEventOrThrow(): LeftChatMemberEvent = this as +public inline fun OptionallyWithUser.leftChatMemberEventOrThrow(): LeftChatMemberEvent = this as dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent -public inline fun WithUser.ifLeftChatMemberEvent(block: (LeftChatMemberEvent) -> T): T? = - leftChatMemberEventOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifLeftChatMemberEvent(block: (LeftChatMemberEvent) -> T): + T? = leftChatMemberEventOrNull() ?.let(block) -public inline fun WithUser.commonGroupEventMessageOrNull(): CommonGroupEventMessage? = - this as? +public inline fun OptionallyWithUser.commonGroupEventMessageOrNull(): + CommonGroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.CommonGroupEventMessage -public inline fun WithUser.commonGroupEventMessageOrThrow(): CommonGroupEventMessage = - this as +public inline fun OptionallyWithUser.commonGroupEventMessageOrThrow(): + CommonGroupEventMessage = this as dev.inmo.tgbotapi.types.message.CommonGroupEventMessage public inline fun - WithUser.ifCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T): T? = - commonGroupEventMessageOrNull() ?.let(block) + OptionallyWithUser.ifCommonGroupEventMessage(block: (CommonGroupEventMessage) -> T): + T? = commonGroupEventMessageOrNull() ?.let(block) -public inline fun WithUser.commonSupergroupEventMessageOrNull(): +public inline fun OptionallyWithUser.commonSupergroupEventMessageOrNull(): CommonSupergroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage -public inline fun WithUser.commonSupergroupEventMessageOrThrow(): +public inline fun OptionallyWithUser.commonSupergroupEventMessageOrThrow(): CommonSupergroupEventMessage = this as dev.inmo.tgbotapi.types.message.CommonSupergroupEventMessage public inline fun - WithUser.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T): + OptionallyWithUser.ifCommonSupergroupEventMessage(block: (CommonSupergroupEventMessage) -> T): T? = commonSupergroupEventMessageOrNull() ?.let(block) -public inline fun WithUser.passportMessageOrNull(): PassportMessage? = this as? +public inline fun OptionallyWithUser.passportMessageOrNull(): PassportMessage? = this as? dev.inmo.tgbotapi.types.message.PassportMessage -public inline fun WithUser.passportMessageOrThrow(): PassportMessage = this as +public inline fun OptionallyWithUser.passportMessageOrThrow(): PassportMessage = this as dev.inmo.tgbotapi.types.message.PassportMessage -public inline fun WithUser.ifPassportMessage(block: (PassportMessage) -> T): T? = +public inline fun OptionallyWithUser.ifPassportMessage(block: (PassportMessage) -> T): T? = passportMessageOrNull() ?.let(block) -public inline fun WithUser.businessContentMessageOrNull(): BusinessContentMessage? = - this as? +public inline fun OptionallyWithUser.businessContentMessageOrNull(): + BusinessContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage -public inline fun WithUser.businessContentMessageOrThrow(): BusinessContentMessage = - this as +public inline fun OptionallyWithUser.businessContentMessageOrThrow(): + BusinessContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.BusinessContentMessage public inline fun - WithUser.ifBusinessContentMessage(block: (BusinessContentMessage) -> T): T? = - businessContentMessageOrNull() ?.let(block) + OptionallyWithUser.ifBusinessContentMessage(block: (BusinessContentMessage) -> T): + T? = businessContentMessageOrNull() ?.let(block) -public inline fun WithUser.fromUserMessageOrNull(): FromUserMessage? = this as? +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.optionallyFromUserMessageOrNull(): OptionallyFromUserMessage? = + this as? dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage + +public inline fun OptionallyWithUser.optionallyFromUserMessageOrThrow(): OptionallyFromUserMessage = + this as dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage + +public inline fun + OptionallyWithUser.ifOptionallyFromUserMessage(block: (OptionallyFromUserMessage) -> T): T? = + optionallyFromUserMessageOrNull() ?.let(block) + +public inline fun OptionallyWithUser.fromUserMessageOrNull(): FromUserMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage -public inline fun WithUser.fromUserMessageOrThrow(): FromUserMessage = this as +public inline fun OptionallyWithUser.fromUserMessageOrThrow(): FromUserMessage = this as dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage -public inline fun WithUser.ifFromUserMessage(block: (FromUserMessage) -> T): T? = +public inline fun OptionallyWithUser.ifFromUserMessage(block: (FromUserMessage) -> T): T? = fromUserMessageOrNull() ?.let(block) -public inline fun WithUser.groupEventMessageOrNull(): GroupEventMessage? = this as? +public inline fun OptionallyWithUser.groupEventMessageOrNull(): GroupEventMessage? = + this as? dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage -public inline fun WithUser.groupEventMessageOrThrow(): GroupEventMessage = this as +public inline fun OptionallyWithUser.groupEventMessageOrThrow(): GroupEventMessage = + this as dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage -public inline fun WithUser.ifGroupEventMessage(block: (GroupEventMessage) -> T): T? - = groupEventMessageOrNull() ?.let(block) +public inline fun + OptionallyWithUser.ifGroupEventMessage(block: (GroupEventMessage) -> T): T? = + groupEventMessageOrNull() ?.let(block) -public inline fun WithUser.commonGroupContentMessageOrNull(): +public inline fun OptionallyWithUser.commonGroupContentMessageOrNull(): CommonGroupContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage -public inline fun WithUser.commonGroupContentMessageOrThrow(): +public inline fun OptionallyWithUser.commonGroupContentMessageOrThrow(): CommonGroupContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.CommonGroupContentMessage public inline fun - WithUser.ifCommonGroupContentMessage(block: (CommonGroupContentMessage) -> T): + OptionallyWithUser.ifCommonGroupContentMessage(block: (CommonGroupContentMessage) -> T): T? = commonGroupContentMessageOrNull() ?.let(block) -public inline fun WithUser.commonForumContentMessageOrNull(): +public inline fun OptionallyWithUser.commonForumContentMessageOrNull(): CommonForumContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.CommonForumContentMessage -public inline fun WithUser.commonForumContentMessageOrThrow(): +public inline fun OptionallyWithUser.commonForumContentMessageOrThrow(): CommonForumContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.CommonForumContentMessage public inline fun - WithUser.ifCommonForumContentMessage(block: (CommonForumContentMessage) -> T): + OptionallyWithUser.ifCommonForumContentMessage(block: (CommonForumContentMessage) -> T): T? = commonForumContentMessageOrNull() ?.let(block) -public inline fun WithUser.privateContentMessageOrNull(): PrivateContentMessage? = - this as? +public inline fun OptionallyWithUser.privateContentMessageOrNull(): + PrivateContentMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage -public inline fun WithUser.privateContentMessageOrThrow(): PrivateContentMessage = - this as +public inline fun OptionallyWithUser.privateContentMessageOrThrow(): + PrivateContentMessage = this as dev.inmo.tgbotapi.types.message.abstracts.PrivateContentMessage public inline fun - WithUser.ifPrivateContentMessage(block: (PrivateContentMessage) -> T): T? = - privateContentMessageOrNull() ?.let(block) + OptionallyWithUser.ifPrivateContentMessage(block: (PrivateContentMessage) -> T): + T? = privateContentMessageOrNull() ?.let(block) -public inline fun WithUser.supergroupEventMessageOrNull(): SupergroupEventMessage? - = this as? +public inline fun OptionallyWithUser.supergroupEventMessageOrNull(): + SupergroupEventMessage? = this as? dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage -public inline fun WithUser.supergroupEventMessageOrThrow(): SupergroupEventMessage - = this as +public inline fun OptionallyWithUser.supergroupEventMessageOrThrow(): + SupergroupEventMessage = this as dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage public inline fun - WithUser.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T): T? = - supergroupEventMessageOrNull() ?.let(block) + OptionallyWithUser.ifSupergroupEventMessage(block: (SupergroupEventMessage) -> T): + T? = supergroupEventMessageOrNull() ?.let(block) -public inline fun WithUser.preCheckoutQueryOrNull(): PreCheckoutQuery? = this as? +public inline fun OptionallyWithUser.preCheckoutQueryOrNull(): PreCheckoutQuery? = this as? dev.inmo.tgbotapi.types.payments.PreCheckoutQuery -public inline fun WithUser.preCheckoutQueryOrThrow(): PreCheckoutQuery = this as +public inline fun OptionallyWithUser.preCheckoutQueryOrThrow(): PreCheckoutQuery = this as dev.inmo.tgbotapi.types.payments.PreCheckoutQuery -public inline fun WithUser.ifPreCheckoutQuery(block: (PreCheckoutQuery) -> T): T? = +public inline fun OptionallyWithUser.ifPreCheckoutQuery(block: (PreCheckoutQuery) -> T): T? = preCheckoutQueryOrNull() ?.let(block) -public inline fun WithUser.shippingQueryOrNull(): ShippingQuery? = this as? +public inline fun OptionallyWithUser.shippingQueryOrNull(): ShippingQuery? = this as? dev.inmo.tgbotapi.types.payments.ShippingQuery -public inline fun WithUser.shippingQueryOrThrow(): ShippingQuery = this as +public inline fun OptionallyWithUser.shippingQueryOrThrow(): ShippingQuery = this as dev.inmo.tgbotapi.types.payments.ShippingQuery -public inline fun WithUser.ifShippingQuery(block: (ShippingQuery) -> T): T? = +public inline fun OptionallyWithUser.ifShippingQuery(block: (ShippingQuery) -> T): T? = shippingQueryOrNull() ?.let(block) -public inline fun WithUser.pollAnswerOrNull(): PollAnswer? = this as? +public inline fun OptionallyWithUser.pollAnswerOrNull(): PollAnswer? = this as? dev.inmo.tgbotapi.types.polls.PollAnswer -public inline fun WithUser.pollAnswerOrThrow(): PollAnswer = this as +public inline fun OptionallyWithUser.pollAnswerOrThrow(): PollAnswer = this as dev.inmo.tgbotapi.types.polls.PollAnswer -public inline fun WithUser.ifPollAnswer(block: (PollAnswer) -> T): T? = pollAnswerOrNull() - ?.let(block) +public inline fun OptionallyWithUser.ifPollAnswer(block: (PollAnswer) -> T): T? = + pollAnswerOrNull() ?.let(block) -public inline fun WithUser.abstractMessageCallbackQueryOrNull(): AbstractMessageCallbackQuery? = - this as? dev.inmo.tgbotapi.types.queries.callback.AbstractMessageCallbackQuery +public inline fun OptionallyWithUser.abstractMessageCallbackQueryOrNull(): + AbstractMessageCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.AbstractMessageCallbackQuery -public inline fun WithUser.abstractMessageCallbackQueryOrThrow(): 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 - WithUser.ifAbstractMessageCallbackQuery(block: (AbstractMessageCallbackQuery) -> T): T? = - abstractMessageCallbackQueryOrNull() ?.let(block) + OptionallyWithUser.ifAbstractMessageCallbackQuery(block: (AbstractMessageCallbackQuery) -> T): + T? = abstractMessageCallbackQueryOrNull() ?.let(block) -public inline fun WithUser.callbackQueryOrNull(): CallbackQuery? = this as? +public inline fun OptionallyWithUser.callbackQueryOrNull(): CallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.CallbackQuery -public inline fun WithUser.callbackQueryOrThrow(): CallbackQuery = this as +public inline fun OptionallyWithUser.callbackQueryOrThrow(): CallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.CallbackQuery -public inline fun WithUser.ifCallbackQuery(block: (CallbackQuery) -> T): T? = +public inline fun OptionallyWithUser.ifCallbackQuery(block: (CallbackQuery) -> T): T? = callbackQueryOrNull() ?.let(block) -public inline fun WithUser.unknownCallbackQueryTypeOrNull(): UnknownCallbackQueryType? = this as? - dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType +public inline fun OptionallyWithUser.unknownCallbackQueryTypeOrNull(): UnknownCallbackQueryType? = + this as? dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType -public inline fun WithUser.unknownCallbackQueryTypeOrThrow(): UnknownCallbackQueryType = this as - dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType - -public inline fun WithUser.ifUnknownCallbackQueryType(block: (UnknownCallbackQueryType) -> T): - T? = unknownCallbackQueryTypeOrNull() ?.let(block) - -public inline fun WithUser.dataCallbackQueryOrNull(): DataCallbackQuery? = this as? - dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery - -public inline fun WithUser.dataCallbackQueryOrThrow(): DataCallbackQuery = this as - dev.inmo.tgbotapi.types.queries.callback.DataCallbackQuery - -public inline fun WithUser.ifDataCallbackQuery(block: (DataCallbackQuery) -> T): T? = - dataCallbackQueryOrNull() ?.let(block) - -public inline fun WithUser.gameShortNameCallbackQueryOrNull(): GameShortNameCallbackQuery? = this - as? dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery - -public inline fun WithUser.gameShortNameCallbackQueryOrThrow(): GameShortNameCallbackQuery = this as - dev.inmo.tgbotapi.types.queries.callback.GameShortNameCallbackQuery +public inline fun OptionallyWithUser.unknownCallbackQueryTypeOrThrow(): UnknownCallbackQueryType = + this as dev.inmo.tgbotapi.types.queries.callback.UnknownCallbackQueryType public inline fun - WithUser.ifGameShortNameCallbackQuery(block: (GameShortNameCallbackQuery) -> T): T? = + OptionallyWithUser.ifUnknownCallbackQueryType(block: (UnknownCallbackQueryType) -> T): T? = + unknownCallbackQueryTypeOrNull() ?.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.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 WithUser.inaccessibleMessageCallbackQueryOrNull(): +public inline fun OptionallyWithUser.inaccessibleMessageCallbackQueryOrNull(): InaccessibleMessageCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageCallbackQuery -public inline fun WithUser.inaccessibleMessageCallbackQueryOrThrow(): +public inline fun OptionallyWithUser.inaccessibleMessageCallbackQueryOrThrow(): InaccessibleMessageCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageCallbackQuery public inline fun - WithUser.ifInaccessibleMessageCallbackQuery(block: (InaccessibleMessageCallbackQuery) -> T): T? - = inaccessibleMessageCallbackQueryOrNull() ?.let(block) + OptionallyWithUser.ifInaccessibleMessageCallbackQuery(block: (InaccessibleMessageCallbackQuery) -> T): + T? = inaccessibleMessageCallbackQueryOrNull() ?.let(block) -public inline fun WithUser.inaccessibleMessageDataCallbackQueryOrNull(): +public inline fun OptionallyWithUser.inaccessibleMessageDataCallbackQueryOrNull(): InaccessibleMessageDataCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageDataCallbackQuery -public inline fun WithUser.inaccessibleMessageDataCallbackQueryOrThrow(): +public inline fun OptionallyWithUser.inaccessibleMessageDataCallbackQueryOrThrow(): InaccessibleMessageDataCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageDataCallbackQuery public inline fun - WithUser.ifInaccessibleMessageDataCallbackQuery(block: (InaccessibleMessageDataCallbackQuery) -> T): + OptionallyWithUser.ifInaccessibleMessageDataCallbackQuery(block: (InaccessibleMessageDataCallbackQuery) -> T): T? = inaccessibleMessageDataCallbackQueryOrNull() ?.let(block) -public inline fun WithUser.inaccessibleMessageGameShortNameCallbackQueryOrNull(): +public inline fun OptionallyWithUser.inaccessibleMessageGameShortNameCallbackQueryOrNull(): InaccessibleMessageGameShortNameCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageGameShortNameCallbackQuery -public inline fun WithUser.inaccessibleMessageGameShortNameCallbackQueryOrThrow(): +public inline fun OptionallyWithUser.inaccessibleMessageGameShortNameCallbackQueryOrThrow(): InaccessibleMessageGameShortNameCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InaccessibleMessageGameShortNameCallbackQuery public inline fun - WithUser.ifInaccessibleMessageGameShortNameCallbackQuery(block: (InaccessibleMessageGameShortNameCallbackQuery) -> T): + OptionallyWithUser.ifInaccessibleMessageGameShortNameCallbackQuery(block: (InaccessibleMessageGameShortNameCallbackQuery) -> T): T? = inaccessibleMessageGameShortNameCallbackQueryOrNull() ?.let(block) -public inline fun WithUser.inlineMessageIdCallbackQueryOrNull(): InlineMessageIdCallbackQuery? = - this as? dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery +public inline fun OptionallyWithUser.inlineMessageIdCallbackQueryOrNull(): + InlineMessageIdCallbackQuery? = this as? + dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery -public inline fun WithUser.inlineMessageIdCallbackQueryOrThrow(): InlineMessageIdCallbackQuery = - this as dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery +public inline fun OptionallyWithUser.inlineMessageIdCallbackQueryOrThrow(): + InlineMessageIdCallbackQuery = this as + dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdCallbackQuery public inline fun - WithUser.ifInlineMessageIdCallbackQuery(block: (InlineMessageIdCallbackQuery) -> T): T? = - inlineMessageIdCallbackQueryOrNull() ?.let(block) + OptionallyWithUser.ifInlineMessageIdCallbackQuery(block: (InlineMessageIdCallbackQuery) -> T): + T? = inlineMessageIdCallbackQueryOrNull() ?.let(block) -public inline fun WithUser.inlineMessageIdDataCallbackQueryOrNull(): +public inline fun OptionallyWithUser.inlineMessageIdDataCallbackQueryOrNull(): InlineMessageIdDataCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery -public inline fun WithUser.inlineMessageIdDataCallbackQueryOrThrow(): +public inline fun OptionallyWithUser.inlineMessageIdDataCallbackQueryOrThrow(): InlineMessageIdDataCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdDataCallbackQuery public inline fun - WithUser.ifInlineMessageIdDataCallbackQuery(block: (InlineMessageIdDataCallbackQuery) -> T): T? - = inlineMessageIdDataCallbackQueryOrNull() ?.let(block) + OptionallyWithUser.ifInlineMessageIdDataCallbackQuery(block: (InlineMessageIdDataCallbackQuery) -> T): + T? = inlineMessageIdDataCallbackQueryOrNull() ?.let(block) -public inline fun WithUser.inlineMessageIdGameShortNameCallbackQueryOrNull(): +public inline fun OptionallyWithUser.inlineMessageIdGameShortNameCallbackQueryOrNull(): InlineMessageIdGameShortNameCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery -public inline fun WithUser.inlineMessageIdGameShortNameCallbackQueryOrThrow(): +public inline fun OptionallyWithUser.inlineMessageIdGameShortNameCallbackQueryOrThrow(): InlineMessageIdGameShortNameCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.InlineMessageIdGameShortNameCallbackQuery public inline fun - WithUser.ifInlineMessageIdGameShortNameCallbackQuery(block: (InlineMessageIdGameShortNameCallbackQuery) -> T): + OptionallyWithUser.ifInlineMessageIdGameShortNameCallbackQuery(block: (InlineMessageIdGameShortNameCallbackQuery) -> T): T? = inlineMessageIdGameShortNameCallbackQueryOrNull() ?.let(block) -public inline fun WithUser.messageCallbackQueryOrNull(): MessageCallbackQuery? = this as? +public inline fun OptionallyWithUser.messageCallbackQueryOrNull(): MessageCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery -public inline fun WithUser.messageCallbackQueryOrThrow(): MessageCallbackQuery = this as +public inline fun OptionallyWithUser.messageCallbackQueryOrThrow(): MessageCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.MessageCallbackQuery -public inline fun WithUser.ifMessageCallbackQuery(block: (MessageCallbackQuery) -> T): T? = - messageCallbackQueryOrNull() ?.let(block) +public inline fun OptionallyWithUser.ifMessageCallbackQuery(block: (MessageCallbackQuery) -> T): + T? = messageCallbackQueryOrNull() ?.let(block) -public inline fun WithUser.messageDataCallbackQueryOrNull(): MessageDataCallbackQuery? = this as? - dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery +public inline fun OptionallyWithUser.messageDataCallbackQueryOrNull(): MessageDataCallbackQuery? = + this as? dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery -public inline fun WithUser.messageDataCallbackQueryOrThrow(): MessageDataCallbackQuery = this as - dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery +public inline fun OptionallyWithUser.messageDataCallbackQueryOrThrow(): MessageDataCallbackQuery = + this as dev.inmo.tgbotapi.types.queries.callback.MessageDataCallbackQuery -public inline fun WithUser.ifMessageDataCallbackQuery(block: (MessageDataCallbackQuery) -> T): - T? = messageDataCallbackQueryOrNull() ?.let(block) +public inline fun + OptionallyWithUser.ifMessageDataCallbackQuery(block: (MessageDataCallbackQuery) -> T): T? = + messageDataCallbackQueryOrNull() ?.let(block) -public inline fun WithUser.messageGameShortNameCallbackQueryOrNull(): +public inline fun OptionallyWithUser.messageGameShortNameCallbackQueryOrNull(): MessageGameShortNameCallbackQuery? = this as? dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery -public inline fun WithUser.messageGameShortNameCallbackQueryOrThrow(): +public inline fun OptionallyWithUser.messageGameShortNameCallbackQueryOrThrow(): MessageGameShortNameCallbackQuery = this as dev.inmo.tgbotapi.types.queries.callback.MessageGameShortNameCallbackQuery public inline fun - WithUser.ifMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T): + OptionallyWithUser.ifMessageGameShortNameCallbackQuery(block: (MessageGameShortNameCallbackQuery) -> T): T? = messageGameShortNameCallbackQueryOrNull() ?.let(block) public inline fun InlineQueryResultsButton.startOrNull(): InlineQueryResultsButton.Start? = this as? @@ -3701,6 +3758,15 @@ public inline fun Message.contentMessageOrThrow(): ContentMessage Message.ifContentMessage(block: (ContentMessage) -> T): T? = contentMessageOrNull() ?.let(block) +public inline fun Message.optionallyFromUserMessageOrNull(): OptionallyFromUserMessage? = this as? + dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage + +public inline fun Message.optionallyFromUserMessageOrThrow(): OptionallyFromUserMessage = this as + dev.inmo.tgbotapi.types.message.abstracts.OptionallyFromUserMessage + +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 diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAny.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAny.kt index c782f769ca..1092af4617 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAny.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAny.kt @@ -3,10 +3,21 @@ package dev.inmo.tgbotapi.extensions.utils import dev.inmo.tgbotapi.abstracts.FromUser +import dev.inmo.tgbotapi.abstracts.OptionallyFromUser +import dev.inmo.tgbotapi.abstracts.OptionallyWithUser import dev.inmo.tgbotapi.abstracts.WithUser import dev.inmo.tgbotapi.types.abstracts.WithOptionalLanguageCode import dev.inmo.tgbotapi.utils.PreviewFeature +@PreviewFeature +inline fun Any.ifOptionallyFromUser(block: (OptionallyFromUser) -> T) = optionallyFromUserOrNull()?.let(block) + +@PreviewFeature +inline fun Any.optionallyFromUserOrNull(): OptionallyFromUser? = this as? OptionallyFromUser + +@PreviewFeature +inline fun Any.optionallyFromUserOrThrow(): OptionallyFromUser = this as OptionallyFromUser + @PreviewFeature inline fun Any.ifFromUser(block: (FromUser) -> T) = fromUserOrNull()?.let(block) @@ -16,6 +27,15 @@ inline fun Any.fromUserOrNull(): FromUser? = this as? FromUser @PreviewFeature inline fun Any.fromUserOrThrow(): FromUser = this as FromUser +@PreviewFeature +inline fun Any.ifOptionallyWithUser(block: (OptionallyWithUser) -> T) = optionallyWithUserOrNull()?.let(block) + +@PreviewFeature +inline fun Any.optionallyWithUserOrNull(): OptionallyWithUser? = this as? OptionallyWithUser + +@PreviewFeature +inline fun Any.optionallyWithUserOrThrow(): OptionallyWithUser = this as OptionallyWithUser + @PreviewFeature inline fun Any.ifWithUser(block: (WithUser) -> T) = withUserOrNull()?.let(block) diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt index eff8b72812..5aaf7383a5 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt @@ -23,7 +23,7 @@ import dev.inmo.tgbotapi.utils.RiskFeature @RiskFeature(RawFieldsUsageWarning) inline val Message.from: User? - get() = asFromUser() ?.from + get() = optionallyFromUserMessageOrNull() ?.from @RiskFeature(RawFieldsUsageWarning) inline val Message.sender_chat: PublicChat? get() = asFromChannelGroupContentMessage() ?.senderChat From dfecf93dd5161b62bb5297dac197f15f23f60c9a Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 14 Aug 2024 19:51:02 +0600 Subject: [PATCH 04/19] add support of paid media in TransactionPartner.User --- .../types/payments/stars/TransactionPartner.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt index ad5191546d..4aa9e0a775 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt @@ -2,11 +2,9 @@ package dev.inmo.tgbotapi.types.payments.stars -import dev.inmo.tgbotapi.types.InvoicePayload +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.chat.PreviewUser -import dev.inmo.tgbotapi.types.invoicePayloadField -import dev.inmo.tgbotapi.types.userField -import dev.inmo.tgbotapi.types.withdrawalStateField +import dev.inmo.tgbotapi.types.message.payments.PaidMedia import dev.inmo.tgbotapi.utils.decodeDataAndJson import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded import kotlinx.serialization.EncodeDefault @@ -43,7 +41,9 @@ sealed interface TransactionPartner { @SerialName(userField) val user: PreviewUser, @SerialName(invoicePayloadField) - val invoicePayload: InvoicePayload? = null + val invoicePayload: InvoicePayload? = null, + @SerialName(paidMediaField) + val paidMedia: List? = null ) : TransactionPartner { @EncodeDefault override val type: String = Companion.type From 228ecba6ccd2c898f8a1bc2cd3822242f3b5d232 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 14 Aug 2024 20:05:17 +0600 Subject: [PATCH 05/19] start implementation of paid invitation links --- .../chat/invite_links/CreateChatInviteLink.kt | 41 +++++++++++++++++++ .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 2 + 2 files changed, 43 insertions(+) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink.kt index 18a375ba8b..78084d2ea7 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink.kt @@ -4,6 +4,8 @@ import korlibs.time.DateTime import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.requests.chat.abstracts.* import dev.inmo.tgbotapi.types.* +import korlibs.time.TimeSpan +import korlibs.time.days import kotlinx.serialization.* sealed interface CreateChatInviteLink : EditChatInviteLinkRequest { @@ -12,6 +14,11 @@ sealed interface CreateChatInviteLink : EditChatInv get() = expirationUnixTimeStamp ?.asDate override fun method(): String = "createChatInviteLink" + sealed interface Subscription : CreateChatInviteLink { + val subscriptionPeriod: TimeSpan + val subscriptionPrice: UInt + } + companion object { fun unlimited( chatId: ChatIdentifier, @@ -45,6 +52,13 @@ sealed interface CreateChatInviteLink : EditChatInv expiration: DateTime, name: String? = null, ) = withJoinRequest(chatId, name, expiration.toTelegramDate()) + fun paid( + chatId: ChatIdentifier, + subscriptionPrice: UInt, + subscriptionPeriod: TimeSpan = 30.days, + name: String? = null, + expirationUnixTimeStamp: TelegramDate? = null, + ) = CreateChatSubscriptionInviteLink(chatId, subscriptionPrice, name, subscriptionPeriod, expirationUnixTimeStamp) } } @@ -71,6 +85,33 @@ data class CreateChatInviteLinkUnlimited( get() = ChatInviteLinkUnlimited.serializer() } +/** + * Represent [https://core.telegram.org/bots/api#createchatsubscriptioninvitelink] request + * + * @see CreateChatInviteLink.unlimited + * @see CreateChatInviteLinkWithLimitedMembers + * @see CreateChatInviteLinkWithJoinRequest + */ +@Serializable +data class CreateChatSubscriptionInviteLink( + @SerialName(chatIdField) + override val chatId: ChatIdentifier, + @SerialName(subscriptionPriceField) + override val subscriptionPrice: UInt, + @SerialName(nameField) + override val name: String? = null, + @SerialName(subscriptionPeriodField) + @EncodeDefault + override val subscriptionPeriod: TimeSpan = 30.days, + @SerialName(expireDateField) + override val expirationUnixTimeStamp: TelegramDate? = null, +) : CreateChatInviteLink.Subscription { + override val requestSerializer: SerializationStrategy<*> + get() = serializer() + override val resultDeserializer: DeserializationStrategy + get() = ChatInviteLinkUnlimited.serializer() +} + /** * Represent [https://core.telegram.org/bots/api#createchatinvitelink] request WITH `member_limit` * and WITHOUT `creates_join_request` 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 d8de107a3c..dfe941eb30 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 @@ -457,6 +457,8 @@ const val permissionsField = "permissions" const val typeField = "type" const val valueField = "value" const val creatorField = "creator" +const val subscriptionPeriodField = "subscription_period" +const val subscriptionPriceField = "subscription_price" const val pointField = "point" const val xShiftField = "x_shift" From 9c43fecf4188b7f470c78e99efd6c0ec973a3d84 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 14 Aug 2024 22:06:57 +0600 Subject: [PATCH 06/19] add support of createChatSubscriptionInviteLink and editChatSubscriptionInviteLink --- .../chat/invite_links/CreateChatInviteLink.kt | 37 +++++++++++++++++++ .../chat/invite_links/EditChatInviteLink.kt | 27 ++++++++++++++ .../chat/invite_links/CreateChatInviteLink.kt | 16 +++++--- .../chat/invite_links/EditChatInviteLink.kt | 31 ++++++++++++++++ .../utils/TimeSpanAsSecondsSerializer.kt | 22 +++++++++++ 5 files changed, 127 insertions(+), 6 deletions(-) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/TimeSpanAsSecondsSerializer.kt diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChatInviteLink.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChatInviteLink.kt index 9cd4c510cd..b24ae9b25d 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChatInviteLink.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChatInviteLink.kt @@ -5,6 +5,8 @@ import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.chat.invite_links.CreateChatInviteLink import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.chat.PublicChat +import korlibs.time.TimeSpan +import korlibs.time.days public suspend fun TelegramBot.createChatInviteLinkUnlimited( chatId: ChatIdentifier, @@ -81,3 +83,38 @@ public suspend fun TelegramBot.createChatInviteLinkWithJoinRequest( expiration: DateTime, name: String? = null, ): ChatInviteLinkWithJoinRequest = createChatInviteLinkWithJoinRequest(chat.id, name, expiration.toTelegramDate()) + + +// Subscriptions + +public suspend fun TelegramBot.createChatSubscriptionInviteLink( + chatId: ChatIdentifier, + subscriptionPrice: UInt, + subscriptionPeriod: TimeSpan = 30.days, + name: String? = null, + expirationUnixTimeStamp: TelegramDate? = null, +): ChatInviteLinkUnlimited = execute(CreateChatInviteLink.subscription(chatId, subscriptionPrice, subscriptionPeriod, name, expirationUnixTimeStamp)) + +public suspend fun TelegramBot.createChatSubscriptionInviteLink( + chat: PublicChat, + subscriptionPrice: UInt, + subscriptionPeriod: TimeSpan = 30.days, + name: String? = null, + expirationUnixTimeStamp: TelegramDate? = null, +): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chat.id, subscriptionPrice, subscriptionPeriod, name, expirationUnixTimeStamp) + +public suspend fun TelegramBot.createChatSubscriptionInviteLink( + chatId: ChatIdentifier, + subscriptionPrice: UInt, + subscriptionPeriod: TimeSpan = 30.days, + name: String? = null, + expirationUnixTimeStamp: DateTime, +): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chatId, subscriptionPrice, subscriptionPeriod, name, expirationUnixTimeStamp.toTelegramDate()) + +public suspend fun TelegramBot.createChatSubscriptionInviteLink( + chat: PublicChat, + subscriptionPrice: UInt, + subscriptionPeriod: TimeSpan = 30.days, + name: String? = null, + expirationUnixTimeStamp: DateTime, +): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chat.id, subscriptionPrice, subscriptionPeriod, name, expirationUnixTimeStamp) \ No newline at end of file diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/EditChatInviteLink.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/EditChatInviteLink.kt index f4f9585d76..034b3642ae 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/EditChatInviteLink.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/EditChatInviteLink.kt @@ -181,3 +181,30 @@ public suspend fun TelegramBot.editChatInviteLinkWithJoinRequest( expiration: DateTime, name: String? = null, ): ChatInviteLinkWithJoinRequest = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate()) + + +// Subscriptions + +public suspend fun TelegramBot.editChatSubscriptionInviteLink( + chatId: ChatIdentifier, + previousLink: String, + name: String, +): ChatInviteLinkUnlimited = execute(EditChatInviteLink.subscription(chatId, previousLink, name)) + +public suspend fun TelegramBot.editChatSubscriptionInviteLink( + chatId: ChatIdentifier, + previousLink: ChatInviteLink, + name: String, +): ChatInviteLinkUnlimited = editChatSubscriptionInviteLink(chatId, previousLink.inviteLink, name) + +public suspend fun TelegramBot.editChatSubscriptionInviteLink( + chat: PublicChat, + previousLink: String, + name: String, +): ChatInviteLinkUnlimited = editChatSubscriptionInviteLink(chat.id, previousLink, name) + +public suspend fun TelegramBot.editChatSubscriptionInviteLink( + chat: PublicChat, + previousLink: ChatInviteLink, + name: String, +): ChatInviteLinkUnlimited = editChatSubscriptionInviteLink(chat.id, previousLink, name) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink.kt index 78084d2ea7..84619cb79a 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink.kt @@ -1,9 +1,9 @@ package dev.inmo.tgbotapi.requests.chat.invite_links import korlibs.time.DateTime -import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest import dev.inmo.tgbotapi.requests.chat.abstracts.* import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.utils.TimeSpanAsSecondsSerializer import korlibs.time.TimeSpan import korlibs.time.days import kotlinx.serialization.* @@ -12,11 +12,14 @@ sealed interface CreateChatInviteLink : EditChatInv val expirationUnixTimeStamp: TelegramDate? override val expireDate: DateTime? get() = expirationUnixTimeStamp ?.asDate + override fun method(): String = "createChatInviteLink" sealed interface Subscription : CreateChatInviteLink { val subscriptionPeriod: TimeSpan val subscriptionPrice: UInt + + override fun method(): String = "createChatSubscriptionInviteLink" } companion object { @@ -52,7 +55,7 @@ sealed interface CreateChatInviteLink : EditChatInv expiration: DateTime, name: String? = null, ) = withJoinRequest(chatId, name, expiration.toTelegramDate()) - fun paid( + fun subscription( chatId: ChatIdentifier, subscriptionPrice: UInt, subscriptionPeriod: TimeSpan = 30.days, @@ -63,7 +66,7 @@ sealed interface CreateChatInviteLink : EditChatInv } /** - * Represent [https://core.telegram.org/bots/api#createchatinvitelink] request WITHOUT `member_limit` + * Represent [request](https://core.telegram.org/bots/api#createchatinvitelink) WITHOUT `member_limit` * and `creates_join_request` * * @see CreateChatInviteLink.unlimited @@ -86,7 +89,7 @@ data class CreateChatInviteLinkUnlimited( } /** - * Represent [https://core.telegram.org/bots/api#createchatsubscriptioninvitelink] request + * Represent [request](https://core.telegram.org/bots/api#createchatsubscriptioninvitelink) * * @see CreateChatInviteLink.unlimited * @see CreateChatInviteLinkWithLimitedMembers @@ -102,6 +105,7 @@ data class CreateChatSubscriptionInviteLink( override val name: String? = null, @SerialName(subscriptionPeriodField) @EncodeDefault + @Serializable(TimeSpanAsSecondsSerializer::class) override val subscriptionPeriod: TimeSpan = 30.days, @SerialName(expireDateField) override val expirationUnixTimeStamp: TelegramDate? = null, @@ -113,7 +117,7 @@ data class CreateChatSubscriptionInviteLink( } /** - * Represent [https://core.telegram.org/bots/api#createchatinvitelink] request WITH `member_limit` + * Represent [request](https://core.telegram.org/bots/api#createchatinvitelink) WITH `member_limit` * and WITHOUT `creates_join_request` * * @see CreateChatInviteLink.withLimitedMembers @@ -136,7 +140,7 @@ data class CreateChatInviteLinkWithLimitedMembers( } /** - * Represent [https://core.telegram.org/bots/api#createchatinvitelink] request WITHOUT `member_limit` + * Represent [request](https://core.telegram.org/bots/api#createchatinvitelink) WITHOUT `member_limit` * and WITH `creates_join_request` * * @see CreateChatInviteLink.withJoinRequest diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink.kt index 7ef53689d7..48b95960b2 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink.kt @@ -12,6 +12,10 @@ sealed interface EditChatInviteLink : EditChatInvit get() = expirationUnixTimeStamp ?.asDate override fun method(): String = "editChatInviteLink" + sealed interface Subscription : EditChatInviteLink { + override fun method(): String = "editChatSubscriptionInviteLink" + } + companion object { fun unlimited( chatId: ChatIdentifier, @@ -51,6 +55,11 @@ sealed interface EditChatInviteLink : EditChatInvit expiration: DateTime, name: String? = null, ) = withJoinRequest(chatId, inviteLink, name, expiration.toTelegramDate()) + fun subscription( + chatId: ChatIdentifier, + inviteLink: String, + name: String, + ) = EditChatSubscriptionInviteLink(chatId, inviteLink, name) } } @@ -79,6 +88,28 @@ data class EditChatInviteLinkUnlimited( get() = ChatInviteLinkUnlimited.serializer() } +/** + * Represent [request](https://core.telegram.org/bots/api#editchatsubscriptioninvitelink) + * + * @see EditChatInviteLink.subscription + */ +@Serializable +data class EditChatSubscriptionInviteLink( + @SerialName(chatIdField) + override val chatId: ChatIdentifier, + @SerialName(inviteLinkField) + override val inviteLink: String, + @SerialName(nameField) + override val name: String? = null, +) : EditChatInviteLink.Subscription { + override val expirationUnixTimeStamp: TelegramDate? + get() = null + override val requestSerializer: SerializationStrategy<*> + get() = serializer() + override val resultDeserializer: DeserializationStrategy + get() = ChatInviteLinkUnlimited.serializer() +} + /** * Represent [https://core.telegram.org/bots/api#editchatinvitelink] request WITH `member_limit` * and WITHOUT `creates_join_request` diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/TimeSpanAsSecondsSerializer.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/TimeSpanAsSecondsSerializer.kt new file mode 100644 index 0000000000..166a5114b0 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/TimeSpanAsSecondsSerializer.kt @@ -0,0 +1,22 @@ +package dev.inmo.tgbotapi.utils + +import korlibs.time.TimeSpan +import korlibs.time.seconds +import kotlinx.serialization.KSerializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder + +object TimeSpanAsSecondsSerializer : KSerializer { + override val descriptor: SerialDescriptor + get() = Long.serializer().descriptor + + override fun deserialize(decoder: Decoder): TimeSpan { + return decoder.decodeLong().seconds + } + + override fun serialize(encoder: Encoder, value: TimeSpan) { + encoder.encodeLong(value.inWholeSeconds) + } +} \ No newline at end of file From 49f7954db7f25ae127c8375db89658147d45ab12 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 14 Aug 2024 22:16:14 +0600 Subject: [PATCH 07/19] add support of until in MemberChatMember --- .../inmo/tgbotapi/types/chat/member/MemberChatMember.kt | 7 ++++++- .../tgbotapi/types/chat/member/MemberChatMemberImpl.kt | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMember.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMember.kt index e11554acb7..e852e21dcd 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMember.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMember.kt @@ -1,6 +1,11 @@ package dev.inmo.tgbotapi.types.chat.member +import dev.inmo.tgbotapi.abstracts.types.UntilDate +import korlibs.time.DateTime import kotlinx.serialization.Serializable @Serializable(ChatMemberSerializer::class) -sealed interface MemberChatMember : ChatMember +sealed interface MemberChatMember : ChatMember, UntilDate { + val until: DateTime? + get() = untilDate ?.asDate +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMemberImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMemberImpl.kt index 43f9ad4b54..3e2d10dd26 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMemberImpl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMemberImpl.kt @@ -2,12 +2,16 @@ package dev.inmo.tgbotapi.types.chat.member import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.chat.User +import korlibs.time.DateTime import kotlinx.serialization.* @Serializable data class MemberChatMemberImpl( @SerialName(userField) - override val user: User + override val user: User, + @SerialName(untilDateField) + @Serializable(TelegramDateSerializer::class) + override val untilDate: TelegramDate? = null ) : MemberChatMember { @SerialName(statusField) @Required From e9a172565eedfe83b39bf839602d34dfd3387e52 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 14 Aug 2024 22:33:11 +0600 Subject: [PATCH 08/19] improve new chat member difference --- .../tgbotapi/types/chat/member/ChatMember.kt | 11 +++++++--- .../types/chat/member/MemberChatMember.kt | 7 +------ .../types/chat/member/MemberChatMemberImpl.kt | 5 +---- .../member/SubscriptionMemberChatMember.kt | 13 ++++++++++++ .../SubscriptionMemberChatMemberImpl.kt | 20 +++++++++++++++++++ .../extensions/utils/ClassCastsNew.kt | 13 ++++++++++++ 6 files changed, 56 insertions(+), 13 deletions(-) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMember.kt create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMemberImpl.kt diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/ChatMember.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/ChatMember.kt index b2598b7d67..e2c67a3eba 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/ChatMember.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/ChatMember.kt @@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.types.chat.member import dev.inmo.tgbotapi.abstracts.WithUser import dev.inmo.tgbotapi.types.statusField +import dev.inmo.tgbotapi.types.untilDateField import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.nonstrictJsonFormat import kotlinx.serialization.DeserializationStrategy @@ -11,6 +12,7 @@ import kotlinx.serialization.builtins.serializer import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.json.JsonElement import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.jsonPrimitive @@ -19,11 +21,13 @@ sealed interface ChatMember : WithUser { @Serializable(StatusSerializer::class) enum class Status( val status: String, - val deserializationStrategy: DeserializationStrategy + val deserializationStrategy: DeserializationStrategy, + val checker: (String, JsonObject) -> Boolean = { outerStatus, _ -> outerStatus == status }, ) { Creator("creator", OwnerChatMember.serializer()), Administrator("administrator", AdministratorChatMemberImpl.serializer()), - Member("member", MemberChatMemberImpl.serializer()), + Member("member", MemberChatMemberImpl.serializer(), { status, json -> status == "member" && json[untilDateField] ?.jsonPrimitive == null }), + SubscriptionMember("member", SubscriptionMemberChatMemberImpl.serializer(), { status, json -> status == "member" && json[untilDateField] ?.jsonPrimitive != null }), Restricted("restricted", RestrictedChatMember.serializer()), Left("left", LeftChatMemberImpl.serializer()), Kicked("kicked", KickedChatMember.serializer()) @@ -56,7 +60,7 @@ object ChatMemberSerializer : KSerializer { val json = JsonObject.serializer().deserialize(decoder) val status = json[statusField] ?.jsonPrimitive ?.content ?: error("Status field of chat member must be specified, but incoming json contains next: $json") return ChatMember.Status.values().firstNotNullOfOrNull { - if (it.status == status) { + if (it.checker(status, json)) { nonstrictJsonFormat.decodeFromJsonElement(it.deserializationStrategy, json) } else { null @@ -68,6 +72,7 @@ object ChatMemberSerializer : KSerializer { when (value) { is OwnerChatMember -> OwnerChatMember.serializer().serialize(encoder, value) is AdministratorChatMemberImpl -> AdministratorChatMemberImpl.serializer().serialize(encoder, value) + is SubscriptionMemberChatMemberImpl -> SubscriptionMemberChatMemberImpl.serializer().serialize(encoder, value) is MemberChatMemberImpl -> MemberChatMemberImpl.serializer().serialize(encoder, value) is RestrictedChatMember -> RestrictedChatMember.serializer().serialize(encoder, value) is LeftChatMemberImpl -> LeftChatMemberImpl.serializer().serialize(encoder, value) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMember.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMember.kt index e852e21dcd..e11554acb7 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMember.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMember.kt @@ -1,11 +1,6 @@ package dev.inmo.tgbotapi.types.chat.member -import dev.inmo.tgbotapi.abstracts.types.UntilDate -import korlibs.time.DateTime import kotlinx.serialization.Serializable @Serializable(ChatMemberSerializer::class) -sealed interface MemberChatMember : ChatMember, UntilDate { - val until: DateTime? - get() = untilDate ?.asDate -} +sealed interface MemberChatMember : ChatMember diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMemberImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMemberImpl.kt index 3e2d10dd26..19030de711 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMemberImpl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/MemberChatMemberImpl.kt @@ -8,10 +8,7 @@ import kotlinx.serialization.* @Serializable data class MemberChatMemberImpl( @SerialName(userField) - override val user: User, - @SerialName(untilDateField) - @Serializable(TelegramDateSerializer::class) - override val untilDate: TelegramDate? = null + override val user: User ) : MemberChatMember { @SerialName(statusField) @Required diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMember.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMember.kt new file mode 100644 index 0000000000..d70d51a502 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMember.kt @@ -0,0 +1,13 @@ +package dev.inmo.tgbotapi.types.chat.member + +import dev.inmo.tgbotapi.abstracts.types.UntilDate +import dev.inmo.tgbotapi.types.TelegramDate +import korlibs.time.DateTime +import kotlinx.serialization.Serializable + +@Serializable(ChatMemberSerializer::class) +sealed interface SubscriptionMemberChatMember : MemberChatMember, UntilDate { + override val untilDate: TelegramDate + val until: DateTime + get() = untilDate.asDate +} diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMemberImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMemberImpl.kt new file mode 100644 index 0000000000..e36f884394 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMemberImpl.kt @@ -0,0 +1,20 @@ +package dev.inmo.tgbotapi.types.chat.member + +import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.chat.User +import korlibs.time.DateTime +import kotlinx.serialization.* + +@Serializable +data class SubscriptionMemberChatMemberImpl( + @SerialName(userField) + override val user: User, + @SerialName(untilDateField) + @Serializable(TelegramDateSerializer::class) + override val untilDate: TelegramDate +) : SubscriptionMemberChatMember { + @SerialName(statusField) + @Required + @EncodeDefault + override val status: ChatMember.Status = ChatMember.Status.SubscriptionMember +} 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 3386b01d4a..3525e7e1a1 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 @@ -170,6 +170,7 @@ import dev.inmo.tgbotapi.types.chat.member.MemberChatMember import dev.inmo.tgbotapi.types.chat.member.OwnerChatMember import dev.inmo.tgbotapi.types.chat.member.RestrictedChatMember import dev.inmo.tgbotapi.types.chat.member.SpecialRightsChatMember +import dev.inmo.tgbotapi.types.chat.member.SubscriptionMemberChatMember import dev.inmo.tgbotapi.types.dice.BasketballDiceAnimationType import dev.inmo.tgbotapi.types.dice.BowlingDiceAnimationType import dev.inmo.tgbotapi.types.dice.CubeDiceAnimationType @@ -772,6 +773,18 @@ public inline fun OptionallyWithUser.ifSpecialRightsChatMember(block: (SpecialRightsChatMember) -> T): T? = specialRightsChatMemberOrNull() ?.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.leftChatMemberEventOrNull(): LeftChatMemberEvent? = this as? dev.inmo.tgbotapi.types.message.ChatEvents.LeftChatMemberEvent From 76eae0a54f26c02e48af469d46ff08d6d0b1953e Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 14 Aug 2024 22:37:19 +0600 Subject: [PATCH 09/19] add support of paid emoji --- .../dev/inmo/tgbotapi/types/reactions/Reaction.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/reactions/Reaction.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/reactions/Reaction.kt index a325317115..3ceb370dd5 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/reactions/Reaction.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/reactions/Reaction.kt @@ -43,6 +43,15 @@ sealed interface Reaction { } } + @Serializable(Reaction.Companion::class) + class Paid : Reaction { + override val type: String + get() = Companion.type + companion object { + const val type: String = "paid" + } + } + @Serializable(Reaction.Companion::class) data class Unknown( override val type: String, @@ -73,6 +82,7 @@ sealed interface Reaction { return when { surrogate.emoji != null -> Emoji(surrogate.emoji) surrogate.customEmojiId != null -> CustomEmoji(surrogate.customEmojiId) + surrogate.type == Paid.type -> Paid() else -> Unknown(surrogate.type, json) } } From b7ff6a3061c0a71d1fd4208345601fab982ddef5 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 14 Aug 2024 22:53:38 +0600 Subject: [PATCH 10/19] complete support of sender chat --- .../tgbotapi/types/message/ChannelContentMessageImpl.kt | 7 ++++--- .../kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt | 4 ++-- .../types/message/abstracts/ChannelContentMessage.kt | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelContentMessageImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelContentMessageImpl.kt index 50bea7370e..9e845ebf7d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelContentMessageImpl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelContentMessageImpl.kt @@ -5,14 +5,15 @@ import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup import dev.inmo.tgbotapi.types.chat.CommonBot import dev.inmo.tgbotapi.types.chat.PreviewChannelChat +import dev.inmo.tgbotapi.types.chat.PreviewChat import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.message.abstracts.* import dev.inmo.tgbotapi.types.message.content.MessageContent data class ChannelContentMessageImpl( override val messageId: MessageId, - override val from: User?, override val chat: PreviewChannelChat, + override val senderChat: PreviewChat, override val content: T, override val date: DateTime, override val editDate: DateTime?, @@ -27,8 +28,8 @@ data class ChannelContentMessageImpl( ) : ChannelContentMessage { constructor( messageId: MessageId, - from: User?, chat: PreviewChannelChat, + senderChat: PreviewChat, content: T, date: DateTime, editDate: DateTime?, @@ -41,6 +42,6 @@ data class ChannelContentMessageImpl( mediaGroupId: MediaGroupId?, fromOffline: Boolean, ) : this( - messageId, from, chat, content, date, editDate, hasProtectedContent, forwardInfo.messageOrigin(), replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, senderBot, authorSignature, mediaGroupId, fromOffline + messageId, chat, senderChat, content, date, editDate, hasProtectedContent, forwardInfo.messageOrigin(), replyTo ?.let { ReplyInfo.Internal(it) }, replyMarkup, senderBot, authorSignature, mediaGroupId, fromOffline ) } 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 ae73502f94..88a9651fd9 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 @@ -51,7 +51,7 @@ internal data class RawMessage( private val chat: PreviewChat, @SerialName(messageThreadIdField) private val messageThreadId: MessageThreadId? = null, - private val from: User? = null, + private val from: PreviewUser? = null, private val sender_chat: PreviewPublicChat? = null, private val forward_origin: MessageOrigin? = null, private val is_topic_message: Boolean? = null, @@ -339,8 +339,8 @@ internal data class RawMessage( is PreviewPublicChat -> when (chat) { is PreviewChannelChat -> ChannelContentMessageImpl( messageId = messageId, - from = checkedFrom ?: from, chat = chat, + senderChat = checkedFrom ?: sender_chat ?: chat, content = content, date = date.asDate, editDate = edit_date?.asDate, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage.kt index 435466e558..0781e52cd4 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage.kt @@ -1,11 +1,11 @@ package dev.inmo.tgbotapi.types.message.abstracts -import dev.inmo.tgbotapi.types.chat.ChannelChat import dev.inmo.tgbotapi.types.chat.PreviewChannelChat +import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.message.content.MessageContent interface ChannelContentMessage : PossiblySentViaBotCommonMessage, SignedMessage, WithSenderChatMessage, OptionallyFromUserMessage { override val chat: PreviewChannelChat - override val senderChat: PreviewChannelChat - get() = chat + override val from: User? + get() = senderChat as? User } From 1dc9dc42fb8472a3fc1b6be5d4b2a1d69fb5b85c Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 14 Aug 2024 23:09:16 +0600 Subject: [PATCH 11/19] improve ChannelContentMessage --- .../types/message/abstracts/WithSenderChatMessage.kt | 1 - .../extensions/MediaGroupContentMessageCreator.kt | 2 +- .../tgbotapi/extensions/utils/ClassCastsNewAny.kt | 11 +++++++++++ .../extensions/utils/extensions/raw/Message.kt | 4 ++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/WithSenderChatMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/WithSenderChatMessage.kt index 75a9bb3417..1b3c513631 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/WithSenderChatMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/abstracts/WithSenderChatMessage.kt @@ -1,6 +1,5 @@ package dev.inmo.tgbotapi.types.message.abstracts -import dev.inmo.tgbotapi.types.chat.Chat import dev.inmo.tgbotapi.types.chat.PreviewChat interface WithSenderChatMessage { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/extensions/MediaGroupContentMessageCreator.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/extensions/MediaGroupContentMessageCreator.kt index b131db0432..f5afda775b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/extensions/MediaGroupContentMessageCreator.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/extensions/MediaGroupContentMessageCreator.kt @@ -17,8 +17,8 @@ fun List>.asMedia return when (sourceMessage) { is ChannelContentMessage -> ChannelContentMessageImpl( messageId = sourceMessage.messageId, - from = sourceMessage.from, chat = sourceMessage.chat, + senderChat = sourceMessage.senderChat, content = content, date = sourceMessage.date, editDate = sourceMessage.editDate, diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAny.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAny.kt index 1092af4617..5dd5444676 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAny.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAny.kt @@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.abstracts.OptionallyFromUser import dev.inmo.tgbotapi.abstracts.OptionallyWithUser import dev.inmo.tgbotapi.abstracts.WithUser import dev.inmo.tgbotapi.types.abstracts.WithOptionalLanguageCode +import dev.inmo.tgbotapi.types.message.abstracts.WithSenderChatMessage import dev.inmo.tgbotapi.utils.PreviewFeature @PreviewFeature @@ -54,3 +55,13 @@ inline fun Any.withOptionalLanguageCodeOrNull(): WithOptionalLanguageCode? = thi @PreviewFeature inline fun Any.withOptionalLanguageCodeOrThrow(): WithOptionalLanguageCode = this as WithOptionalLanguageCode + +@PreviewFeature +inline fun Any.ifWithSenderChatMessage(block: (WithSenderChatMessage) -> T) = + withSenderChatMessageOrNull()?.let(block) + +@PreviewFeature +inline fun Any.withSenderChatMessageOrNull(): WithSenderChatMessage? = this as? WithSenderChatMessage + +@PreviewFeature +inline fun Any.withSenderChatMessageOrThrow(): WithSenderChatMessage = this as WithSenderChatMessage diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt index 5aaf7383a5..0a627f1aef 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/raw/Message.kt @@ -25,8 +25,8 @@ import dev.inmo.tgbotapi.utils.RiskFeature inline val Message.from: User? get() = optionallyFromUserMessageOrNull() ?.from @RiskFeature(RawFieldsUsageWarning) -inline val Message.sender_chat: PublicChat? - get() = asFromChannelGroupContentMessage() ?.senderChat +inline val Message.sender_chat: PreviewChat? + get() = withSenderChatMessageOrNull() ?.senderChat @RiskFeature(RawFieldsUsageWarning) inline val Message.forward_from: User? get() = asPossiblyForwardedMessage() ?.forwardInfo ?.asUserForwardInfo() ?.from From ac6cf6e0b2160a8c6faade15a8c8b5be2724f4d5 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 15 Aug 2024 00:20:22 +0600 Subject: [PATCH 12/19] jvmApiDump --- tgbotapi.api/api/tgbotapi.api.api | 12 + tgbotapi.core/api/tgbotapi.core.api | 256 +++++++++++++++++-- tgbotapi.utils/api/tgbotapi.utils.api | 341 ++++++++++++++------------ 3 files changed, 425 insertions(+), 184 deletions(-) diff --git a/tgbotapi.api/api/tgbotapi.api.api b/tgbotapi.api/api/tgbotapi.api.api index c326a6386e..e3c574a413 100644 --- a/tgbotapi.api/api/tgbotapi.api.api +++ b/tgbotapi.api/api/tgbotapi.api.api @@ -486,6 +486,14 @@ public final class dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChat public static final fun createChatInviteLinkWithLimitedMembers-R4jdXRs (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IDLjava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun createChatInviteLinkWithLimitedMembers-R4jdXRs$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IDLjava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun createChatInviteLinkWithLimitedMembers-R4jdXRs$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IDLjava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun createChatSubscriptionInviteLink-9yjpIiU (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;DLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun createChatSubscriptionInviteLink-9yjpIiU (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IJLjava/lang/String;DLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun createChatSubscriptionInviteLink-9yjpIiU$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;DLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun createChatSubscriptionInviteLink-9yjpIiU$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IJLjava/lang/String;DLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun createChatSubscriptionInviteLink-u39P7bI (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun createChatSubscriptionInviteLink-u39P7bI (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IJLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun createChatSubscriptionInviteLink-u39P7bI$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun createChatSubscriptionInviteLink-u39P7bI$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IJLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; } public final class dev/inmo/tgbotapi/extensions/api/chat/invite_links/DeclineChatJoinRequestKt { @@ -547,6 +555,10 @@ public final class dev/inmo/tgbotapi/extensions/api/chat/invite_links/EditChatIn public static synthetic fun editChatInviteLinkWithLimitedMembers-3EthhN0$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;IDLjava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun editChatInviteLinkWithLimitedMembers-3EthhN0$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;Ldev/inmo/tgbotapi/types/ChatInviteLink;IDLjava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun editChatInviteLinkWithLimitedMembers-3EthhN0$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;Ljava/lang/String;IDLjava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun editChatSubscriptionInviteLink (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/ChatInviteLink;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun editChatSubscriptionInviteLink (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun editChatSubscriptionInviteLink (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;Ldev/inmo/tgbotapi/types/ChatInviteLink;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun editChatSubscriptionInviteLink (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;Ljava/lang/String;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } public final class dev/inmo/tgbotapi/extensions/api/chat/invite_links/RevokeChatInviteLinkKt { diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index ef46c9af04..fcb683fe34 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -48,7 +48,7 @@ public final class dev/inmo/tgbotapi/abstracts/EntitiesOutput$DefaultImpls { public static fun getEntities (Ldev/inmo/tgbotapi/abstracts/EntitiesOutput;)Ljava/util/List; } -public abstract interface class dev/inmo/tgbotapi/abstracts/FromUser : dev/inmo/tgbotapi/abstracts/WithUser { +public abstract interface class dev/inmo/tgbotapi/abstracts/FromUser : dev/inmo/tgbotapi/abstracts/OptionallyFromUser, dev/inmo/tgbotapi/abstracts/WithUser { public abstract fun getFrom ()Ldev/inmo/tgbotapi/types/chat/User; public abstract fun getUser ()Ldev/inmo/tgbotapi/types/chat/User; } @@ -78,6 +78,19 @@ public abstract interface class dev/inmo/tgbotapi/abstracts/MimeTyped { public abstract fun getMimeType ()Ldev/inmo/tgbotapi/utils/MimeType; } +public abstract interface class dev/inmo/tgbotapi/abstracts/OptionallyFromUser : dev/inmo/tgbotapi/abstracts/OptionallyWithUser { + public abstract fun getFrom ()Ldev/inmo/tgbotapi/types/chat/User; + public abstract fun getUser ()Ldev/inmo/tgbotapi/types/chat/User; +} + +public final class dev/inmo/tgbotapi/abstracts/OptionallyFromUser$DefaultImpls { + public static fun getUser (Ldev/inmo/tgbotapi/abstracts/OptionallyFromUser;)Ldev/inmo/tgbotapi/types/chat/User; +} + +public abstract interface class dev/inmo/tgbotapi/abstracts/OptionallyWithUser { + public abstract fun getUser ()Ldev/inmo/tgbotapi/types/chat/User; +} + public abstract interface class dev/inmo/tgbotapi/abstracts/ParsableOutput : dev/inmo/tgbotapi/abstracts/Texted { public abstract fun getParseMode ()Ldev/inmo/tgbotapi/types/message/ParseMode; } @@ -132,7 +145,7 @@ public abstract interface class dev/inmo/tgbotapi/abstracts/WithPreviewChat { public abstract interface class dev/inmo/tgbotapi/abstracts/WithPreviewChatAndMessageId : dev/inmo/tgbotapi/abstracts/WithMessageId, dev/inmo/tgbotapi/abstracts/WithPreviewChat { } -public abstract interface class dev/inmo/tgbotapi/abstracts/WithUser { +public abstract interface class dev/inmo/tgbotapi/abstracts/WithUser : dev/inmo/tgbotapi/abstracts/OptionallyWithUser { public abstract fun getUser ()Ldev/inmo/tgbotapi/types/chat/User; } @@ -2424,6 +2437,8 @@ public abstract interface class dev/inmo/tgbotapi/requests/chat/invite_links/Cre } public final class dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink$Companion { + public final fun subscription-7HLvUy8 (Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatSubscriptionInviteLink; + public static synthetic fun subscription-7HLvUy8$default (Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink$Companion;Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatSubscriptionInviteLink; public final fun unlimited (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLinkUnlimited; public static synthetic fun unlimited$default (Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink$Companion;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLinkUnlimited; public final fun unlimited-Gi7IvD8 (Ldev/inmo/tgbotapi/types/ChatIdentifier;DLjava/lang/String;)Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLinkUnlimited; @@ -2443,6 +2458,17 @@ public final class dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInvite public static fun method (Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink;)Ljava/lang/String; } +public abstract interface class dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink$Subscription : dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink { + public abstract fun getSubscriptionPeriod-UwyO8pc ()J + public abstract fun getSubscriptionPrice-pVg5ArA ()I + public abstract fun method ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink$Subscription$DefaultImpls { + public static fun getExpireDate-Ivn3T5g (Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink$Subscription;)Lkorlibs/time/DateTime; + public static fun method (Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink$Subscription;)Ljava/lang/String; +} + public final class dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLinkUnlimited : dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink { public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLinkUnlimited$Companion; public fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;)V @@ -2553,6 +2579,46 @@ public final class dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInvite public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatSubscriptionInviteLink : dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink$Subscription { + public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatSubscriptionInviteLink$Companion; + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;ILjava/lang/String;JLdev/inmo/tgbotapi/types/TelegramDate;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;ILjava/lang/String;JLdev/inmo/tgbotapi/types/TelegramDate;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier; + public final fun component2-pVg5ArA ()I + public final fun component3 ()Ljava/lang/String; + public final fun component4-UwyO8pc ()J + public final fun component5 ()Ldev/inmo/tgbotapi/types/TelegramDate; + public final fun copy-DYG142g (Ldev/inmo/tgbotapi/types/ChatIdentifier;ILjava/lang/String;JLdev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatSubscriptionInviteLink; + public static synthetic fun copy-DYG142g$default (Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatSubscriptionInviteLink;Ldev/inmo/tgbotapi/types/ChatIdentifier;ILjava/lang/String;JLdev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatSubscriptionInviteLink; + public fun equals (Ljava/lang/Object;)Z + public fun getChatId ()Ldev/inmo/tgbotapi/types/ChatIdentifier; + public fun getExpirationUnixTimeStamp ()Ldev/inmo/tgbotapi/types/TelegramDate; + public fun getExpireDate-Ivn3T5g ()Lkorlibs/time/DateTime; + public fun getName ()Ljava/lang/String; + public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy; + public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy; + public fun getSubscriptionPeriod-UwyO8pc ()J + public fun getSubscriptionPrice-pVg5ArA ()I + public fun hashCode ()I + public fun method ()Ljava/lang/String; + public fun toString ()Ljava/lang/String; +} + +public synthetic class dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatSubscriptionInviteLink$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatSubscriptionInviteLink$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/chat/invite_links/CreateChatSubscriptionInviteLink; + 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/CreateChatSubscriptionInviteLink;)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/CreateChatSubscriptionInviteLink$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/requests/chat/invite_links/DeclineChatJoinRequest : dev/inmo/tgbotapi/requests/chat/invite_links/ChatJoinRequestAnswer { public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/DeclineChatJoinRequest$Companion; public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;JLkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -2593,6 +2659,7 @@ public abstract interface class dev/inmo/tgbotapi/requests/chat/invite_links/Edi } public final class dev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink$Companion { + public final fun subscription (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;Ljava/lang/String;)Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatSubscriptionInviteLink; public final fun unlimited (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLinkUnlimited; public static synthetic fun unlimited$default (Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink$Companion;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLinkUnlimited; public final fun unlimited-IJLmwWg (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;DLjava/lang/String;)Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLinkUnlimited; @@ -2612,6 +2679,15 @@ public final class dev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLi public static fun method (Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink;)Ljava/lang/String; } +public abstract interface class dev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink$Subscription : dev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink { + public abstract fun method ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink$Subscription$DefaultImpls { + public static fun getExpireDate-Ivn3T5g (Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink$Subscription;)Lkorlibs/time/DateTime; + public static fun method (Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink$Subscription;)Ljava/lang/String; +} + public final class dev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLinkUnlimited : dev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink { public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLinkUnlimited$Companion; public fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;)V @@ -2728,6 +2804,43 @@ public final class dev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLi public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/requests/chat/invite_links/EditChatSubscriptionInviteLink : dev/inmo/tgbotapi/requests/chat/invite_links/EditChatInviteLink$Subscription { + public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatSubscriptionInviteLink$Companion; + public fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;Ljava/lang/String;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier; + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()Ljava/lang/String; + public final fun copy (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;Ljava/lang/String;)Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatSubscriptionInviteLink; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatSubscriptionInviteLink;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatSubscriptionInviteLink; + public fun equals (Ljava/lang/Object;)Z + public fun getChatId ()Ldev/inmo/tgbotapi/types/ChatIdentifier; + public fun getExpirationUnixTimeStamp ()Ldev/inmo/tgbotapi/types/TelegramDate; + public fun getExpireDate-Ivn3T5g ()Lkorlibs/time/DateTime; + public fun getInviteLink ()Ljava/lang/String; + public fun getName ()Ljava/lang/String; + public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy; + public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy; + public fun hashCode ()I + public fun method ()Ljava/lang/String; + public fun toString ()Ljava/lang/String; +} + +public synthetic class dev/inmo/tgbotapi/requests/chat/invite_links/EditChatSubscriptionInviteLink$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatSubscriptionInviteLink$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/chat/invite_links/EditChatSubscriptionInviteLink; + 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/EditChatSubscriptionInviteLink;)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/EditChatSubscriptionInviteLink$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/requests/chat/invite_links/RevokeChatInviteLink : dev/inmo/tgbotapi/requests/chat/abstracts/KnownChatInviteLinkRequest { public static final field Companion Ldev/inmo/tgbotapi/requests/chat/invite_links/RevokeChatInviteLink$Companion; public fun (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/lang/String;)V @@ -8783,6 +8896,8 @@ public final class dev/inmo/tgbotapi/types/CommonKt { public static final field stickerSetNameFullField Ljava/lang/String; public static final field stickerTypeField Ljava/lang/String; public static final field stickersField Ljava/lang/String; + public static final field subscriptionPeriodField Ljava/lang/String; + public static final field subscriptionPriceField Ljava/lang/String; public static final field suggestedTipAmountsField Ljava/lang/String; public static final field supportInlineQueriesField Ljava/lang/String; public static final field supportStreamingField Ljava/lang/String; @@ -11209,6 +11324,7 @@ public synthetic class dev/inmo/tgbotapi/types/RawChatId$$serializer : kotlinx/s public final class dev/inmo/tgbotapi/types/RawChatId$Companion { public final fun getDefaultUserId-iyD94Bc ()J + public final fun getFakeUserId-iyD94Bc ()J public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -15667,6 +15783,8 @@ public final class dev/inmo/tgbotapi/types/chat/member/ChatMember$Status : java/ public static final field Left Ldev/inmo/tgbotapi/types/chat/member/ChatMember$Status; public static final field Member Ldev/inmo/tgbotapi/types/chat/member/ChatMember$Status; public static final field Restricted Ldev/inmo/tgbotapi/types/chat/member/ChatMember$Status; + public static final field SubscriptionMember Ldev/inmo/tgbotapi/types/chat/member/ChatMember$Status; + public final fun getChecker ()Lkotlin/jvm/functions/Function2; public final fun getDeserializationStrategy ()Lkotlinx/serialization/DeserializationStrategy; public static fun getEntries ()Lkotlin/enums/EnumEntries; public final fun getStatus ()Ljava/lang/String; @@ -15974,6 +16092,51 @@ public final class dev/inmo/tgbotapi/types/chat/member/SpecialRightsChatMember$C public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public abstract interface class dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMember : dev/inmo/tgbotapi/abstracts/types/UntilDate, dev/inmo/tgbotapi/types/chat/member/MemberChatMember { + public static final field Companion Ldev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMember$Companion; + public abstract fun getUntil-Wg0KzQs ()D + public abstract fun getUntilDate ()Ldev/inmo/tgbotapi/types/TelegramDate; +} + +public final class dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMember$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMember$DefaultImpls { + public static fun getUntil-Wg0KzQs (Ldev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMember;)D +} + +public final class dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMemberImpl : dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMember { + public static final field Companion Ldev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMemberImpl$Companion; + public fun (Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/TelegramDate;)V + public final fun component1 ()Ldev/inmo/tgbotapi/types/chat/User; + public final fun component2 ()Ldev/inmo/tgbotapi/types/TelegramDate; + public final fun copy (Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/TelegramDate;)Ldev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMemberImpl; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMemberImpl;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/TelegramDate;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMemberImpl; + public fun equals (Ljava/lang/Object;)Z + public fun getStatus ()Ldev/inmo/tgbotapi/types/chat/member/ChatMember$Status; + public fun getUntil-Wg0KzQs ()D + public fun getUntilDate ()Ldev/inmo/tgbotapi/types/TelegramDate; + public fun getUser ()Ldev/inmo/tgbotapi/types/chat/User; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class dev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMemberImpl$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMemberImpl$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMemberImpl; + 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/chat/member/SubscriptionMemberChatMemberImpl;)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/chat/member/SubscriptionMemberChatMemberImpl$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/types/colors/ColorId { public static final field Companion Ldev/inmo/tgbotapi/types/colors/ColorId$Companion; public static final synthetic fun box-impl (I)Ldev/inmo/tgbotapi/types/colors/ColorId; @@ -18504,23 +18667,24 @@ public final class dev/inmo/tgbotapi/types/message/BusinessContentMessageImpl : } public final class dev/inmo/tgbotapi/types/message/ChannelContentMessageImpl : dev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage { - public synthetic fun (JLdev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/ForwardInfo;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/internal/DefaultConstructorMarker;)V - public synthetic fun (JLdev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/MessageOrigin;Ldev/inmo/tgbotapi/types/ReplyInfo;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLdev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ldev/inmo/tgbotapi/types/chat/PreviewChat;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/ForwardInfo;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/internal/DefaultConstructorMarker;)V + public synthetic fun (JLdev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ldev/inmo/tgbotapi/types/chat/PreviewChat;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/MessageOrigin;Ldev/inmo/tgbotapi/types/ReplyInfo;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ljava/lang/String;ZLkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1-APLFQys ()J - public final fun component10 ()Ldev/inmo/tgbotapi/types/chat/CommonBot; - public final fun component11 ()Ljava/lang/String; - public final fun component12-CsYhHCU ()Ljava/lang/String; - public final fun component13 ()Z + public final fun component10 ()Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup; + public final fun component11 ()Ldev/inmo/tgbotapi/types/chat/CommonBot; + public final fun component12 ()Ljava/lang/String; + public final fun component13-CsYhHCU ()Ljava/lang/String; + public final fun component14 ()Z public final fun component2 ()Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat; - public final fun component3 ()Ldev/inmo/tgbotapi/types/message/content/MessageContent; - public final fun component4-Wg0KzQs ()D - public final fun component5-Ivn3T5g ()Lkorlibs/time/DateTime; - public final fun component6 ()Z - public final fun component7 ()Ldev/inmo/tgbotapi/types/message/MessageOrigin; - public final fun component8 ()Ldev/inmo/tgbotapi/types/ReplyInfo; - public final fun component9 ()Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup; - public final fun copy-ybEjycM (JLdev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/MessageOrigin;Ldev/inmo/tgbotapi/types/ReplyInfo;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ljava/lang/String;Z)Ldev/inmo/tgbotapi/types/message/ChannelContentMessageImpl; - public static synthetic fun copy-ybEjycM$default (Ldev/inmo/tgbotapi/types/message/ChannelContentMessageImpl;JLdev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/MessageOrigin;Ldev/inmo/tgbotapi/types/ReplyInfo;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/message/ChannelContentMessageImpl; + public final fun component3 ()Ldev/inmo/tgbotapi/types/chat/PreviewChat; + public final fun component4 ()Ldev/inmo/tgbotapi/types/message/content/MessageContent; + public final fun component5-Wg0KzQs ()D + public final fun component6-Ivn3T5g ()Lkorlibs/time/DateTime; + public final fun component7 ()Z + public final fun component8 ()Ldev/inmo/tgbotapi/types/message/MessageOrigin; + public final fun component9 ()Ldev/inmo/tgbotapi/types/ReplyInfo; + public final fun copy-sAAtVUk (JLdev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ldev/inmo/tgbotapi/types/chat/PreviewChat;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/MessageOrigin;Ldev/inmo/tgbotapi/types/ReplyInfo;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ljava/lang/String;Z)Ldev/inmo/tgbotapi/types/message/ChannelContentMessageImpl; + public static synthetic fun copy-sAAtVUk$default (Ldev/inmo/tgbotapi/types/message/ChannelContentMessageImpl;JLdev/inmo/tgbotapi/types/chat/PreviewChannelChat;Ldev/inmo/tgbotapi/types/chat/PreviewChat;Ldev/inmo/tgbotapi/types/message/content/MessageContent;DLkorlibs/time/DateTime;ZLdev/inmo/tgbotapi/types/message/MessageOrigin;Ldev/inmo/tgbotapi/types/ReplyInfo;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Ldev/inmo/tgbotapi/types/chat/CommonBot;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/message/ChannelContentMessageImpl; public fun equals (Ljava/lang/Object;)Z public fun getAuthorSignature ()Ljava/lang/String; public fun getBusinessConnectionId-nXr5wdE ()Ljava/lang/String; @@ -18532,6 +18696,7 @@ public final class dev/inmo/tgbotapi/types/message/ChannelContentMessageImpl : d public fun getForwardInfo ()Ldev/inmo/tgbotapi/types/message/ForwardInfo; public fun getForwardOrigin ()Ldev/inmo/tgbotapi/types/message/MessageOrigin; public fun getForwardable ()Z + public fun getFrom ()Ldev/inmo/tgbotapi/types/chat/User; public fun getFromOffline ()Z public fun getHasProtectedContent ()Z public fun getMediaGroupId-CsYhHCU ()Ljava/lang/String; @@ -18541,8 +18706,8 @@ public final class dev/inmo/tgbotapi/types/message/ChannelContentMessageImpl : d public fun getReplyMarkup ()Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup; public fun getReplyTo ()Ldev/inmo/tgbotapi/types/message/abstracts/Message; public fun getSenderBot ()Ldev/inmo/tgbotapi/types/chat/CommonBot; - public fun getSenderChat ()Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat; - public synthetic fun getSenderChat ()Ldev/inmo/tgbotapi/types/chat/PreviewChat; + public fun getSenderChat ()Ldev/inmo/tgbotapi/types/chat/PreviewChat; + public fun getUser ()Ldev/inmo/tgbotapi/types/chat/User; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -19805,18 +19970,19 @@ public final class dev/inmo/tgbotapi/types/message/abstracts/BusinessContentMess public static fun getUser (Ldev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage;)Ldev/inmo/tgbotapi/types/chat/User; } -public abstract interface class dev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage : dev/inmo/tgbotapi/types/message/abstracts/PossiblySentViaBotCommonMessage, dev/inmo/tgbotapi/types/message/abstracts/SignedMessage, dev/inmo/tgbotapi/types/message/abstracts/WithSenderChatMessage { +public abstract interface class dev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage : dev/inmo/tgbotapi/types/message/abstracts/OptionallyFromUserMessage, dev/inmo/tgbotapi/types/message/abstracts/PossiblySentViaBotCommonMessage, dev/inmo/tgbotapi/types/message/abstracts/SignedMessage, dev/inmo/tgbotapi/types/message/abstracts/WithSenderChatMessage { public abstract fun getChat ()Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat; - public abstract fun getSenderChat ()Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat; + public abstract fun getFrom ()Ldev/inmo/tgbotapi/types/chat/User; } public final class dev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage$DefaultImpls { public static fun getBusinessConnectionId-nXr5wdE (Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage;)Ljava/lang/String; public static fun getForwardInfo (Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage;)Ldev/inmo/tgbotapi/types/message/ForwardInfo; public static fun getForwardable (Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage;)Z + public static fun getFrom (Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage;)Ldev/inmo/tgbotapi/types/chat/User; public static fun getMetaInfo-fV8YnZ8 (Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage;)Lkotlin/Triple; public static fun getReplyTo (Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage;)Ldev/inmo/tgbotapi/types/message/abstracts/Message; - public static fun getSenderChat (Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage;)Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat; + public static fun getUser (Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage;)Ldev/inmo/tgbotapi/types/chat/User; } public abstract interface class dev/inmo/tgbotapi/types/message/abstracts/ChatEventMessage : dev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage { @@ -19926,7 +20092,7 @@ public final class dev/inmo/tgbotapi/types/message/abstracts/FromChannelGroupCon public static fun getSenderChat (Ldev/inmo/tgbotapi/types/message/abstracts/FromChannelGroupContentMessage;)Ldev/inmo/tgbotapi/types/chat/PreviewChannelChat; } -public abstract interface class dev/inmo/tgbotapi/types/message/abstracts/FromUserMessage : dev/inmo/tgbotapi/abstracts/FromUser, dev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage { +public abstract interface class dev/inmo/tgbotapi/types/message/abstracts/FromUserMessage : dev/inmo/tgbotapi/abstracts/FromUser, dev/inmo/tgbotapi/types/message/abstracts/OptionallyFromUserMessage { } public final class dev/inmo/tgbotapi/types/message/abstracts/FromUserMessage$DefaultImpls { @@ -20039,6 +20205,15 @@ public final class dev/inmo/tgbotapi/types/message/abstracts/Message$MetaInfo$Co public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public abstract interface class dev/inmo/tgbotapi/types/message/abstracts/OptionallyFromUserMessage : dev/inmo/tgbotapi/abstracts/OptionallyFromUser, dev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage { +} + +public final class dev/inmo/tgbotapi/types/message/abstracts/OptionallyFromUserMessage$DefaultImpls { + public static fun getBusinessConnectionId-nXr5wdE (Ldev/inmo/tgbotapi/types/message/abstracts/OptionallyFromUserMessage;)Ljava/lang/String; + public static fun getMetaInfo-fV8YnZ8 (Ldev/inmo/tgbotapi/types/message/abstracts/OptionallyFromUserMessage;)Lkotlin/Triple; + public static fun getUser (Ldev/inmo/tgbotapi/types/message/abstracts/OptionallyFromUserMessage;)Ldev/inmo/tgbotapi/types/chat/User; +} + public abstract interface class dev/inmo/tgbotapi/types/message/abstracts/PossiblyBusinessMessage : dev/inmo/tgbotapi/abstracts/types/WithOptionalBusinessConnectionId { public abstract fun getBusinessConnectionId-nXr5wdE ()Ljava/lang/String; } @@ -24376,14 +24551,16 @@ public final class dev/inmo/tgbotapi/types/payments/stars/TransactionPartner$Unk public final class dev/inmo/tgbotapi/types/payments/stars/TransactionPartner$User : dev/inmo/tgbotapi/types/payments/stars/TransactionPartner { public static final field Companion Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner$User$Companion; public static final field type Ljava/lang/String; - public fun (Ldev/inmo/tgbotapi/types/chat/PreviewUser;Ljava/lang/String;)V - public synthetic fun (Ldev/inmo/tgbotapi/types/chat/PreviewUser;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun (Ldev/inmo/tgbotapi/types/chat/PreviewUser;Ljava/lang/String;Ljava/util/List;)V + public synthetic fun (Ldev/inmo/tgbotapi/types/chat/PreviewUser;Ljava/lang/String;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ldev/inmo/tgbotapi/types/chat/PreviewUser; public final fun component2 ()Ljava/lang/String; - public final fun copy (Ldev/inmo/tgbotapi/types/chat/PreviewUser;Ljava/lang/String;)Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner$User; - public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner$User;Ldev/inmo/tgbotapi/types/chat/PreviewUser;Ljava/lang/String;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner$User; + public final fun component3 ()Ljava/util/List; + public final fun copy (Ldev/inmo/tgbotapi/types/chat/PreviewUser;Ljava/lang/String;Ljava/util/List;)Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner$User; + public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner$User;Ldev/inmo/tgbotapi/types/chat/PreviewUser;Ljava/lang/String;Ljava/util/List;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner$User; public fun equals (Ljava/lang/Object;)Z public final fun getInvoicePayload ()Ljava/lang/String; + public final fun getPaidMedia ()Ljava/util/List; public fun getType ()Ljava/lang/String; public final fun getUser ()Ldev/inmo/tgbotapi/types/chat/PreviewUser; public fun hashCode ()I @@ -25046,6 +25223,17 @@ public final class dev/inmo/tgbotapi/types/reactions/Reaction$Emoji$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class dev/inmo/tgbotapi/types/reactions/Reaction$Paid : dev/inmo/tgbotapi/types/reactions/Reaction { + public static final field Companion Ldev/inmo/tgbotapi/types/reactions/Reaction$Paid$Companion; + public static final field type Ljava/lang/String; + public fun ()V + public fun getType ()Ljava/lang/String; +} + +public final class dev/inmo/tgbotapi/types/reactions/Reaction$Paid$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class dev/inmo/tgbotapi/types/reactions/Reaction$Unknown : dev/inmo/tgbotapi/types/reactions/Reaction { public static final field Companion Ldev/inmo/tgbotapi/types/reactions/Reaction$Unknown$Companion; public fun (Ljava/lang/String;Lkotlinx/serialization/json/JsonElement;)V @@ -26528,6 +26716,20 @@ public final class dev/inmo/tgbotapi/utils/TelegramAPIUrlsKeeperKt { public static final field telegramBotAPIDefaultUrl Ljava/lang/String; } +public final class dev/inmo/tgbotapi/utils/TelegramFakeUserKt { + public static final fun getTelegramFakeUser ()Ldev/inmo/tgbotapi/types/chat/CommonUser; + public static final fun isFakeTelegramUser (Ldev/inmo/tgbotapi/types/chat/User;)Z +} + +public final class dev/inmo/tgbotapi/utils/TimeSpanAsSecondsSerializer : kotlinx/serialization/KSerializer { + public static final field INSTANCE Ldev/inmo/tgbotapi/utils/TimeSpanAsSecondsSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public fun deserialize-5sfh64U (Lkotlinx/serialization/encoding/Decoder;)J + public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public fun serialize-HG0u8IE (Lkotlinx/serialization/encoding/Encoder;J)V +} + public final class dev/inmo/tgbotapi/utils/extensions/AsReferenceKt { public static final fun asReference (Ljava/lang/Object;)Ljava/lang/ref/WeakReference; } diff --git a/tgbotapi.utils/api/tgbotapi.utils.api b/tgbotapi.utils/api/tgbotapi.utils.api index 09c97a4541..e04d16ffaa 100644 --- a/tgbotapi.utils/api/tgbotapi.utils.api +++ b/tgbotapi.utils/api/tgbotapi.utils.api @@ -1039,10 +1039,19 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAnyKt { public static final fun fromUserOrNull (Ljava/lang/Object;)Ldev/inmo/tgbotapi/abstracts/FromUser; public static final fun fromUserOrThrow (Ljava/lang/Object;)Ldev/inmo/tgbotapi/abstracts/FromUser; public static final fun ifFromUser (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifOptionallyFromUser (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifOptionallyWithUser (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifWithOptionalLanguageCode (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifWithSenderChatMessage (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifWithUser (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun optionallyFromUserOrNull (Ljava/lang/Object;)Ldev/inmo/tgbotapi/abstracts/OptionallyFromUser; + public static final fun optionallyFromUserOrThrow (Ljava/lang/Object;)Ldev/inmo/tgbotapi/abstracts/OptionallyFromUser; + public static final fun optionallyWithUserOrNull (Ljava/lang/Object;)Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser; + public static final fun optionallyWithUserOrThrow (Ljava/lang/Object;)Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser; public static final fun withOptionalLanguageCodeOrNull (Ljava/lang/Object;)Ldev/inmo/tgbotapi/types/abstracts/WithOptionalLanguageCode; public static final fun withOptionalLanguageCodeOrThrow (Ljava/lang/Object;)Ldev/inmo/tgbotapi/types/abstracts/WithOptionalLanguageCode; + public static final fun withSenderChatMessageOrNull (Ljava/lang/Object;)Ldev/inmo/tgbotapi/types/message/abstracts/WithSenderChatMessage; + public static final fun withSenderChatMessageOrThrow (Ljava/lang/Object;)Ldev/inmo/tgbotapi/types/message/abstracts/WithSenderChatMessage; public static final fun withUserOrNull (Ljava/lang/Object;)Ldev/inmo/tgbotapi/abstracts/WithUser; public static final fun withUserOrThrow (Ljava/lang/Object;)Ldev/inmo/tgbotapi/abstracts/WithUser; } @@ -1050,14 +1059,14 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewAnyKt { public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ableToAddInAttachmentMenuChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/AbleToAddInAttachmentMenuChat; public static final fun ableToAddInAttachmentMenuChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/AbleToAddInAttachmentMenuChat; - public static final fun abstractMessageCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/AbstractMessageCallbackQuery; - public static final fun abstractMessageCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/AbstractMessageCallbackQuery; + public static final fun abstractMessageCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/AbstractMessageCallbackQuery; + public static final fun abstractMessageCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/AbstractMessageCallbackQuery; public static final fun accessibleMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage; public static final fun accessibleMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage; public static final fun addressSecureValueOrNull (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/AddressSecureValue; public static final fun addressSecureValueOrThrow (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/AddressSecureValue; - public static final fun administratorChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/AdministratorChatMember; - public static final fun administratorChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/AdministratorChatMember; + public static final fun administratorChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/AdministratorChatMember; + public static final fun administratorChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/AdministratorChatMember; public static final fun adsOrNull (Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner;)Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner$Ads; public static final fun adsOrThrow (Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner;)Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner$Ads; public static final fun animatedStickerOrNull (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;)Ldev/inmo/tgbotapi/types/files/AnimatedSticker; @@ -1086,14 +1095,14 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun bankStatementOrThrow (Ldev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement;)Ldev/inmo/tgbotapi/types/passport/encrypted/BankStatement; public static final fun bankStatementSecureValueOrNull (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/BankStatementSecureValue; public static final fun bankStatementSecureValueOrThrow (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/BankStatementSecureValue; - public static final fun bannedChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/BannedChatMember; - public static final fun bannedChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/BannedChatMember; - public static final fun baseChosenInlineResultOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/BaseChosenInlineResult; - public static final fun baseChosenInlineResultOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/BaseChosenInlineResult; + public static final fun bannedChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/BannedChatMember; + public static final fun bannedChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/BannedChatMember; + public static final fun baseChosenInlineResultOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/BaseChosenInlineResult; + public static final fun baseChosenInlineResultOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/BaseChosenInlineResult; public static final fun baseEditMessageUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/abstracts/BaseEditMessageUpdate; public static final fun baseEditMessageUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/abstracts/BaseEditMessageUpdate; - public static final fun baseInlineQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/query/BaseInlineQuery; - public static final fun baseInlineQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/query/BaseInlineQuery; + public static final fun baseInlineQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/query/BaseInlineQuery; + public static final fun baseInlineQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/query/BaseInlineQuery; public static final fun baseMessageUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/abstracts/BaseMessageUpdate; public static final fun baseMessageUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/abstracts/BaseMessageUpdate; public static final fun baseSentMessageUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/abstracts/BaseSentMessageUpdate; @@ -1118,9 +1127,9 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun businessChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/BusinessChat; public static final fun businessConnectionUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/BusinessConnectionUpdate; public static final fun businessConnectionUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/BusinessConnectionUpdate; - public static final fun businessContentMessageOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage; + public static final fun businessContentMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage; public static final fun businessContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage; - public static final fun businessContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage; + public static final fun businessContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage; public static final fun businessContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/BusinessContentMessage; public static final fun businessMessageUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/BusinessMessageUpdate; public static final fun businessMessageUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/BusinessMessageUpdate; @@ -1138,8 +1147,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun callbackDataInlineKeyboardButtonOrThrow (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/CallbackDataInlineKeyboardButton; public static final fun callbackGameInlineKeyboardButtonOrNull (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/CallbackGameInlineKeyboardButton; public static final fun callbackGameInlineKeyboardButtonOrThrow (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/CallbackGameInlineKeyboardButton; - public static final fun callbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/CallbackQuery; - public static final fun callbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/CallbackQuery; + public static final fun callbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/CallbackQuery; + public static final fun callbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/CallbackQuery; public static final fun callbackQueryUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/CallbackQueryUpdate; public static final fun callbackQueryUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/CallbackQueryUpdate; public static final fun cashTagTextSourceOrNull (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/CashTagTextSource; @@ -1148,7 +1157,9 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun channelChatCreatedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/ChannelChatCreated; public static final fun channelChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/ChannelChat; public static final fun channelChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/ChannelChat; + public static final fun channelContentMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage; public static final fun channelContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage; + public static final fun channelContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage; public static final fun channelContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/ChannelContentMessage; public static final fun channelEventMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/ChannelEventMessage; public static final fun channelEventMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/ChannelEventMessage; @@ -1170,22 +1181,22 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun chatIdOrThrow (Ldev/inmo/tgbotapi/types/ChatIdentifier;)J public static final fun chatIdWithThreadIdOrNull (Ldev/inmo/tgbotapi/types/ChatIdentifier;)Lkotlin/Pair; public static final fun chatIdWithThreadIdOrThrow (Ldev/inmo/tgbotapi/types/ChatIdentifier;)Lkotlin/Pair; - public static final fun chatInviteLinkOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLink; - public static final fun chatInviteLinkOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLink; - public static final fun chatInviteLinkUnlimitedOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLinkUnlimited; - public static final fun chatInviteLinkUnlimitedOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLinkUnlimited; - public static final fun chatInviteLinkWithJoinRequestOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLinkWithJoinRequest; - public static final fun chatInviteLinkWithJoinRequestOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLinkWithJoinRequest; - public static final fun chatInviteLinkWithLimitedMembersOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLinkWithLimitedMembers; - public static final fun chatInviteLinkWithLimitedMembersOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLinkWithLimitedMembers; - public static final fun chatJoinRequestOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest; - public static final fun chatJoinRequestOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest; + public static final fun chatInviteLinkOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLink; + public static final fun chatInviteLinkOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLink; + public static final fun chatInviteLinkUnlimitedOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLinkUnlimited; + public static final fun chatInviteLinkUnlimitedOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLinkUnlimited; + public static final fun chatInviteLinkWithJoinRequestOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLinkWithJoinRequest; + public static final fun chatInviteLinkWithJoinRequestOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLinkWithJoinRequest; + public static final fun chatInviteLinkWithLimitedMembersOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLinkWithLimitedMembers; + public static final fun chatInviteLinkWithLimitedMembersOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/ChatInviteLinkWithLimitedMembers; + public static final fun chatJoinRequestOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest; + public static final fun chatJoinRequestOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/ChatJoinRequest; public static final fun chatJoinRequestUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/ChatJoinRequestUpdate; public static final fun chatJoinRequestUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/ChatJoinRequestUpdate; - public static final fun chatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/ChatMember; - public static final fun chatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/ChatMember; - public static final fun chatMemberUpdatedOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/ChatMemberUpdated; - public static final fun chatMemberUpdatedOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/ChatMemberUpdated; + public static final fun chatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/ChatMember; + public static final fun chatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/ChatMember; + public static final fun chatMemberUpdatedOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/ChatMemberUpdated; + public static final fun chatMemberUpdatedOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/ChatMemberUpdated; public static final fun chatMemberUpdatedUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/abstracts/ChatMemberUpdatedUpdate; public static final fun chatMemberUpdatedUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/abstracts/ChatMemberUpdatedUpdate; public static final fun chatMessageReactionUpdatedUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/ChatMessageReactionUpdatedUpdate; @@ -1204,8 +1215,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun chatThemeOrThrow (Ldev/inmo/tgbotapi/types/BackgroundType;)Ldev/inmo/tgbotapi/types/BackgroundType$ChatTheme; public static final fun chooseStickerActionOrNull (Ldev/inmo/tgbotapi/types/actions/BotAction;)Ldev/inmo/tgbotapi/types/actions/ChooseStickerAction; public static final fun chooseStickerActionOrThrow (Ldev/inmo/tgbotapi/types/actions/BotAction;)Ldev/inmo/tgbotapi/types/actions/ChooseStickerAction; - public static final fun chosenInlineResultOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/ChosenInlineResult; - public static final fun chosenInlineResultOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/ChosenInlineResult; + public static final fun chosenInlineResultOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/ChosenInlineResult; + public static final fun chosenInlineResultOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/ChosenInlineResult; public static final fun chosenInlineResultUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/ChosenInlineResultUpdate; public static final fun chosenInlineResultUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/ChosenInlineResultUpdate; public static final fun claimedOrNull (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;)Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$Giveaway$Claimed; @@ -1218,17 +1229,17 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun commonChatMemberUpdatedUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/CommonChatMemberUpdatedUpdate; public static final fun commonEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/CommonEvent; public static final fun commonEventOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/CommonEvent; - public static final fun commonForumContentMessageOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonForumContentMessage; + public static final fun commonForumContentMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonForumContentMessage; public static final fun commonForumContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonForumContentMessage; - public static final fun commonForumContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonForumContentMessage; + public static final fun commonForumContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonForumContentMessage; public static final fun commonForumContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonForumContentMessage; - public static final fun commonGroupContentMessageOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonGroupContentMessage; + public static final fun commonGroupContentMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonGroupContentMessage; public static final fun commonGroupContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonGroupContentMessage; - public static final fun commonGroupContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonGroupContentMessage; + public static final fun commonGroupContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonGroupContentMessage; public static final fun commonGroupContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonGroupContentMessage; - public static final fun commonGroupEventMessageOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/CommonGroupEventMessage; + public static final fun commonGroupEventMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/CommonGroupEventMessage; public static final fun commonGroupEventMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/CommonGroupEventMessage; - public static final fun commonGroupEventMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/CommonGroupEventMessage; + public static final fun commonGroupEventMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/CommonGroupEventMessage; public static final fun commonGroupEventMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/CommonGroupEventMessage; public static final fun commonMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage; public static final fun commonMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonMessage; @@ -1238,9 +1249,9 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun commonPassportOrThrow (Ldev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement;)Ldev/inmo/tgbotapi/types/passport/encrypted/CommonPassport; public static final fun commonPassportSecureValueOrNull (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/CommonPassportSecureValue; public static final fun commonPassportSecureValueOrThrow (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/CommonPassportSecureValue; - public static final fun commonSupergroupEventMessageOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/CommonSupergroupEventMessage; + public static final fun commonSupergroupEventMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/CommonSupergroupEventMessage; public static final fun commonSupergroupEventMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/CommonSupergroupEventMessage; - public static final fun commonSupergroupEventMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/CommonSupergroupEventMessage; + public static final fun commonSupergroupEventMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/CommonSupergroupEventMessage; public static final fun commonSupergroupEventMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/CommonSupergroupEventMessage; public static final fun commonUserOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/CommonUser; public static final fun commonUserOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/CommonUser; @@ -1276,8 +1287,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun customEmojiVideoStickerOrThrow (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;)Ldev/inmo/tgbotapi/types/files/CustomEmojiVideoSticker; public static final fun dartsDiceAnimationTypeOrNull (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;)Ldev/inmo/tgbotapi/types/dice/DartsDiceAnimationType; public static final fun dartsDiceAnimationTypeOrThrow (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;)Ldev/inmo/tgbotapi/types/dice/DartsDiceAnimationType; - public static final fun dataCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/DataCallbackQuery; - public static final fun dataCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/DataCallbackQuery; + public static final fun dataCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/DataCallbackQuery; + public static final fun dataCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/DataCallbackQuery; public static final fun deleteChatPhotoOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/DeleteChatPhoto; public static final fun deleteChatPhotoOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/DeleteChatPhoto; public static final fun deletedBusinessMessageUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/DeletedBusinessMessageUpdate; @@ -1410,16 +1421,16 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun fromChannelOrThrow (Ldev/inmo/tgbotapi/types/message/ForwardInfo;)Ldev/inmo/tgbotapi/types/message/ForwardInfo$PublicChat$FromChannel; public static final fun fromSupergroupOrNull (Ldev/inmo/tgbotapi/types/message/ForwardInfo;)Ldev/inmo/tgbotapi/types/message/ForwardInfo$PublicChat$FromSupergroup; public static final fun fromSupergroupOrThrow (Ldev/inmo/tgbotapi/types/message/ForwardInfo;)Ldev/inmo/tgbotapi/types/message/ForwardInfo$PublicChat$FromSupergroup; - public static final fun fromUserMessageOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/FromUserMessage; + public static final fun fromUserMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/FromUserMessage; public static final fun fromUserMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/FromUserMessage; - public static final fun fromUserMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/FromUserMessage; + public static final fun fromUserMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/FromUserMessage; public static final fun fromUserMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/FromUserMessage; - public static final fun fromUserOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/abstracts/FromUser; - public static final fun fromUserOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/abstracts/FromUser; + public static final fun fromUserOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/abstracts/FromUser; + public static final fun fromUserOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/abstracts/FromUser; public static final fun gameContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/GameContent; public static final fun gameContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/GameContent; - public static final fun gameShortNameCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/GameShortNameCallbackQuery; - public static final fun gameShortNameCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/GameShortNameCallbackQuery; + public static final fun gameShortNameCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/GameShortNameCallbackQuery; + public static final fun gameShortNameCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/GameShortNameCallbackQuery; public static final fun generalForumTopicHiddenOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/forum/GeneralForumTopicHidden; public static final fun generalForumTopicHiddenOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/forum/GeneralForumTopicHidden; public static final fun generalForumTopicUnhiddenOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/forum/GeneralForumTopicUnhidden; @@ -1444,9 +1455,9 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun groupChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/GroupChat; public static final fun groupContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/GroupContentMessage; public static final fun groupContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/GroupContentMessage; - public static final fun groupEventMessageOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/GroupEventMessage; + public static final fun groupEventMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/GroupEventMessage; public static final fun groupEventMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/GroupEventMessage; - public static final fun groupEventMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/GroupEventMessage; + public static final fun groupEventMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/GroupEventMessage; public static final fun groupEventMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/GroupEventMessage; public static final fun groupEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/GroupEvent; public static final fun groupEventOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/GroupEvent; @@ -1461,10 +1472,10 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun identityWithReverseSideSecureValueOrNull (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/IdentityWithReverseSideSecureValue; public static final fun identityWithReverseSideSecureValueOrThrow (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/IdentityWithReverseSideSecureValue; public static final fun ifAbleToAddInAttachmentMenuChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifAbstractMessageCallbackQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifAbstractMessageCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifAccessibleMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifAddressSecureValue (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifAdministratorChatMember (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifAdministratorChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifAds (Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifAnimatedSticker (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifAnimationContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1479,10 +1490,10 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifAudioMediaGroupPartContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifBankStatement (Ldev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifBankStatementSecureValue (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifBannedChatMember (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifBaseChosenInlineResult (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifBannedChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifBaseChosenInlineResult (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifBaseEditMessageUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifBaseInlineQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifBaseInlineQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifBaseMessageUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifBaseSentMessageUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifBasketballDiceAnimationType (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1495,7 +1506,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifBusinessChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifBusinessChatId (Ldev/inmo/tgbotapi/types/ChatIdentifier;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifBusinessConnectionUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifBusinessContentMessage (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifBusinessContentMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifBusinessContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifBusinessMessageUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifByAnonymous (Ldev/inmo/tgbotapi/types/message/ForwardInfo;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1505,11 +1516,12 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifByUser (Ldev/inmo/tgbotapi/types/message/ForwardInfo;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCallbackDataInlineKeyboardButton (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCallbackGameInlineKeyboardButton (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifCallbackQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCallbackQueryUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCashTagTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelChatCreated (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChannelContentMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChannelEventMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1521,14 +1533,14 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifChatEventMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChatId (Ldev/inmo/tgbotapi/types/ChatIdentifier;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChatIdWithThreadId (Ldev/inmo/tgbotapi/types/ChatIdentifier;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifChatInviteLink (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifChatInviteLinkUnlimited (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifChatInviteLinkWithJoinRequest (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifChatInviteLinkWithLimitedMembers (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifChatJoinRequest (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChatInviteLink (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChatInviteLinkUnlimited (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChatInviteLinkWithJoinRequest (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChatInviteLinkWithLimitedMembers (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChatJoinRequest (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChatJoinRequestUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifChatMember (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifChatMemberUpdated (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChatMemberUpdated (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChatMemberUpdatedUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChatMessageReactionUpdatedUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChatMessageReactionsCountUpdatedUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1538,7 +1550,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifChatSharedRequest (Ldev/inmo/tgbotapi/types/request/RequestResponse;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChatTheme (Ldev/inmo/tgbotapi/types/BackgroundType;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChooseStickerAction (Ldev/inmo/tgbotapi/types/actions/BotAction;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifChosenInlineResult (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifChosenInlineResult (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifChosenInlineResultUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifClaimed (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCodeTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1546,16 +1558,16 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifCommonBot (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCommonChatMemberUpdatedUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCommonEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifCommonForumContentMessage (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifCommonForumContentMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCommonForumContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifCommonGroupContentMessage (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifCommonGroupContentMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCommonGroupContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifCommonGroupEventMessage (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifCommonGroupEventMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCommonGroupEventMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCommonMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCommonPassport (Ldev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCommonPassportSecureValue (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifCommonSupergroupEventMessage (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifCommonSupergroupEventMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCommonSupergroupEventMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCommonUser (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifConnectedFromChannelGroupContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1574,7 +1586,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifCustomEmojiTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifCustomEmojiVideoSticker (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifDartsDiceAnimationType (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifDataCallbackQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifDataCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifDeleteChatPhoto (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifDeletedBusinessMessageUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifDescribedInlineQueryResult (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1641,11 +1653,11 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifFromChannelForumContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifFromChannelGroupContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifFromSupergroup (Ldev/inmo/tgbotapi/types/message/ForwardInfo;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifFromUser (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifFromUserMessage (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifFromUser (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifFromUserMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifFromUserMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifGameContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifGameShortNameCallbackQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifGameShortNameCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifGeneralForumTopicHidden (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifGeneralForumTopicUnhidden (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifGiftCode (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1659,7 +1671,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifGroupChatCreated (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifGroupContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifGroupEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifGroupEventMessage (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifGroupEventMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifGroupEventMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifHashTagTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifIdChatIdentifier (Ldev/inmo/tgbotapi/types/ChatIdentifier;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1667,15 +1679,15 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifIdentityCardSecureValue (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifIdentityWithReverseSideSecureValue (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifInaccessibleMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifInaccessibleMessageCallbackQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifInaccessibleMessageDataCallbackQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifInaccessibleMessageGameShortNameCallbackQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifInaccessibleMessageCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifInaccessibleMessageDataCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifInaccessibleMessageGameShortNameCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifIncoming (Ldev/inmo/tgbotapi/types/payments/stars/StarTransaction;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifInlineKeyboardMarkup (Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifInlineMessageIdCallbackQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifInlineMessageIdDataCallbackQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifInlineMessageIdGameShortNameCallbackQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifInlineQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifInlineMessageIdCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifInlineMessageIdDataCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifInlineMessageIdGameShortNameCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifInlineQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifInlineQueryResultArticle (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifInlineQueryResultAudio (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifInlineQueryResultAudioCached (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1715,15 +1727,15 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifInternalPassportSecureValue (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifInvoiceContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifItalicTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifKickedChatMember (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifLeftChatMember (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifLeftChatMemberEvent (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifKickedChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + 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 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 ifLocationChosenInlineResult (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifLocationChosenInlineResult (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifLocationContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifLocationInlineQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifLocationInlineQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifLoginURLInlineKeyboardButton (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifMask (Ldev/inmo/tgbotapi/requests/stickers/InputSticker;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifMaskAnimatedSticker (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1738,13 +1750,13 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifMediaGroupContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifMediaGroupMemberTelegramMedia (Ldev/inmo/tgbotapi/types/media/TelegramMedia;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifMediaGroupPartContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifMemberChatMember (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifMemberChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifMentionTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifMessageAutoDeleteTimerChanged (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifMessageCallbackQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifMessageCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifMessageContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifMessageDataCallbackQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifMessageGameShortNameCallbackQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifMessageDataCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifMessageGameShortNameCallbackQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifMessageUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifMigratedToSupergroup (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifMimedMediaFile (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1755,11 +1767,14 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifNewChatMembers (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifNewChatPhoto (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifNewChatTitle (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifOptionallyFromUser (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifOptionallyFromUserMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifOptionallyFromUserMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifOptionallyTitledInlineQueryResult (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifOther (Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifOtherDocumentsSecureValue (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifOutgoing (Ldev/inmo/tgbotapi/types/payments/stars/StarTransaction;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifOwnerChatMember (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifOwnerChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPaidMediaInfoContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPassport (Ldev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPassportElementErrorDataField (Ldev/inmo/tgbotapi/types/passport/PassportElementError;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1774,7 +1789,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifPassportElementFileError (Ldev/inmo/tgbotapi/types/passport/PassportElementError;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPassportElementFilesError (Ldev/inmo/tgbotapi/types/passport/PassportElementError;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPassportFile (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifPassportMessage (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifPassportMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPassportMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPassportMultipleElementsError (Ldev/inmo/tgbotapi/types/passport/PassportElementError;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPassportRegistration (Ldev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1793,7 +1808,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifPhotoSize (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPinnedMessage (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPlayableMediaFile (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifPollAnswer (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifPollAnswer (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPollAnswerUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPollContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPollUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1807,7 +1822,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifPossiblyTopicMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPossiblyWithEffectMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPotentiallyFromUserGroupContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifPreCheckoutQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifPreCheckoutQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPreCheckoutQueryUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPreTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPremium (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1823,9 +1838,9 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifPreviewSupergroupChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPreviewUser (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPreviewUsernameChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifPrimaryInviteLink (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifPrimaryInviteLink (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPrivateChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifPrivateContentMessage (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifPrivateContentMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPrivateContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPrivateEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPrivateEventMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1851,8 +1866,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifReplyForce (Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifReplyKeyboardMarkup (Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifReplyKeyboardRemove (Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifRestrictedChatMember (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifSecondaryChatInviteLink (Ldev/inmo/tgbotapi/abstracts/WithUser;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 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; public static final fun ifSecureValueWithFiles (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1860,7 +1875,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifSecureValueWithTranslations (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSendInvoice (Ldev/inmo/tgbotapi/abstracts/CommonSendInvoiceData;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSentByChannel (Ldev/inmo/tgbotapi/types/message/ForwardInfo;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifShippingQuery (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifShippingQuery (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifShippingQueryUpdate (Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSignedMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSimple (Ldev/inmo/tgbotapi/types/ReplyInfo;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1869,7 +1884,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifSizedTelegramMedia (Ldev/inmo/tgbotapi/types/media/TelegramMedia;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSlotMachineDiceAnimationType (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSolid (Ldev/inmo/tgbotapi/types/BackgroundFill;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifSpecialRightsChatMember (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifSpecialRightsChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSpoilerTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSpoilerableMediaContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSpoilerableTelegramMedia (Ldev/inmo/tgbotapi/types/media/TelegramMedia;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1880,13 +1895,14 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifStickerContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifStoryContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifStrikethroughTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifSubscriptionMemberChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSucceeded (Ldev/inmo/tgbotapi/types/payments/stars/RevenueWithdrawalState;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSuccessfulPaymentEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSuperPublicChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSupergroupChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSupergroupChatCreated (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSupergroupEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifSupergroupEventMessage (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifSupergroupEventMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSupergroupEventMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSwitchInlineQueryChosenChatInlineKeyboardButton (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifSwitchInlineQueryCurrentChatInlineKeyboardButton (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1931,7 +1947,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifUnknown (Ldev/inmo/tgbotapi/types/payments/stars/StarTransaction;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifUnknown (Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifUnknown (Ldev/inmo/tgbotapi/types/reactions/Reaction;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun ifUnknownCallbackQueryType (Ldev/inmo/tgbotapi/abstracts/WithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifUnknownCallbackQueryType (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifUnknownChatType (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifUnknownEncryptedPassportElement (Ldev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifUnknownExtendedChat (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -1983,27 +1999,28 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifWithDocument (Ldev/inmo/tgbotapi/types/BackgroundType;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifWithInputMessageContentInlineQueryResult (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifWithKeywords (Ldev/inmo/tgbotapi/requests/stickers/InputSticker;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifWithUser (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifWriteAccessAllowed (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public static final fun inaccessibleMessageCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InaccessibleMessageCallbackQuery; - public static final fun inaccessibleMessageCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InaccessibleMessageCallbackQuery; - public static final fun inaccessibleMessageDataCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InaccessibleMessageDataCallbackQuery; - public static final fun inaccessibleMessageDataCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InaccessibleMessageDataCallbackQuery; - public static final fun inaccessibleMessageGameShortNameCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InaccessibleMessageGameShortNameCallbackQuery; - public static final fun inaccessibleMessageGameShortNameCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InaccessibleMessageGameShortNameCallbackQuery; + public static final fun inaccessibleMessageCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InaccessibleMessageCallbackQuery; + public static final fun inaccessibleMessageCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InaccessibleMessageCallbackQuery; + public static final fun inaccessibleMessageDataCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InaccessibleMessageDataCallbackQuery; + public static final fun inaccessibleMessageDataCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InaccessibleMessageDataCallbackQuery; + public static final fun inaccessibleMessageGameShortNameCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InaccessibleMessageGameShortNameCallbackQuery; + public static final fun inaccessibleMessageGameShortNameCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InaccessibleMessageGameShortNameCallbackQuery; public static final fun inaccessibleMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/InaccessibleMessage; public static final fun inaccessibleMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/InaccessibleMessage; public static final fun incomingOrNull (Ldev/inmo/tgbotapi/types/payments/stars/StarTransaction;)Ldev/inmo/tgbotapi/types/payments/stars/StarTransaction$Incoming; public static final fun incomingOrThrow (Ldev/inmo/tgbotapi/types/payments/stars/StarTransaction;)Ldev/inmo/tgbotapi/types/payments/stars/StarTransaction$Incoming; public static final fun inlineKeyboardMarkupOrNull (Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup; public static final fun inlineKeyboardMarkupOrThrow (Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup; - public static final fun inlineMessageIdCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InlineMessageIdCallbackQuery; - public static final fun inlineMessageIdCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InlineMessageIdCallbackQuery; - public static final fun inlineMessageIdDataCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InlineMessageIdDataCallbackQuery; - public static final fun inlineMessageIdDataCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InlineMessageIdDataCallbackQuery; - public static final fun inlineMessageIdGameShortNameCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InlineMessageIdGameShortNameCallbackQuery; - public static final fun inlineMessageIdGameShortNameCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InlineMessageIdGameShortNameCallbackQuery; - public static final fun inlineQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/query/InlineQuery; - public static final fun inlineQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/query/InlineQuery; + public static final fun inlineMessageIdCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InlineMessageIdCallbackQuery; + public static final fun inlineMessageIdCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InlineMessageIdCallbackQuery; + public static final fun inlineMessageIdDataCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InlineMessageIdDataCallbackQuery; + public static final fun inlineMessageIdDataCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InlineMessageIdDataCallbackQuery; + public static final fun inlineMessageIdGameShortNameCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InlineMessageIdGameShortNameCallbackQuery; + public static final fun inlineMessageIdGameShortNameCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/InlineMessageIdGameShortNameCallbackQuery; + public static final fun inlineQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/query/InlineQuery; + public static final fun inlineQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/query/InlineQuery; public static final fun inlineQueryResultArticleOrNull (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;)Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultArticle; public static final fun inlineQueryResultArticleOrThrow (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;)Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultArticle; public static final fun inlineQueryResultAudioCachedOrNull (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;)Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCached; @@ -2082,24 +2099,24 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun invoiceContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/InvoiceContent; public static final fun italicTextSourceOrNull (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/ItalicTextSource; public static final fun italicTextSourceOrThrow (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/ItalicTextSource; - public static final fun kickedChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/KickedChatMember; - public static final fun kickedChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/KickedChatMember; - public static final fun leftChatMemberEventOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMemberEvent; + public static final fun kickedChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/KickedChatMember; + public static final fun kickedChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/KickedChatMember; + public static final fun leftChatMemberEventOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMemberEvent; public static final fun leftChatMemberEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMemberEvent; - public static final fun leftChatMemberEventOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMemberEvent; + public static final fun leftChatMemberEventOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/ChatEvents/LeftChatMemberEvent; 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/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/LeftChatMember; - public static final fun leftChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/LeftChatMember; + 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 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; public static final fun liveLocationOrThrow (Ldev/inmo/tgbotapi/types/location/Location;)Ldev/inmo/tgbotapi/types/location/LiveLocation; - public static final fun locationChosenInlineResultOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/LocationChosenInlineResult; - public static final fun locationChosenInlineResultOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/LocationChosenInlineResult; + public static final fun locationChosenInlineResultOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/LocationChosenInlineResult; + public static final fun locationChosenInlineResultOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/LocationChosenInlineResult; public static final fun locationContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/LocationContent; public static final fun locationContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/LocationContent; - public static final fun locationInlineQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/query/LocationInlineQuery; - public static final fun locationInlineQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/query/LocationInlineQuery; + public static final fun locationInlineQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/query/LocationInlineQuery; + public static final fun locationInlineQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/InlineQueries/query/LocationInlineQuery; public static final fun loginURLInlineKeyboardButtonOrNull (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/LoginURLInlineKeyboardButton; public static final fun loginURLInlineKeyboardButtonOrThrow (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/LoginURLInlineKeyboardButton; public static final fun maskAnimatedStickerOrNull (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;)Ldev/inmo/tgbotapi/types/files/MaskAnimatedSticker; @@ -2128,20 +2145,20 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun mediaGroupPartContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/MediaGroupPartContent; public static final fun mediaOrNull (Ldev/inmo/tgbotapi/types/ReplyInfo;)Ldev/inmo/tgbotapi/types/ReplyInfo$External$Content$Media; public static final fun mediaOrThrow (Ldev/inmo/tgbotapi/types/ReplyInfo;)Ldev/inmo/tgbotapi/types/ReplyInfo$External$Content$Media; - public static final fun memberChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/MemberChatMember; - public static final fun memberChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/MemberChatMember; + public static final fun memberChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/MemberChatMember; + public static final fun memberChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/MemberChatMember; public static final fun mentionTextSourceOrNull (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/MentionTextSource; public static final fun mentionTextSourceOrThrow (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/MentionTextSource; public static final fun messageAutoDeleteTimerChangedOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/MessageAutoDeleteTimerChanged; public static final fun messageAutoDeleteTimerChangedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/MessageAutoDeleteTimerChanged; - public static final fun messageCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/MessageCallbackQuery; - public static final fun messageCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/MessageCallbackQuery; + public static final fun messageCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/MessageCallbackQuery; + public static final fun messageCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/MessageCallbackQuery; public static final fun messageContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/MessageContent; public static final fun messageContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/MessageContent; - public static final fun messageDataCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/MessageDataCallbackQuery; - public static final fun messageDataCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/MessageDataCallbackQuery; - public static final fun messageGameShortNameCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/MessageGameShortNameCallbackQuery; - public static final fun messageGameShortNameCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/MessageGameShortNameCallbackQuery; + public static final fun messageDataCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/MessageDataCallbackQuery; + public static final fun messageDataCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/MessageDataCallbackQuery; + public static final fun messageGameShortNameCallbackQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/MessageGameShortNameCallbackQuery; + public static final fun messageGameShortNameCallbackQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/MessageGameShortNameCallbackQuery; public static final fun messageUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/MessageUpdate; public static final fun messageUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/MessageUpdate; public static final fun migratedToSupergroupOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/MigratedToSupergroup; @@ -2162,6 +2179,12 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun newChatPhotoOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/NewChatPhoto; public static final fun newChatTitleOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/NewChatTitle; public static final fun newChatTitleOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/NewChatTitle; + public static final fun optionallyFromUserMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/OptionallyFromUserMessage; + public static final fun optionallyFromUserMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/OptionallyFromUserMessage; + public static final fun optionallyFromUserMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/OptionallyFromUserMessage; + public static final fun optionallyFromUserMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/OptionallyFromUserMessage; + public static final fun optionallyFromUserOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/abstracts/OptionallyFromUser; + public static final fun optionallyFromUserOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/abstracts/OptionallyFromUser; public static final fun optionallyTitledInlineQueryResultOrNull (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;)Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/OptionallyTitledInlineQueryResult; public static final fun optionallyTitledInlineQueryResultOrThrow (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;)Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/OptionallyTitledInlineQueryResult; public static final fun otherDocumentsSecureValueOrNull (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/OtherDocumentsSecureValue; @@ -2170,8 +2193,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun otherOrThrow (Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner;)Ldev/inmo/tgbotapi/types/payments/stars/TransactionPartner$Other; public static final fun outgoingOrNull (Ldev/inmo/tgbotapi/types/payments/stars/StarTransaction;)Ldev/inmo/tgbotapi/types/payments/stars/StarTransaction$Outgoing; public static final fun outgoingOrThrow (Ldev/inmo/tgbotapi/types/payments/stars/StarTransaction;)Ldev/inmo/tgbotapi/types/payments/stars/StarTransaction$Outgoing; - public static final fun ownerChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/OwnerChatMember; - public static final fun ownerChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/OwnerChatMember; + public static final fun ownerChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/OwnerChatMember; + public static final fun ownerChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/OwnerChatMember; public static final fun paidMediaInfoContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/PaidMediaInfoContent; public static final fun paidMediaInfoContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/PaidMediaInfoContent; public static final fun passportElementErrorDataFieldOrNull (Ldev/inmo/tgbotapi/types/passport/PassportElementError;)Ldev/inmo/tgbotapi/types/passport/PassportElementErrorDataField; @@ -2198,9 +2221,9 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun passportElementFilesErrorOrThrow (Ldev/inmo/tgbotapi/types/passport/PassportElementError;)Ldev/inmo/tgbotapi/types/passport/PassportElementFilesError; public static final fun passportFileOrNull (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;)Ldev/inmo/tgbotapi/types/files/PassportFile; public static final fun passportFileOrThrow (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;)Ldev/inmo/tgbotapi/types/files/PassportFile; - public static final fun passportMessageOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/PassportMessage; + public static final fun passportMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/PassportMessage; public static final fun passportMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/PassportMessage; - public static final fun passportMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/PassportMessage; + public static final fun passportMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/PassportMessage; public static final fun passportMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/PassportMessage; public static final fun passportMultipleElementsErrorOrNull (Ldev/inmo/tgbotapi/types/passport/PassportElementError;)Ldev/inmo/tgbotapi/types/passport/PassportMultipleElementsError; public static final fun passportMultipleElementsErrorOrThrow (Ldev/inmo/tgbotapi/types/passport/PassportElementError;)Ldev/inmo/tgbotapi/types/passport/PassportMultipleElementsError; @@ -2238,8 +2261,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun pinnedMessageOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/PinnedMessage; public static final fun playableMediaFileOrNull (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;)Ldev/inmo/tgbotapi/types/files/PlayableMediaFile; public static final fun playableMediaFileOrThrow (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;)Ldev/inmo/tgbotapi/types/files/PlayableMediaFile; - public static final fun pollAnswerOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/polls/PollAnswer; - public static final fun pollAnswerOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/polls/PollAnswer; + public static final fun pollAnswerOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/polls/PollAnswer; + public static final fun pollAnswerOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/polls/PollAnswer; public static final fun pollAnswerUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/PollAnswerUpdate; public static final fun pollAnswerUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/PollAnswerUpdate; public static final fun pollContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/PollContent; @@ -2266,8 +2289,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun possiblyWithEffectMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/PossiblyWithEffectMessage; public static final fun potentiallyFromUserGroupContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/PotentiallyFromUserGroupContentMessage; public static final fun potentiallyFromUserGroupContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/PotentiallyFromUserGroupContentMessage; - public static final fun preCheckoutQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/payments/PreCheckoutQuery; - public static final fun preCheckoutQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/payments/PreCheckoutQuery; + public static final fun preCheckoutQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/payments/PreCheckoutQuery; + public static final fun preCheckoutQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/payments/PreCheckoutQuery; public static final fun preCheckoutQueryUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/PreCheckoutQueryUpdate; public static final fun preCheckoutQueryUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/PreCheckoutQueryUpdate; public static final fun preTextSourceOrNull (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/PreTextSource; @@ -2298,13 +2321,13 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun previewUserOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/PreviewUser; public static final fun previewUsernameChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/PreviewUsernameChat; public static final fun previewUsernameChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/PreviewUsernameChat; - public static final fun primaryInviteLinkOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/PrimaryInviteLink; - public static final fun primaryInviteLinkOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/PrimaryInviteLink; + public static final fun primaryInviteLinkOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/PrimaryInviteLink; + public static final fun primaryInviteLinkOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/PrimaryInviteLink; public static final fun privateChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/PrivateChat; public static final fun privateChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/PrivateChat; - public static final fun privateContentMessageOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/PrivateContentMessage; + public static final fun privateContentMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/PrivateContentMessage; public static final fun privateContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/PrivateContentMessage; - public static final fun privateContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/PrivateContentMessage; + public static final fun privateContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/PrivateContentMessage; public static final fun privateContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/PrivateContentMessage; public static final fun privateEventMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/PrivateEventMessage; public static final fun privateEventMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/PrivateEventMessage; @@ -2354,10 +2377,10 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun replyKeyboardMarkupOrThrow (Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup; public static final fun replyKeyboardRemoveOrNull (Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardRemove; public static final fun replyKeyboardRemoveOrThrow (Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardRemove; - public static final fun restrictedChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/RestrictedChatMember; - public static final fun restrictedChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/RestrictedChatMember; - public static final fun secondaryChatInviteLinkOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/SecondaryChatInviteLink; - public static final fun secondaryChatInviteLinkOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/SecondaryChatInviteLink; + public static final fun restrictedChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/RestrictedChatMember; + public static final fun restrictedChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/RestrictedChatMember; + 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; public static final fun secureValueIdentityOrThrow (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueIdentity; public static final fun secureValueWithDataOrNull (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValueWithData; @@ -2372,8 +2395,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun sendInvoiceOrThrow (Ldev/inmo/tgbotapi/abstracts/CommonSendInvoiceData;)Ldev/inmo/tgbotapi/requests/send/payments/SendInvoice; public static final fun sentByChannelOrNull (Ldev/inmo/tgbotapi/types/message/ForwardInfo;)Ldev/inmo/tgbotapi/types/message/ForwardInfo$PublicChat$SentByChannel; public static final fun sentByChannelOrThrow (Ldev/inmo/tgbotapi/types/message/ForwardInfo;)Ldev/inmo/tgbotapi/types/message/ForwardInfo$PublicChat$SentByChannel; - public static final fun shippingQueryOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/payments/ShippingQuery; - public static final fun shippingQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/payments/ShippingQuery; + public static final fun shippingQueryOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/payments/ShippingQuery; + public static final fun shippingQueryOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/payments/ShippingQuery; public static final fun shippingQueryUpdateOrNull (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/ShippingQueryUpdate; public static final fun shippingQueryUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/ShippingQueryUpdate; public static final fun signedMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/SignedMessage; @@ -2390,8 +2413,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun slotMachineDiceAnimationTypeOrThrow (Ldev/inmo/tgbotapi/types/dice/DiceAnimationType;)Ldev/inmo/tgbotapi/types/dice/SlotMachineDiceAnimationType; public static final fun solidOrNull (Ldev/inmo/tgbotapi/types/BackgroundFill;)Ldev/inmo/tgbotapi/types/BackgroundFill$Solid; public static final fun solidOrThrow (Ldev/inmo/tgbotapi/types/BackgroundFill;)Ldev/inmo/tgbotapi/types/BackgroundFill$Solid; - public static final fun specialRightsChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/SpecialRightsChatMember; - public static final fun specialRightsChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/chat/member/SpecialRightsChatMember; + public static final fun specialRightsChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/SpecialRightsChatMember; + public static final fun specialRightsChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/SpecialRightsChatMember; public static final fun spoilerTextSourceOrNull (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/SpoilerTextSource; public static final fun spoilerTextSourceOrThrow (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/SpoilerTextSource; public static final fun spoilerableMediaContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/SpoilerableMediaContent; @@ -2412,6 +2435,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun storyContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/StoryContent; public static final fun strikethroughTextSourceOrNull (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSource; public static final fun strikethroughTextSourceOrThrow (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSource; + public static final fun subscriptionMemberChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMember; + public static final fun subscriptionMemberChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/SubscriptionMemberChatMember; public static final fun succeededOrNull (Ldev/inmo/tgbotapi/types/payments/stars/RevenueWithdrawalState;)Ldev/inmo/tgbotapi/types/payments/stars/RevenueWithdrawalState$Succeeded; public static final fun succeededOrThrow (Ldev/inmo/tgbotapi/types/payments/stars/RevenueWithdrawalState;)Ldev/inmo/tgbotapi/types/payments/stars/RevenueWithdrawalState$Succeeded; public static final fun successfulPaymentEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/payments/SuccessfulPaymentEvent; @@ -2422,9 +2447,9 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun supergroupChatCreatedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/SupergroupChatCreated; public static final fun supergroupChatOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/SupergroupChat; public static final fun supergroupChatOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/SupergroupChat; - public static final fun supergroupEventMessageOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/SupergroupEventMessage; + public static final fun supergroupEventMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/SupergroupEventMessage; public static final fun supergroupEventMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/SupergroupEventMessage; - public static final fun supergroupEventMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/SupergroupEventMessage; + public static final fun supergroupEventMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/SupergroupEventMessage; public static final fun supergroupEventMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/SupergroupEventMessage; public static final fun supergroupEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/SupergroupEvent; public static final fun supergroupEventOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/SupergroupEvent; @@ -2496,8 +2521,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun unconnectedFromChannelGroupContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/UnconnectedFromChannelGroupContentMessage; public static final fun underlineTextSourceOrNull (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/UnderlineTextSource; public static final fun underlineTextSourceOrThrow (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/UnderlineTextSource; - public static final fun unknownCallbackQueryTypeOrNull (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/UnknownCallbackQueryType; - public static final fun unknownCallbackQueryTypeOrThrow (Ldev/inmo/tgbotapi/abstracts/WithUser;)Ldev/inmo/tgbotapi/types/queries/callback/UnknownCallbackQueryType; + public static final fun unknownCallbackQueryTypeOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/UnknownCallbackQueryType; + public static final fun unknownCallbackQueryTypeOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/queries/callback/UnknownCallbackQueryType; public static final fun unknownChatTypeOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/UnknownChatType; public static final fun unknownChatTypeOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/UnknownChatType; public static final fun unknownEncryptedPassportElementOrNull (Ldev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement;)Ldev/inmo/tgbotapi/types/passport/encrypted/abstracts/UnknownEncryptedPassportElement; @@ -2618,6 +2643,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun withInputMessageContentInlineQueryResultOrThrow (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;)Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/WithInputMessageContentInlineQueryResult; public static final fun withKeywordsOrNull (Ldev/inmo/tgbotapi/requests/stickers/InputSticker;)Ldev/inmo/tgbotapi/requests/stickers/InputSticker$WithKeywords; public static final fun withKeywordsOrThrow (Ldev/inmo/tgbotapi/requests/stickers/InputSticker;)Ldev/inmo/tgbotapi/requests/stickers/InputSticker$WithKeywords; + public static final fun withUserOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/abstracts/WithUser; + public static final fun withUserOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/abstracts/WithUser; public static final fun writeAccessAllowedOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/forum/WriteAccessAllowed; public static final fun writeAccessAllowedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/forum/WriteAccessAllowed; } @@ -2858,7 +2885,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/extensions/raw/MessageKt { public static final fun getProximity_alert_triggered (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/ChatEvents/ProximityAlertTriggered; public static final fun getReply_markup (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup; public static final fun getReply_to_message (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/Message; - public static final fun getSender_chat (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/chat/PublicChat; + public static final fun getSender_chat (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/chat/PreviewChat; public static final fun getSticker (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/files/Sticker; public static final fun getSuccessful_payment (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/payments/SuccessfulPayment; public static final fun getSupergroup_chat_created (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Z From 40d3388c74739f0fb2f82c66889df11dca2955a6 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 15 Aug 2024 00:29:53 +0600 Subject: [PATCH 13/19] one more jvmApiDump after ksp --- tgbotapi.utils/api/tgbotapi.utils.api | 3 +++ .../dev/inmo/tgbotapi/extensions/utils/ClassCastsNew.kt | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/tgbotapi.utils/api/tgbotapi.utils.api b/tgbotapi.utils/api/tgbotapi.utils.api index e04d16ffaa..26009da75a 100644 --- a/tgbotapi.utils/api/tgbotapi.utils.api +++ b/tgbotapi.utils/api/tgbotapi.utils.api @@ -1775,6 +1775,7 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ifOtherDocumentsSecureValue (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifOutgoing (Ldev/inmo/tgbotapi/types/payments/stars/StarTransaction;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifOwnerChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun ifPaid (Ldev/inmo/tgbotapi/types/reactions/Reaction;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPaidMediaInfoContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPassport (Ldev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun ifPassportElementErrorDataField (Ldev/inmo/tgbotapi/types/passport/PassportElementError;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -2197,6 +2198,8 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt { public static final fun ownerChatMemberOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/OwnerChatMember; public static final fun paidMediaInfoContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/PaidMediaInfoContent; public static final fun paidMediaInfoContentOrThrow (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/PaidMediaInfoContent; + public static final fun paidOrNull (Ldev/inmo/tgbotapi/types/reactions/Reaction;)Ldev/inmo/tgbotapi/types/reactions/Reaction$Paid; + public static final fun paidOrThrow (Ldev/inmo/tgbotapi/types/reactions/Reaction;)Ldev/inmo/tgbotapi/types/reactions/Reaction$Paid; public static final fun passportElementErrorDataFieldOrNull (Ldev/inmo/tgbotapi/types/passport/PassportElementError;)Ldev/inmo/tgbotapi/types/passport/PassportElementErrorDataField; public static final fun passportElementErrorDataFieldOrThrow (Ldev/inmo/tgbotapi/types/passport/PassportElementError;)Ldev/inmo/tgbotapi/types/passport/PassportElementErrorDataField; public static final fun passportElementErrorFileOrNull (Ldev/inmo/tgbotapi/types/passport/PassportElementError;)Ldev/inmo/tgbotapi/types/passport/PassportElementErrorFile; 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 3525e7e1a1..15f8028446 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 @@ -5408,6 +5408,14 @@ public inline fun Reaction.emojiOrThrow(): Reaction.Emoji = this as public inline fun Reaction.ifEmoji(block: (Reaction.Emoji) -> T): T? = emojiOrNull() ?.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 From 77158ffecf4047e0b60d4941b5cae1cc870dc2e9 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 15 Aug 2024 00:34:07 +0600 Subject: [PATCH 14/19] add note about send action dsl PR --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b499db4ff..ee162ce3c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 17.0.0 +* `API`: + * Change order of delay and sending action in [SendActionDSL](tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt) + (thanks to [DRSchlaubi](https://github.com/DRSchlaubi), [PR #833](https://github.com/InsanusMokrassar/ktgbotapi/pull/883)) + ## 16.0.0 **THIS UPDATE CONTAINS KOTLIN UPDATE UP TO 2.0** From a56ad7d67159f277b04a0958cf61b8dddbac4724 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 15 Aug 2024 00:36:11 +0600 Subject: [PATCH 15/19] make small improvement in send action dsl --- .../inmo/tgbotapi/extensions/api/send/SendActionDSL.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt index ee38522ff6..03550f4398 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt @@ -1,5 +1,7 @@ package dev.inmo.tgbotapi.extensions.api.send +import dev.inmo.micro_utils.coroutines.LinkedSupervisorScope +import dev.inmo.micro_utils.coroutines.runCatchingSafely import dev.inmo.micro_utils.coroutines.safelyWithResult import dev.inmo.micro_utils.coroutines.safelyWithoutExceptions import dev.inmo.tgbotapi.bot.TelegramBot @@ -22,7 +24,8 @@ public suspend fun TelegramBot.withAction( contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } - val botActionJob = CoroutineScope(currentCoroutineContext()).launch { + val actionScope = currentCoroutineContext().LinkedSupervisorScope(Job()) + actionScope.launch { while (isActive) { safelyWithoutExceptions { execute(actionRequest) @@ -30,8 +33,8 @@ public suspend fun TelegramBot.withAction( delay(refreshTime) } } - val result = safelyWithResult { block() } - botActionJob.cancel() + val result = runCatchingSafely { block() } + actionScope.cancel() return result.getOrThrow() } From c72f8e04ec43bf0813e4c3825ab81111793795a8 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 15 Aug 2024 00:58:12 +0600 Subject: [PATCH 16/19] fixes in send action dsl --- .../dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt index 03550f4398..793a221fc0 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt @@ -24,17 +24,17 @@ public suspend fun TelegramBot.withAction( contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } - val actionScope = currentCoroutineContext().LinkedSupervisorScope(Job()) + val actionScope = currentCoroutineContext().LinkedSupervisorScope() actionScope.launch { while (isActive) { - safelyWithoutExceptions { + runCatching { execute(actionRequest) } delay(refreshTime) } } val result = runCatchingSafely { block() } - actionScope.cancel() + actionScope.coroutineContext.job.cancel() return result.getOrThrow() } From 49031bf0e6a3cf1bd23645629dd999b0717e5ed4 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 15 Aug 2024 01:55:55 +0600 Subject: [PATCH 17/19] fixes and improvements --- tgbotapi.api/api/tgbotapi.api.api | 8 +++++ .../chat/invite_links/CreateChatInviteLink.kt | 35 ++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/tgbotapi.api/api/tgbotapi.api.api b/tgbotapi.api/api/tgbotapi.api.api index e3c574a413..08e0fc6f62 100644 --- a/tgbotapi.api/api/tgbotapi.api.api +++ b/tgbotapi.api/api/tgbotapi.api.api @@ -486,10 +486,18 @@ public final class dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChat public static final fun createChatInviteLinkWithLimitedMembers-R4jdXRs (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IDLjava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun createChatInviteLinkWithLimitedMembers-R4jdXRs$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IDLjava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun createChatInviteLinkWithLimitedMembers-R4jdXRs$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IDLjava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun createChatSubscriptionInviteLink-45ZY6uE (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun createChatSubscriptionInviteLink-45ZY6uE (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IJLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun createChatSubscriptionInviteLink-45ZY6uE$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun createChatSubscriptionInviteLink-45ZY6uE$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IJLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun createChatSubscriptionInviteLink-9yjpIiU (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;DLkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun createChatSubscriptionInviteLink-9yjpIiU (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IJLjava/lang/String;DLkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun createChatSubscriptionInviteLink-9yjpIiU$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;DLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun createChatSubscriptionInviteLink-9yjpIiU$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IJLjava/lang/String;DLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun createChatSubscriptionInviteLink-iadTtqY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;DLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun createChatSubscriptionInviteLink-iadTtqY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IJLjava/lang/String;DLkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun createChatSubscriptionInviteLink-iadTtqY$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;DLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static synthetic fun createChatSubscriptionInviteLink-iadTtqY$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IJLjava/lang/String;DLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun createChatSubscriptionInviteLink-u39P7bI (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun createChatSubscriptionInviteLink-u39P7bI (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/PublicChat;IJLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun createChatSubscriptionInviteLink-u39P7bI$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/ChatIdentifier;IJLjava/lang/String;Ldev/inmo/tgbotapi/types/TelegramDate;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChatInviteLink.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChatInviteLink.kt index b24ae9b25d..a765adaed4 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChatInviteLink.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/invite_links/CreateChatInviteLink.kt @@ -117,4 +117,37 @@ public suspend fun TelegramBot.createChatSubscriptionInviteLink( subscriptionPeriod: TimeSpan = 30.days, name: String? = null, expirationUnixTimeStamp: DateTime, -): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chat.id, subscriptionPrice, subscriptionPeriod, name, expirationUnixTimeStamp) \ No newline at end of file +): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chat.id, subscriptionPrice, subscriptionPeriod, name, expirationUnixTimeStamp) + + +public suspend fun TelegramBot.createChatSubscriptionInviteLink( + chatId: ChatIdentifier, + subscriptionPrice: Int, + subscriptionPeriod: TimeSpan = 30.days, + name: String? = null, + expirationUnixTimeStamp: TelegramDate? = null, +): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chatId, subscriptionPrice.toUInt(), subscriptionPeriod, name, expirationUnixTimeStamp) + +public suspend fun TelegramBot.createChatSubscriptionInviteLink( + chat: PublicChat, + subscriptionPrice: Int, + subscriptionPeriod: TimeSpan = 30.days, + name: String? = null, + expirationUnixTimeStamp: TelegramDate? = null, +): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chat, subscriptionPrice.toUInt(), subscriptionPeriod, name, expirationUnixTimeStamp) + +public suspend fun TelegramBot.createChatSubscriptionInviteLink( + chatId: ChatIdentifier, + subscriptionPrice: Int, + subscriptionPeriod: TimeSpan = 30.days, + name: String? = null, + expirationUnixTimeStamp: DateTime, +): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chatId, subscriptionPrice.toUInt(), subscriptionPeriod, name, expirationUnixTimeStamp) + +public suspend fun TelegramBot.createChatSubscriptionInviteLink( + chat: PublicChat, + subscriptionPrice: Int, + subscriptionPeriod: TimeSpan = 30.days, + name: String? = null, + expirationUnixTimeStamp: DateTime, +): ChatInviteLinkUnlimited = createChatSubscriptionInviteLink(chat, subscriptionPrice.toUInt(), subscriptionPeriod, name, expirationUnixTimeStamp) From 8823b268ccea862c3df825bc24a91120e284d211 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 15 Aug 2024 02:12:45 +0600 Subject: [PATCH 18/19] small fixes in docs --- .../kotlin/dev/inmo/tgbotapi/abstracts/FromUser.kt | 4 ++-- .../kotlin/dev/inmo/tgbotapi/abstracts/WithUser.kt | 6 +++--- .../requests/chat/invite_links/CreateChatInviteLink.kt | 4 +--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/FromUser.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/FromUser.kt index 6bdb6dcde8..bf5db02eeb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/FromUser.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/FromUser.kt @@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.abstracts import dev.inmo.tgbotapi.types.chat.User /** - * Inheritors of this interface have some [User] as a source of data. For example, any [dev.inmo.tgbotapi.types.queries.callback.CallbackQuery] + * Inheritors of this interface **may** have some [User] as a source of data. For example, any [dev.inmo.tgbotapi.types.queries.callback.CallbackQuery] * have [User] as the source of that query */ interface OptionallyFromUser : OptionallyWithUser { @@ -15,7 +15,7 @@ interface OptionallyFromUser : OptionallyWithUser { get() = from } /** - * Inheritors of this interface have some [User] as a source of data. For example, any [dev.inmo.tgbotapi.types.queries.callback.CallbackQuery] + * Inheritors of this interface **must** have some [User] as a source of data. For example, any [dev.inmo.tgbotapi.types.queries.callback.CallbackQuery] * have [User] as the source of that query */ interface FromUser : OptionallyFromUser, WithUser { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/WithUser.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/WithUser.kt index ab84ded0f1..b629ad4764 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/WithUser.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/WithUser.kt @@ -4,16 +4,16 @@ import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded import dev.inmo.tgbotapi.types.chat.User /** - * All inheritors of this type have [User] in their data as one of the main data + * All inheritors of this type **may** have [User] in their data as one of the main data * - * @see FromUser + * @see OptionallyFromUser */ @ClassCastsIncluded(excludeRegex = ".*Impl") interface OptionallyWithUser { val user: User? } /** - * All inheritors of this type have [User] in their data as one of the main data + * All inheritors of this type **must** have [User] in their data as one of the main data * * @see FromUser */ diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink.kt index 84619cb79a..d49a98df05 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/invite_links/CreateChatInviteLink.kt @@ -91,9 +91,7 @@ data class CreateChatInviteLinkUnlimited( /** * Represent [request](https://core.telegram.org/bots/api#createchatsubscriptioninvitelink) * - * @see CreateChatInviteLink.unlimited - * @see CreateChatInviteLinkWithLimitedMembers - * @see CreateChatInviteLinkWithJoinRequest + * @see CreateChatInviteLink.subscription */ @Serializable data class CreateChatSubscriptionInviteLink( From c8d6b759b7cf8ede1dd409e385521d343ac55e5d Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 15 Aug 2024 02:41:12 +0600 Subject: [PATCH 19/19] filling of changelog and making Reaction.Paid to be an object --- CHANGELOG.md | 16 +++++++++++++++- README.md | 2 +- tgbotapi.core/api/tgbotapi.core.api | 10 ++++------ .../inmo/tgbotapi/types/reactions/Reaction.kt | 9 +++------ 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee162ce3c4..7ac6e0f1f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,23 @@ ## 17.0.0 +**THIS UPDATE CONTAINS SUPPORT OF BOTS API 7.9** + +* Add support of subscriptions links handling +* Add support of info about sender chat. **It is important, that for channels will be actual `senderChat` instead of +`from` field due to `User` type of the last one**. You also may use extensions `Message.sender_chat` or `Any.withSenderChatMessageOrNull` +to access sender chat +* Add `Reaction.Paid` + +Additional changes: + +* `Core`: + * Add top level interfaces `OptionallyWithUser` and `OptionallyFromUser`. Old `WithUser` and `FromUser` interfaces + extending them with following overrides of `user` and `from` fields * `API`: * Change order of delay and sending action in [SendActionDSL](tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendActionDSL.kt) - (thanks to [DRSchlaubi](https://github.com/DRSchlaubi), [PR #833](https://github.com/InsanusMokrassar/ktgbotapi/pull/883)) + (thanks to [DRSchlaubi](https://github.com/DRSchlaubi), [PR #833](https://github.com/InsanusMokrassar/ktgbotapi/pull/883)). + Besides, there has been changed way to create parallel sending of action and it must not lead to memory leaks anymore ## 16.0.0 diff --git a/README.md b/README.md index 5ee6e4837c..711fce10ff 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-7.8-blue)](https://core.telegram.org/bots/api-changelog#july-31-2024) +# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-7.9-blue)](https://core.telegram.org/bots/api-changelog#august-14-2024) | 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) | |:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index fcb683fe34..7f0653eafb 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -25224,14 +25224,12 @@ public final class dev/inmo/tgbotapi/types/reactions/Reaction$Emoji$Companion { } public final class dev/inmo/tgbotapi/types/reactions/Reaction$Paid : dev/inmo/tgbotapi/types/reactions/Reaction { - public static final field Companion Ldev/inmo/tgbotapi/types/reactions/Reaction$Paid$Companion; - public static final field type Ljava/lang/String; - public fun ()V + public static final field INSTANCE Ldev/inmo/tgbotapi/types/reactions/Reaction$Paid; + public fun equals (Ljava/lang/Object;)Z public fun getType ()Ljava/lang/String; -} - -public final class dev/inmo/tgbotapi/types/reactions/Reaction$Paid$Companion { + public fun hashCode ()I public final fun serializer ()Lkotlinx/serialization/KSerializer; + public fun toString ()Ljava/lang/String; } public final class dev/inmo/tgbotapi/types/reactions/Reaction$Unknown : dev/inmo/tgbotapi/types/reactions/Reaction { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/reactions/Reaction.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/reactions/Reaction.kt index 3ceb370dd5..c1057d8447 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/reactions/Reaction.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/reactions/Reaction.kt @@ -44,12 +44,9 @@ sealed interface Reaction { } @Serializable(Reaction.Companion::class) - class Paid : Reaction { + data object Paid : Reaction { override val type: String - get() = Companion.type - companion object { - const val type: String = "paid" - } + get() = "paid" } @Serializable(Reaction.Companion::class) @@ -82,7 +79,7 @@ sealed interface Reaction { return when { surrogate.emoji != null -> Emoji(surrogate.emoji) surrogate.customEmojiId != null -> CustomEmoji(surrogate.customEmojiId) - surrogate.type == Paid.type -> Paid() + surrogate.type == Paid.type -> Paid else -> Unknown(surrogate.type, json) } }