1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-05-30 12:17:21 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
renovate[bot]
8314b401d0 Update kotlin to v2.3.21 2026-04-23 09:10:55 +00:00
9 changed files with 17 additions and 256 deletions

View File

@@ -1,7 +1,5 @@
# TelegramBotAPI changelog
## 33.2.0
## 33.1.0
* `Versions`:

View File

@@ -6,4 +6,4 @@ kotlin.incremental=true
kotlin.incremental.js=true
library_group=dev.inmo
library_version=33.2.0
library_version=33.1.0

View File

@@ -1,6 +1,6 @@
[versions]
kotlin = "2.3.20"
kotlin = "2.3.21"
kotlin-serialization = "1.11.0"
kotlin-coroutines = "1.10.2"

View File

@@ -275,42 +275,16 @@ public final class dev/inmo/tgbotapi/bot/RequestsExecutor$DefaultImpls {
public static fun getLog (Ldev/inmo/tgbotapi/bot/RequestsExecutor;)Ldev/inmo/kslog/common/KSLog;
}
public final class dev/inmo/tgbotapi/bot/exceptions/ApiException : dev/inmo/tgbotapi/bot/exceptions/CommonBotException {
public fun <init> (Ljava/lang/Integer;Ljava/lang/String;Ldev/inmo/tgbotapi/types/Response;)V
public synthetic fun <init> (Ljava/lang/Integer;Ljava/lang/String;Ldev/inmo/tgbotapi/types/Response;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun createCopy ()Ldev/inmo/tgbotapi/bot/exceptions/ApiException;
public synthetic fun createCopy ()Ldev/inmo/tgbotapi/bot/exceptions/CommonBotException;
public synthetic fun createCopy ()Ljava/lang/Throwable;
public final fun getHttpResponseCode ()Ljava/lang/Integer;
public final fun getPlainResponse ()Ljava/lang/String;
}
public abstract class dev/inmo/tgbotapi/bot/exceptions/BotException : java/io/IOException, kotlinx/coroutines/CopyableThrowable {
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/Throwable;Ldev/inmo/tgbotapi/types/Response;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/Throwable;Ldev/inmo/tgbotapi/types/Response;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun getMessage ()Ljava/lang/String;
public fun getPlainAnswer ()Ljava/lang/String;
public fun getResponse ()Ldev/inmo/tgbotapi/types/Response;
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/Throwable;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/Throwable;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
}
public abstract class dev/inmo/tgbotapi/bot/exceptions/CommonBotException : dev/inmo/tgbotapi/bot/exceptions/BotException {
public static final field Companion Ldev/inmo/tgbotapi/bot/exceptions/CommonBotException$Companion;
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/Throwable;Ldev/inmo/tgbotapi/types/Response;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/Throwable;Ldev/inmo/tgbotapi/types/Response;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public abstract fun createCopy ()Ldev/inmo/tgbotapi/bot/exceptions/CommonBotException;
}
public final class dev/inmo/tgbotapi/bot/exceptions/CommonBotException$Companion {
public final fun invoke (Ljava/lang/String;Ljava/lang/Throwable;)Ldev/inmo/tgbotapi/bot/exceptions/CommonBotException$Default;
public static synthetic fun invoke$default (Ldev/inmo/tgbotapi/bot/exceptions/CommonBotException$Companion;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)Ldev/inmo/tgbotapi/bot/exceptions/CommonBotException$Default;
}
public final class dev/inmo/tgbotapi/bot/exceptions/CommonBotException$Default : dev/inmo/tgbotapi/bot/exceptions/CommonBotException {
public final class dev/inmo/tgbotapi/bot/exceptions/CommonBotException : dev/inmo/tgbotapi/bot/exceptions/BotException {
public fun <init> ()V
public fun <init> (Ljava/lang/String;Ljava/lang/Throwable;)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/Throwable;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun createCopy ()Ldev/inmo/tgbotapi/bot/exceptions/CommonBotException$Default;
public synthetic fun createCopy ()Ldev/inmo/tgbotapi/bot/exceptions/CommonBotException;
public fun createCopy ()Ldev/inmo/tgbotapi/bot/exceptions/BotException;
public synthetic fun createCopy ()Ljava/lang/Throwable;
}
@@ -353,13 +327,13 @@ public final class dev/inmo/tgbotapi/bot/exceptions/ReplyMessageNotFoundExceptio
public abstract class dev/inmo/tgbotapi/bot/exceptions/RequestException : dev/inmo/tgbotapi/bot/exceptions/BotException {
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/Response;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/Response;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun getPlainAnswer ()Ljava/lang/String;
public fun getResponse ()Ldev/inmo/tgbotapi/types/Response;
public final fun getPlainAnswer ()Ljava/lang/String;
public final fun getResponse ()Ldev/inmo/tgbotapi/types/Response;
}
public final class dev/inmo/tgbotapi/bot/exceptions/RequestExceptionKt {
public static final fun newRequestException (Ldev/inmo/tgbotapi/types/Response;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)Ldev/inmo/tgbotapi/bot/exceptions/BotException;
public static synthetic fun newRequestException$default (Ldev/inmo/tgbotapi/types/Response;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)Ldev/inmo/tgbotapi/bot/exceptions/BotException;
public static final fun newRequestException (Ldev/inmo/tgbotapi/types/Response;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)Ldev/inmo/tgbotapi/bot/exceptions/RequestException;
public static synthetic fun newRequestException$default (Ldev/inmo/tgbotapi/types/Response;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)Ldev/inmo/tgbotapi/bot/exceptions/RequestException;
}
public final class dev/inmo/tgbotapi/bot/exceptions/TooMuchRequestsException : dev/inmo/tgbotapi/bot/exceptions/RequestException {

View File

@@ -5,7 +5,6 @@ package dev.inmo.tgbotapi.bot.exceptions
import korlibs.time.DateTime
import dev.inmo.tgbotapi.types.Response
import dev.inmo.tgbotapi.types.RetryAfterError
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
import kotlinx.coroutines.CopyableThrowable
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.io.IOException
@@ -23,7 +22,7 @@ fun newRequestException(
description == "Unauthorized" -> UnauthorizedException(response, plainAnswer, message, cause)
description.contains("PHOTO_INVALID_DIMENSIONS") -> InvalidPhotoDimensionsException(response, plainAnswer, message, cause)
description.contains("wrong file identifier") -> WrongFileIdentifierException(response, plainAnswer, message, cause)
description.contains("Too Many Requests", ignoreCase = true) -> TooMuchRequestsException(
description.contains("Too Many Requests") -> TooMuchRequestsException(
(response.parameters ?.error as? RetryAfterError) ?: RetryAfterError(60, DateTime.now().unixMillisLong),
response,
plainAnswer,
@@ -36,51 +35,19 @@ fun newRequestException(
message,
cause
)
response.errorCode != null -> ApiException(
response.errorCode,
plainAnswer,
response
)
else -> null
}
} ?: CommonRequestException(response, plainAnswer, message, cause)
@ClassCastsIncluded
sealed class BotException(
override val message: String = "Something went wrong",
cause: Throwable? = null,
open val response: Response? = null,
open val plainAnswer: String? = null,
) : IOException(message, cause), CopyableThrowable<BotException>
sealed class BotException(message: String = "Something went wrong", cause: Throwable? = null) : IOException(message, cause), CopyableThrowable<BotException>
sealed class CommonBotException(
message: String = "Something went wrong",
cause: Throwable? = null,
response: Response? = null,
plainAnswer: String? = null,
) : BotException(message, cause, response, plainAnswer) {
class Default(message: String = "Something went wrong", cause: Throwable? = null) : CommonBotException(message, cause) {
override fun createCopy(): Default = Default(message, cause)
}
abstract override fun createCopy(): CommonBotException?
companion object {
operator fun invoke(message: String = "Something went wrong", cause: Throwable? = null) = Default(message, cause)
}
}
class ApiException(
val httpResponseCode: Int?,
val plainResponse: String,
response: Response? = null,
) :
CommonBotException("$httpResponseCode: $plainResponse", null, response, plainResponse) {
override fun createCopy(): ApiException = ApiException(httpResponseCode, plainResponse, response)
class CommonBotException(message: String = "Something went wrong", cause: Throwable? = null) : BotException(message, cause) {
override fun createCopy(): BotException = CommonBotException(message!!, cause)
}
sealed class RequestException (
override val response: Response,
override val plainAnswer: String,
val response: Response,
val plainAnswer: String,
message: String? = null,
cause: Throwable? = null
) : BotException(

View File

@@ -3,7 +3,6 @@ package dev.inmo.tgbotapi.bot.ktor.base
import dev.inmo.kslog.common.*
import dev.inmo.micro_utils.coroutines.runCatchingLogging
import dev.inmo.tgbotapi.bot.BaseRequestsExecutor
import dev.inmo.tgbotapi.bot.exceptions.ApiException
import dev.inmo.tgbotapi.bot.exceptions.BotException
import dev.inmo.tgbotapi.bot.exceptions.CommonBotException
import dev.inmo.tgbotapi.bot.exceptions.GetUpdatesConflict
@@ -99,15 +98,7 @@ class DefaultKtorRequestsExecutor internal constructor(
)
}
exceptionResult.exceptionOrNull() ?.let {
val prehandledException = runCatching {
when {
it is ResponseException -> ApiException(it.response.status.value, it.response.bodyAsText())
else -> null
}
}.getOrElse {
null
}
prehandledException ?: CommonBotException(cause = e)
CommonBotException(cause = e)
} ?: exceptionResult.getOrThrow()
}
is CancellationException,

View File

@@ -1,39 +0,0 @@
package dev.inmo.tgbotapi.bot.exceptions
import dev.inmo.tgbotapi.types.Response
import kotlin.test.Test
import kotlin.test.assertIs
/**
* Regression tests for https://github.com/InsanusMokrassar/TelegramBotAPI/issues/1008 —
* Telegram's "Too Many Requests" response is case-inconsistent (both
* `Too Many Requests` and `too Many Requests` have been observed), so the
* description match must be case-insensitive.
*/
class NewRequestExceptionTests {
private fun buildException(description: String) = newRequestException(
response = Response(ok = false, description = description, errorCode = 429),
plainAnswer = "{\"ok\":false}"
)
@Test
fun tooMuchRequestsExceptionIsCreatedForCanonicalCasing() {
assertIs<TooMuchRequestsException>(
buildException("Bad Request: Too Many Requests: retry after 8")
)
}
@Test
fun tooMuchRequestsExceptionIsCreatedForLowercaseFirstLetterCasing() {
assertIs<TooMuchRequestsException>(
buildException("Bad Request: too Many Requests: retry after 8")
)
}
@Test
fun tooMuchRequestsExceptionIsCreatedForAllLowercaseCasing() {
assertIs<TooMuchRequestsException>(
buildException("Bad Request: too many requests: retry after 8")
)
}
}

View File

@@ -1094,8 +1094,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun anonymousGroupContentMessageOrThrow (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/AnonymousGroupContentMessage;
public static final fun anyOrNull (Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestUsers;)Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestUsers$Any;
public static final fun anyOrThrow (Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestUsers;)Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestUsers$Any;
public static final fun apiExceptionOrNull (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/ApiException;
public static final fun apiExceptionOrThrow (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/ApiException;
public static final fun approximateScheduledCloseInfoOrNull (Ldev/inmo/tgbotapi/types/polls/ScheduledCloseInfo;)Ldev/inmo/tgbotapi/types/polls/ApproximateScheduledCloseInfo;
public static final fun approximateScheduledCloseInfoOrThrow (Ldev/inmo/tgbotapi/types/polls/ScheduledCloseInfo;)Ldev/inmo/tgbotapi/types/polls/ApproximateScheduledCloseInfo;
public static final fun audioContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/AudioContent;
@@ -1262,10 +1260,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun chosenInlineResultUpdateOrThrow (Ldev/inmo/tgbotapi/types/update/abstracts/Update;)Ldev/inmo/tgbotapi/types/update/ChosenInlineResultUpdate;
public static final fun codeTextSourceOrNull (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/CodeTextSource;
public static final fun codeTextSourceOrThrow (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/CodeTextSource;
public static final fun commonBotExceptionDefaultOrNull (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/CommonBotException$Default;
public static final fun commonBotExceptionDefaultOrThrow (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/CommonBotException$Default;
public static final fun commonBotExceptionOrNull (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/CommonBotException;
public static final fun commonBotExceptionOrThrow (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/CommonBotException;
public static final fun commonBotOrNull (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/CommonBot;
public static final fun commonBotOrThrow (Ldev/inmo/tgbotapi/types/chat/Chat;)Ldev/inmo/tgbotapi/types/chat/CommonBot;
public static final fun commonChannelDirectMessagesContentMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonChannelDirectMessagesContentMessage;
@@ -1300,8 +1294,6 @@ 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 commonRequestExceptionOrNull (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/CommonRequestException;
public static final fun commonRequestExceptionOrThrow (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/CommonRequestException;
public static final fun commonSuggestedChannelDirectMessagesContentMessageOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonSuggestedChannelDirectMessagesContentMessage;
public static final fun commonSuggestedChannelDirectMessagesContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonSuggestedChannelDirectMessagesContentMessage;
public static final fun commonSuggestedChannelDirectMessagesContentMessageOrThrow (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/message/abstracts/CommonSuggestedChannelDirectMessagesContentMessage;
@@ -1524,8 +1516,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
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;
public static final fun generalForumTopicUnhiddenOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/forum/GeneralForumTopicUnhidden;
public static final fun getUpdatesConflictOrNull (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/GetUpdatesConflict;
public static final fun getUpdatesConflictOrThrow (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/GetUpdatesConflict;
public static final fun giftCodeOrNull (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;)Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$GiftCode;
public static final fun giftCodeOrThrow (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;)Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource$GiftCode;
public static final fun giftSentOrReceivedEventOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/gifts/GiftSentOrReceivedEvent;
@@ -1602,7 +1592,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun ifAnonymousForumContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifAnonymousGroupContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifAny (Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestUsers;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifApiException (Ldev/inmo/tgbotapi/bot/exceptions/BotException;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifApproximateScheduledCloseInfo (Ldev/inmo/tgbotapi/types/polls/ScheduledCloseInfo;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifAudioContent (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifAudioFile (Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
@@ -1688,8 +1677,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun ifCodeTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCommon (Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestUsers;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCommonBot (Ldev/inmo/tgbotapi/types/chat/Chat;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCommonBotException (Ldev/inmo/tgbotapi/bot/exceptions/BotException;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCommonBotExceptionDefault (Ldev/inmo/tgbotapi/bot/exceptions/BotException;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCommonChannelDirectMessagesContentMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCommonChannelDirectMessagesContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCommonChannelDirectMessagesEventMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
@@ -1705,7 +1692,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
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 ifCommonRequestException (Ldev/inmo/tgbotapi/bot/exceptions/BotException;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCommonSuggestedChannelDirectMessagesContentMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCommonSuggestedChannelDirectMessagesContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifCommonSupergroupEventMessage (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
@@ -1817,7 +1803,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
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 ifGetUpdatesConflict (Ldev/inmo/tgbotapi/bot/exceptions/BotException;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifGiftCode (Ldev/inmo/tgbotapi/types/boosts/ChatBoostSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifGiftSentOrReceivedEvent (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifGiftSentOrReceivedEventReceivedInBusinessAccount (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
@@ -1896,7 +1881,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun ifInternal (Ldev/inmo/tgbotapi/types/ReplyInfo;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifInternalPassport (Ldev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifInternalPassportSecureValue (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifInvalidPhotoDimensionsException (Ldev/inmo/tgbotapi/bot/exceptions/BotException;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/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
@@ -1930,8 +1914,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
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/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 ifMessageIsNotModifiedException (Ldev/inmo/tgbotapi/bot/exceptions/BotException;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifMessageToEditNotFoundException (Ldev/inmo/tgbotapi/bot/exceptions/BotException;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;
@@ -2055,8 +2037,6 @@ 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 ifReplyMessageNotFoundException (Ldev/inmo/tgbotapi/bot/exceptions/BotException;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifRequestException (Ldev/inmo/tgbotapi/bot/exceptions/BotException;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifRestrictedChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifRestrictedMemberChatMember (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifSecondaryChatInviteLink (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
@@ -2133,11 +2113,9 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun ifTitledInlineQueryResult (Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifTitledTelegramMedia (Ldev/inmo/tgbotapi/types/media/TelegramMedia;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifToStory (Ldev/inmo/tgbotapi/types/ReplyInfo;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifTooMuchRequestsException (Ldev/inmo/tgbotapi/bot/exceptions/BotException;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifTypingAction (Ldev/inmo/tgbotapi/types/actions/BotAction;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifURLInlineKeyboardButton (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifURLTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifUnauthorizedException (Ldev/inmo/tgbotapi/bot/exceptions/BotException;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifUnconnectedFromChannelGroupContentMessage (Ldev/inmo/tgbotapi/types/message/abstracts/Message;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifUnderlineTextSource (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifUnknown (Ldev/inmo/tgbotapi/requests/answers/InlineQueryResultsButton;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
@@ -2211,7 +2189,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun ifWriteAccessAllowedFromRequest (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifWriteAccessAllowedFromWebAppLink (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifWriteAccessAllowedOther (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun ifWrongFileIdentifierException (Ldev/inmo/tgbotapi/bot/exceptions/BotException;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
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;
@@ -2306,8 +2283,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun internalPassportOrThrow (Ldev/inmo/tgbotapi/types/passport/encrypted/abstracts/EncryptedPassportElement;)Ldev/inmo/tgbotapi/types/passport/encrypted/InternalPassport;
public static final fun internalPassportSecureValueOrNull (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/InternalPassportSecureValue;
public static final fun internalPassportSecureValueOrThrow (Ldev/inmo/tgbotapi/types/passport/decrypted/abstracts/SecureValue;)Ldev/inmo/tgbotapi/types/passport/decrypted/InternalPassportSecureValue;
public static final fun invalidPhotoDimensionsExceptionOrNull (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/InvalidPhotoDimensionsException;
public static final fun invalidPhotoDimensionsExceptionOrThrow (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/InvalidPhotoDimensionsException;
public static final fun invoiceContentOrNull (Ldev/inmo/tgbotapi/types/message/content/ResendableContent;)Ldev/inmo/tgbotapi/types/message/content/InvoiceContent;
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;
@@ -2374,10 +2349,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
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 messageIsNotModifiedExceptionOrNull (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/MessageIsNotModifiedException;
public static final fun messageIsNotModifiedExceptionOrThrow (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/MessageIsNotModifiedException;
public static final fun messageToEditNotFoundExceptionOrNull (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/MessageToEditNotFoundException;
public static final fun messageToEditNotFoundExceptionOrThrow (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/MessageToEditNotFoundException;
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;
@@ -2624,10 +2595,6 @@ 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 replyMessageNotFoundExceptionOrNull (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/ReplyMessageNotFoundException;
public static final fun replyMessageNotFoundExceptionOrThrow (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/ReplyMessageNotFoundException;
public static final fun requestExceptionOrNull (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/RequestException;
public static final fun requestExceptionOrThrow (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/RequestException;
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 restrictedMemberChatMemberOrNull (Ldev/inmo/tgbotapi/abstracts/OptionallyWithUser;)Ldev/inmo/tgbotapi/types/chat/member/RestrictedMemberChatMember;
@@ -2780,16 +2747,12 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun titledTelegramMediaOrThrow (Ldev/inmo/tgbotapi/types/media/TelegramMedia;)Ldev/inmo/tgbotapi/types/media/TitledTelegramMedia;
public static final fun toStoryOrNull (Ldev/inmo/tgbotapi/types/ReplyInfo;)Ldev/inmo/tgbotapi/types/ReplyInfo$ToStory;
public static final fun toStoryOrThrow (Ldev/inmo/tgbotapi/types/ReplyInfo;)Ldev/inmo/tgbotapi/types/ReplyInfo$ToStory;
public static final fun tooMuchRequestsExceptionOrNull (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/TooMuchRequestsException;
public static final fun tooMuchRequestsExceptionOrThrow (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/TooMuchRequestsException;
public static final fun typingActionOrNull (Ldev/inmo/tgbotapi/types/actions/BotAction;)Ldev/inmo/tgbotapi/types/actions/TypingAction;
public static final fun typingActionOrThrow (Ldev/inmo/tgbotapi/types/actions/BotAction;)Ldev/inmo/tgbotapi/types/actions/TypingAction;
public static final fun uRLInlineKeyboardButtonOrNull (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/URLInlineKeyboardButton;
public static final fun uRLInlineKeyboardButtonOrThrow (Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton;)Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/URLInlineKeyboardButton;
public static final fun uRLTextSourceOrNull (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/URLTextSource;
public static final fun uRLTextSourceOrThrow (Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/URLTextSource;
public static final fun unauthorizedExceptionOrNull (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/UnauthorizedException;
public static final fun unauthorizedExceptionOrThrow (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/UnauthorizedException;
public static final fun unconnectedFromChannelGroupContentMessageOrNull (Ldev/inmo/tgbotapi/types/message/abstracts/Message;)Ldev/inmo/tgbotapi/types/message/abstracts/UnconnectedFromChannelGroupContentMessage;
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;
@@ -2936,8 +2899,6 @@ public final class dev/inmo/tgbotapi/extensions/utils/ClassCastsNewKt {
public static final fun writeAccessAllowedOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/forum/WriteAccessAllowed;
public static final fun writeAccessAllowedOtherOrNull (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/forum/WriteAccessAllowed$Other;
public static final fun writeAccessAllowedOtherOrThrow (Ldev/inmo/tgbotapi/types/message/ChatEvents/abstracts/ChatEvent;)Ldev/inmo/tgbotapi/types/message/ChatEvents/forum/WriteAccessAllowed$Other;
public static final fun wrongFileIdentifierExceptionOrNull (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/WrongFileIdentifierException;
public static final fun wrongFileIdentifierExceptionOrThrow (Ldev/inmo/tgbotapi/bot/exceptions/BotException;)Ldev/inmo/tgbotapi/bot/exceptions/WrongFileIdentifierException;
}
public final class dev/inmo/tgbotapi/extensions/utils/CommonMessageConversationsKt {

View File

@@ -14,19 +14,6 @@ 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.bot.exceptions.ApiException
import dev.inmo.tgbotapi.bot.exceptions.BotException
import dev.inmo.tgbotapi.bot.exceptions.CommonBotException
import dev.inmo.tgbotapi.bot.exceptions.CommonRequestException
import dev.inmo.tgbotapi.bot.exceptions.GetUpdatesConflict
import dev.inmo.tgbotapi.bot.exceptions.InvalidPhotoDimensionsException
import dev.inmo.tgbotapi.bot.exceptions.MessageIsNotModifiedException
import dev.inmo.tgbotapi.bot.exceptions.MessageToEditNotFoundException
import dev.inmo.tgbotapi.bot.exceptions.ReplyMessageNotFoundException
import dev.inmo.tgbotapi.bot.exceptions.RequestException
import dev.inmo.tgbotapi.bot.exceptions.TooMuchRequestsException
import dev.inmo.tgbotapi.bot.exceptions.UnauthorizedException
import dev.inmo.tgbotapi.bot.exceptions.WrongFileIdentifierException
import dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton
import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink
import dev.inmo.tgbotapi.requests.send.payments.SendInvoice
@@ -4184,84 +4171,6 @@ public inline fun BackgroundFill.unknownOrThrow(): BackgroundFill.Unknown = this
public inline fun <T> BackgroundFill.ifUnknown(block: (BackgroundFill.Unknown) -> T): T? = unknownOrNull() ?.let(block)
public inline fun BotException.commonBotExceptionOrNull(): CommonBotException? = this as? dev.inmo.tgbotapi.bot.exceptions.CommonBotException
public inline fun BotException.commonBotExceptionOrThrow(): CommonBotException = this as dev.inmo.tgbotapi.bot.exceptions.CommonBotException
public inline fun <T> BotException.ifCommonBotException(block: (CommonBotException) -> T): T? = commonBotExceptionOrNull() ?.let(block)
public inline fun BotException.apiExceptionOrNull(): ApiException? = this as? dev.inmo.tgbotapi.bot.exceptions.ApiException
public inline fun BotException.apiExceptionOrThrow(): ApiException = this as dev.inmo.tgbotapi.bot.exceptions.ApiException
public inline fun <T> BotException.ifApiException(block: (ApiException) -> T): T? = apiExceptionOrNull() ?.let(block)
public inline fun BotException.requestExceptionOrNull(): RequestException? = this as? dev.inmo.tgbotapi.bot.exceptions.RequestException
public inline fun BotException.requestExceptionOrThrow(): RequestException = this as dev.inmo.tgbotapi.bot.exceptions.RequestException
public inline fun <T> BotException.ifRequestException(block: (RequestException) -> T): T? = requestExceptionOrNull() ?.let(block)
public inline fun BotException.commonRequestExceptionOrNull(): CommonRequestException? = this as? dev.inmo.tgbotapi.bot.exceptions.CommonRequestException
public inline fun BotException.commonRequestExceptionOrThrow(): CommonRequestException = this as dev.inmo.tgbotapi.bot.exceptions.CommonRequestException
public inline fun <T> BotException.ifCommonRequestException(block: (CommonRequestException) -> T): T? = commonRequestExceptionOrNull() ?.let(block)
public inline fun BotException.unauthorizedExceptionOrNull(): UnauthorizedException? = this as? dev.inmo.tgbotapi.bot.exceptions.UnauthorizedException
public inline fun BotException.unauthorizedExceptionOrThrow(): UnauthorizedException = this as dev.inmo.tgbotapi.bot.exceptions.UnauthorizedException
public inline fun <T> BotException.ifUnauthorizedException(block: (UnauthorizedException) -> T): T? = unauthorizedExceptionOrNull() ?.let(block)
public inline fun BotException.replyMessageNotFoundExceptionOrNull(): ReplyMessageNotFoundException? = this as? dev.inmo.tgbotapi.bot.exceptions.ReplyMessageNotFoundException
public inline fun BotException.replyMessageNotFoundExceptionOrThrow(): ReplyMessageNotFoundException = this as dev.inmo.tgbotapi.bot.exceptions.ReplyMessageNotFoundException
public inline fun <T> BotException.ifReplyMessageNotFoundException(block: (ReplyMessageNotFoundException) -> T): T? = replyMessageNotFoundExceptionOrNull() ?.let(block)
public inline fun BotException.messageIsNotModifiedExceptionOrNull(): MessageIsNotModifiedException? = this as? dev.inmo.tgbotapi.bot.exceptions.MessageIsNotModifiedException
public inline fun BotException.messageIsNotModifiedExceptionOrThrow(): MessageIsNotModifiedException = this as dev.inmo.tgbotapi.bot.exceptions.MessageIsNotModifiedException
public inline fun <T> BotException.ifMessageIsNotModifiedException(block: (MessageIsNotModifiedException) -> T): T? = messageIsNotModifiedExceptionOrNull() ?.let(block)
public inline fun BotException.messageToEditNotFoundExceptionOrNull(): MessageToEditNotFoundException? = this as? dev.inmo.tgbotapi.bot.exceptions.MessageToEditNotFoundException
public inline fun BotException.messageToEditNotFoundExceptionOrThrow(): MessageToEditNotFoundException = this as dev.inmo.tgbotapi.bot.exceptions.MessageToEditNotFoundException
public inline fun <T> BotException.ifMessageToEditNotFoundException(block: (MessageToEditNotFoundException) -> T): T? = messageToEditNotFoundExceptionOrNull() ?.let(block)
public inline fun BotException.invalidPhotoDimensionsExceptionOrNull(): InvalidPhotoDimensionsException? = this as? dev.inmo.tgbotapi.bot.exceptions.InvalidPhotoDimensionsException
public inline fun BotException.invalidPhotoDimensionsExceptionOrThrow(): InvalidPhotoDimensionsException = this as dev.inmo.tgbotapi.bot.exceptions.InvalidPhotoDimensionsException
public inline fun <T> BotException.ifInvalidPhotoDimensionsException(block: (InvalidPhotoDimensionsException) -> T): T? = invalidPhotoDimensionsExceptionOrNull() ?.let(block)
public inline fun BotException.wrongFileIdentifierExceptionOrNull(): WrongFileIdentifierException? = this as? dev.inmo.tgbotapi.bot.exceptions.WrongFileIdentifierException
public inline fun BotException.wrongFileIdentifierExceptionOrThrow(): WrongFileIdentifierException = this as dev.inmo.tgbotapi.bot.exceptions.WrongFileIdentifierException
public inline fun <T> BotException.ifWrongFileIdentifierException(block: (WrongFileIdentifierException) -> T): T? = wrongFileIdentifierExceptionOrNull() ?.let(block)
public inline fun BotException.tooMuchRequestsExceptionOrNull(): TooMuchRequestsException? = this as? dev.inmo.tgbotapi.bot.exceptions.TooMuchRequestsException
public inline fun BotException.tooMuchRequestsExceptionOrThrow(): TooMuchRequestsException = this as dev.inmo.tgbotapi.bot.exceptions.TooMuchRequestsException
public inline fun <T> BotException.ifTooMuchRequestsException(block: (TooMuchRequestsException) -> T): T? = tooMuchRequestsExceptionOrNull() ?.let(block)
public inline fun BotException.getUpdatesConflictOrNull(): GetUpdatesConflict? = this as? dev.inmo.tgbotapi.bot.exceptions.GetUpdatesConflict
public inline fun BotException.getUpdatesConflictOrThrow(): GetUpdatesConflict = this as dev.inmo.tgbotapi.bot.exceptions.GetUpdatesConflict
public inline fun <T> BotException.ifGetUpdatesConflict(block: (GetUpdatesConflict) -> T): T? = getUpdatesConflictOrNull() ?.let(block)
public inline fun BotException.commonBotExceptionDefaultOrNull(): CommonBotException.Default? = this as? dev.inmo.tgbotapi.bot.exceptions.CommonBotException.Default
public inline fun BotException.commonBotExceptionDefaultOrThrow(): CommonBotException.Default = this as dev.inmo.tgbotapi.bot.exceptions.CommonBotException.Default
public inline fun <T> BotException.ifCommonBotExceptionDefault(block: (CommonBotException.Default) -> T): T? = commonBotExceptionDefaultOrNull() ?.let(block)
public inline fun InlineQueryResultsButton.webAppOrNull(): InlineQueryResultsButton.WebApp? = this as? dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.WebApp
public inline fun InlineQueryResultsButton.webAppOrThrow(): InlineQueryResultsButton.WebApp = this as dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton.WebApp