diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Captioned.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Captioned.kt index 5071a339de..7cee50ae0b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Captioned.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Captioned.kt @@ -1,7 +1,6 @@ package dev.inmo.tgbotapi.CommonAbstracts import dev.inmo.tgbotapi.types.ParseMode.ParseMode -import dev.inmo.tgbotapi.utils.internal.fullListOfSubSource interface Captioned { val caption: String? diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Explained.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Explained.kt index 0b5b80f9d3..05e7cd1c63 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Explained.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Explained.kt @@ -1,7 +1,6 @@ package dev.inmo.tgbotapi.CommonAbstracts import dev.inmo.tgbotapi.types.ParseMode.ParseMode -import dev.inmo.tgbotapi.utils.internal.fullListOfSubSource interface Explained { val explanation: String? diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Texted.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Texted.kt index 4a418b5630..0b556444e5 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Texted.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/Texted.kt @@ -1,7 +1,6 @@ package dev.inmo.tgbotapi.CommonAbstracts import dev.inmo.tgbotapi.types.ParseMode.ParseMode -import dev.inmo.tgbotapi.utils.internal.fullListOfSubSource interface Texted { val text: String? diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/KtorRequestsExecutor.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/KtorRequestsExecutor.kt index 2d44fb5e36..97225fce01 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/KtorRequestsExecutor.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/KtorRequestsExecutor.kt @@ -5,7 +5,8 @@ import dev.inmo.tgbotapi.bot.BaseRequestsExecutor import dev.inmo.tgbotapi.bot.Ktor.base.* import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.exceptions.newRequestException -import dev.inmo.tgbotapi.bot.settings.limiters.* +import dev.inmo.tgbotapi.bot.settings.limiters.ExceptionsOnlyLimiter +import dev.inmo.tgbotapi.bot.settings.limiters.RequestLimiter import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.Response import dev.inmo.tgbotapi.utils.* diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/AbstractRequestCallFactory.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/AbstractRequestCallFactory.kt index 11a25ddfac..bedbc96283 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/AbstractRequestCallFactory.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/AbstractRequestCallFactory.kt @@ -6,7 +6,6 @@ import dev.inmo.tgbotapi.bot.exceptions.newRequestException import dev.inmo.tgbotapi.requests.GetUpdates import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.Response -import dev.inmo.tgbotapi.types.RetryAfterError import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper import io.ktor.client.HttpClient import io.ktor.client.call.receive @@ -14,7 +13,6 @@ import io.ktor.client.features.timeout import io.ktor.client.request.* import io.ktor.client.statement.HttpResponse import io.ktor.http.ContentType -import kotlinx.coroutines.delay import kotlinx.serialization.json.Json import kotlin.collections.set diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/exceptions/RequestException.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/exceptions/RequestException.kt index f792616fc2..687392c696 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/exceptions/RequestException.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/exceptions/RequestException.kt @@ -1,7 +1,8 @@ package dev.inmo.tgbotapi.bot.exceptions import com.soywiz.klock.DateTime -import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.Response +import dev.inmo.tgbotapi.types.RetryAfterError import io.ktor.utils.io.errors.IOException fun newRequestException( diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/CommonLimiter.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/CommonLimiter.kt index d87b007544..a38d5a60fd 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/CommonLimiter.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/CommonLimiter.kt @@ -1,15 +1,11 @@ package dev.inmo.tgbotapi.bot.settings.limiters import com.soywiz.klock.DateTime -import dev.inmo.micro_utils.coroutines.* import dev.inmo.tgbotapi.types.MilliSeconds import kotlinx.coroutines.* -import kotlinx.coroutines.channels.Channel -import kotlinx.coroutines.flow.filter import kotlinx.coroutines.sync.Semaphore import kotlinx.serialization.Serializable import kotlinx.serialization.Transient -import kotlin.coroutines.Continuation import kotlin.math.roundToLong private fun now(): Long = DateTime.nowUnixLong() diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/ExceptionsOnlyLimiter.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/ExceptionsOnlyLimiter.kt index e687c48c78..643d302bbd 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/ExceptionsOnlyLimiter.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/ExceptionsOnlyLimiter.kt @@ -2,11 +2,13 @@ package dev.inmo.tgbotapi.bot.settings.limiters import dev.inmo.micro_utils.coroutines.safely import dev.inmo.tgbotapi.bot.exceptions.TooMuchRequestsException -import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.MilliSeconds +import dev.inmo.tgbotapi.types.RetryAfterError import io.ktor.client.features.ClientRequestException import io.ktor.http.HttpStatusCode import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.* +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.first /** * This limiter will limit requests only after getting a [RetryAfterError] or [ClientRequestException] with diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/PowLimiter.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/PowLimiter.kt index 2eb0a87fa9..bb20345101 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/PowLimiter.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/settings/limiters/PowLimiter.kt @@ -1,9 +1,9 @@ package dev.inmo.tgbotapi.bot.settings.limiters -import dev.inmo.micro_utils.coroutines.* +import dev.inmo.micro_utils.coroutines.actor +import dev.inmo.micro_utils.coroutines.safely import dev.inmo.tgbotapi.types.MilliSeconds import kotlinx.coroutines.* -import kotlinx.coroutines.channels.Channel import kotlinx.serialization.Serializable import kotlinx.serialization.Transient import kotlin.coroutines.* diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage.kt index 868559b16d..8439853634 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/UnpinChatMessage.kt @@ -2,10 +2,7 @@ package dev.inmo.tgbotapi.requests.chat.modify import dev.inmo.tgbotapi.CommonAbstracts.types.ChatRequest import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest -import dev.inmo.tgbotapi.types.ChatIdentifier -import dev.inmo.tgbotapi.types.MessageIdentifier -import dev.inmo.tgbotapi.types.chatIdField -import dev.inmo.tgbotapi.types.messageIdField +import dev.inmo.tgbotapi.types.* import kotlinx.serialization.* import kotlinx.serialization.builtins.serializer diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/CopyMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/CopyMessage.kt index 817ff9ba0c..4ddbf8e68f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/CopyMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/CopyMessage.kt @@ -9,8 +9,6 @@ import dev.inmo.tgbotapi.types.MessageEntity.* import dev.inmo.tgbotapi.types.ParseMode.ParseMode import dev.inmo.tgbotapi.types.ParseMode.parseModeField import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup -import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage -import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass import kotlinx.serialization.* fun CopyMessage( diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/webhook/SetWebhook.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/webhook/SetWebhook.kt index 3e54a9c6ad..087ec7723b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/webhook/SetWebhook.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/webhook/SetWebhook.kt @@ -1,7 +1,8 @@ package dev.inmo.tgbotapi.requests.webhook import dev.inmo.tgbotapi.requests.abstracts.* -import dev.inmo.tgbotapi.requests.send.media.base.* +import dev.inmo.tgbotapi.requests.send.media.base.DataRequest +import dev.inmo.tgbotapi.requests.send.media.base.MultipartRequestImpl import dev.inmo.tgbotapi.types.* import kotlinx.serialization.* import kotlinx.serialization.builtins.serializer diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt index d2d4078ad9..b56f188204 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/audio/InlineQueryResultAudioCommon.kt @@ -1,6 +1,5 @@ package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio -import dev.inmo.tgbotapi.CommonAbstracts.CaptionedOutput import dev.inmo.tgbotapi.CommonAbstracts.TextedOutput import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.WithInputMessageContentInlineQueryResult diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt index 161dce6796..44ce297be0 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/document/InlineQueryResultDocumentCommon.kt @@ -1,6 +1,5 @@ package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.document -import dev.inmo.tgbotapi.CommonAbstracts.CaptionedOutput import dev.inmo.tgbotapi.CommonAbstracts.TextedOutput import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.* diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt index a7a38bf89d..a99ba9c91c 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/gif/InlineQueryResultGifCommon.kt @@ -1,6 +1,5 @@ package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif -import dev.inmo.tgbotapi.CommonAbstracts.CaptionedOutput import dev.inmo.tgbotapi.CommonAbstracts.TextedOutput import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.* diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt index a9a1d10da6..cdf1e72963 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt @@ -1,6 +1,5 @@ package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif -import dev.inmo.tgbotapi.CommonAbstracts.CaptionedOutput import dev.inmo.tgbotapi.CommonAbstracts.TextedOutput import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.* diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt index 52af23d9f8..85a05c23a9 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/photo/InlineQueryResultPhotoCommon.kt @@ -1,6 +1,5 @@ package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.photo -import dev.inmo.tgbotapi.CommonAbstracts.CaptionedOutput import dev.inmo.tgbotapi.CommonAbstracts.TextedOutput import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.* diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt index 50db300847..1543537e76 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/video/InlineQueryResultVideoCommon.kt @@ -1,6 +1,5 @@ package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.video -import dev.inmo.tgbotapi.CommonAbstracts.CaptionedOutput import dev.inmo.tgbotapi.CommonAbstracts.TextedOutput import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.* diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt index 7382e23c79..5c1ffb868c 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/results/voice/InlineQueryResultVoiceCommon.kt @@ -1,6 +1,5 @@ package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.voice -import dev.inmo.tgbotapi.CommonAbstracts.CaptionedOutput import dev.inmo.tgbotapi.CommonAbstracts.TextedOutput import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.* diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/MediaGroupMemberInputMedia.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/MediaGroupMemberInputMedia.kt index e1190be358..77fa02d59b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/MediaGroupMemberInputMedia.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/MediaGroupMemberInputMedia.kt @@ -1,6 +1,5 @@ package dev.inmo.tgbotapi.types.InputMedia -import dev.inmo.tgbotapi.CommonAbstracts.CaptionedOutput import dev.inmo.tgbotapi.CommonAbstracts.TextedOutput import kotlinx.serialization.* import kotlinx.serialization.json.Json diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/ThumbedInputMedia.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/ThumbedInputMedia.kt index d2b51c84b1..e44851ad94 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/ThumbedInputMedia.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InputMedia/ThumbedInputMedia.kt @@ -1,6 +1,6 @@ package dev.inmo.tgbotapi.types.InputMedia -import dev.inmo.tgbotapi.requests.abstracts.* +import dev.inmo.tgbotapi.requests.abstracts.InputFile interface ThumbedInputMedia : InputMedia { val thumb: InputFile? diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/BoldTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/BoldTextSource.kt index d4a05a7bc4..83223e01cb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/BoldTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/BoldTextSource.kt @@ -1,10 +1,8 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.boldMarkdown -import dev.inmo.tgbotapi.utils.internal.boldMarkdownV2 /** * @see bold diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/BotCommandTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/BotCommandTextSource.kt index 1923aa88bc..83d00409a0 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/BotCommandTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/BotCommandTextSource.kt @@ -1,10 +1,9 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources -import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.CommonAbstracts.DirectInvocationOfTextSourceConstructor +import dev.inmo.tgbotapi.CommonAbstracts.TextSource +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.commandMarkdown -import dev.inmo.tgbotapi.utils.internal.commandMarkdownV2 private val commandRegex = Regex("[/!][^@\\s]*") diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/CashTagTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/CashTagTextSource.kt index 4fa504f5ce..eb80cbf655 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/CashTagTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/CashTagTextSource.kt @@ -1,10 +1,8 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.cashTagMarkdown -import dev.inmo.tgbotapi.utils.internal.cashTagMarkdownV2 /** * @see cashTag diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/CodeTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/CodeTextSource.kt index 7935f01fc3..e71c556e9e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/CodeTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/CodeTextSource.kt @@ -2,10 +2,8 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources import dev.inmo.tgbotapi.CommonAbstracts.DirectInvocationOfTextSourceConstructor import dev.inmo.tgbotapi.CommonAbstracts.TextSource -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.codeMarkdown -import dev.inmo.tgbotapi.utils.internal.codeMarkdownV2 /** * @see code diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/EMailTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/EMailTextSource.kt index 6de5d3ddce..83311b871e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/EMailTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/EMailTextSource.kt @@ -1,10 +1,8 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.emailMarkdown -import dev.inmo.tgbotapi.utils.internal.emailMarkdownV2 /** * @see email diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/HashTagTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/HashTagTextSource.kt index 109ef54cbc..3b33b8faf0 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/HashTagTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/HashTagTextSource.kt @@ -1,10 +1,8 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.hashTagMarkdown -import dev.inmo.tgbotapi.utils.internal.hashTagMarkdownV2 /** * @see hashtag diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/ItalicTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/ItalicTextSource.kt index 92e71013c6..e72ed0b357 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/ItalicTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/ItalicTextSource.kt @@ -1,10 +1,8 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.italicMarkdown -import dev.inmo.tgbotapi.utils.internal.italicMarkdownV2 /** * @see italic diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/MentionTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/MentionTextSource.kt index 421c89c7a3..288a191773 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/MentionTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/MentionTextSource.kt @@ -1,10 +1,8 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.mentionMarkdown -import dev.inmo.tgbotapi.utils.internal.mentionMarkdownV2 private val String.withoutCommercialAt get() = if (startsWith("@")) { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/PhoneNumberTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/PhoneNumberTextSource.kt index ea3bb8feae..e17c1ec716 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/PhoneNumberTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/PhoneNumberTextSource.kt @@ -1,10 +1,8 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.phoneMarkdown -import dev.inmo.tgbotapi.utils.internal.phoneMarkdownV2 /** * @see phone diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/PreTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/PreTextSource.kt index 4c001f5387..e22910e0f1 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/PreTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/PreTextSource.kt @@ -1,10 +1,9 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources -import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.CommonAbstracts.DirectInvocationOfTextSourceConstructor +import dev.inmo.tgbotapi.CommonAbstracts.TextSource +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.preMarkdown -import dev.inmo.tgbotapi.utils.internal.preMarkdownV2 /** * @see pre diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/RegularTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/RegularTextSource.kt index 1d78129ca6..e880d6e2ba 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/RegularTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/RegularTextSource.kt @@ -1,10 +1,9 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources -import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.CommonAbstracts.DirectInvocationOfTextSourceConstructor +import dev.inmo.tgbotapi.CommonAbstracts.TextSource +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.regularMarkdown -import dev.inmo.tgbotapi.utils.internal.regularMarkdownV2 /** * @see regular diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/StrikethroughTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/StrikethroughTextSource.kt index a1557d1b88..524f3ca1a1 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/StrikethroughTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/StrikethroughTextSource.kt @@ -1,10 +1,8 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.strikethroughMarkdown -import dev.inmo.tgbotapi.utils.internal.strikethroughMarkdownV2 /** * @see strikethrough diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextLinkTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextLinkTextSource.kt index 482fb7dcbc..c6170764fd 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextLinkTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextLinkTextSource.kt @@ -1,10 +1,9 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources -import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.CommonAbstracts.DirectInvocationOfTextSourceConstructor +import dev.inmo.tgbotapi.CommonAbstracts.TextSource +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.linkMarkdown -import dev.inmo.tgbotapi.utils.internal.linkMarkdownV2 /** * @see link diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextMentionTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextMentionTextSource.kt index 8fd7a50521..4166e4b489 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextMentionTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextMentionTextSource.kt @@ -2,10 +2,8 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources import dev.inmo.tgbotapi.CommonAbstracts.* import dev.inmo.tgbotapi.types.User -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.textMentionMarkdown -import dev.inmo.tgbotapi.utils.internal.textMentionMarkdownV2 /** * @see mention diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/URLTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/URLTextSource.kt index c2cad771c6..cf84858378 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/URLTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/URLTextSource.kt @@ -1,10 +1,9 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources -import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.CommonAbstracts.DirectInvocationOfTextSourceConstructor +import dev.inmo.tgbotapi.CommonAbstracts.TextSource +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.linkMarkdown -import dev.inmo.tgbotapi.utils.internal.linkMarkdownV2 /** * @see link diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/UnderlineTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/UnderlineTextSource.kt index 4a7a799fdb..febc609a9d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/UnderlineTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/UnderlineTextSource.kt @@ -1,10 +1,8 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources import dev.inmo.tgbotapi.CommonAbstracts.* -import dev.inmo.tgbotapi.utils.* +import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.underlineMarkdown -import dev.inmo.tgbotapi.utils.internal.underlineMarkdownV2 /** * @see underline diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/abstracts/PrivateChat.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/abstracts/PrivateChat.kt index d87404fdad..83dfb87afc 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/abstracts/PrivateChat.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/abstracts/PrivateChat.kt @@ -1,6 +1,5 @@ package dev.inmo.tgbotapi.types.chat.abstracts -import dev.inmo.tgbotapi.types.ChatId import dev.inmo.tgbotapi.types.UserId import dev.inmo.tgbotapi.types.chat.PreviewChatSerializer import kotlinx.serialization.Serializable diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelEventMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelEventMessage.kt index 009dd19ef7..65bcc348cc 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelEventMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChannelEventMessage.kt @@ -4,7 +4,6 @@ import com.soywiz.klock.DateTime import dev.inmo.tgbotapi.types.MessageIdentifier import dev.inmo.tgbotapi.types.chat.abstracts.ChannelChat import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelEvent -import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.GroupEvent import dev.inmo.tgbotapi.types.message.abstracts.ChatEventMessage data class ChannelEventMessage( diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/CommonSupergroupEventMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/CommonSupergroupEventMessage.kt index 9ca551d636..b63a7dbf1b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/CommonSupergroupEventMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/CommonSupergroupEventMessage.kt @@ -4,7 +4,6 @@ import com.soywiz.klock.DateTime import dev.inmo.tgbotapi.types.MessageIdentifier import dev.inmo.tgbotapi.types.User import dev.inmo.tgbotapi.types.chat.abstracts.SupergroupChat -import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.GroupEvent import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.SupergroupEvent import dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/TextContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/TextContent.kt index 3914cbf835..83a5488e46 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/TextContent.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/content/TextContent.kt @@ -1,6 +1,7 @@ package dev.inmo.tgbotapi.types.message.content -import dev.inmo.tgbotapi.CommonAbstracts.* +import dev.inmo.tgbotapi.CommonAbstracts.TextPart +import dev.inmo.tgbotapi.CommonAbstracts.TextedInput import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.requests.send.SendTextMessage import dev.inmo.tgbotapi.types.ChatIdentifier @@ -10,8 +11,6 @@ import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage import dev.inmo.tgbotapi.types.message.content.abstracts.MessageContent import dev.inmo.tgbotapi.utils.internal.* -import dev.inmo.tgbotapi.utils.internal.fullListOfSubSource -import dev.inmo.tgbotapi.utils.internal.toMarkdownTexts data class TextContent( override val text: String, diff --git a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/MessageEntity/StringFormattingTests.kt b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/MessageEntity/StringFormattingTests.kt index 34a7e66975..459bcdf648 100644 --- a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/MessageEntity/StringFormattingTests.kt +++ b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/MessageEntity/StringFormattingTests.kt @@ -1,8 +1,8 @@ package dev.inmo.tgbotapi.types.MessageEntity import dev.inmo.tgbotapi.CommonAbstracts.TextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.* import dev.inmo.tgbotapi.CommonAbstracts.plus +import dev.inmo.tgbotapi.types.MessageEntity.textsources.* import dev.inmo.tgbotapi.utils.internal.* import kotlin.test.Test import kotlin.test.assertEquals diff --git a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/MessageEntity/TextPartsCreatingTests.kt b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/MessageEntity/TextPartsCreatingTests.kt index a4150e0d3d..ee3941f1ff 100644 --- a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/MessageEntity/TextPartsCreatingTests.kt +++ b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/MessageEntity/TextPartsCreatingTests.kt @@ -3,7 +3,8 @@ package dev.inmo.tgbotapi.types.MessageEntity import dev.inmo.tgbotapi.CommonAbstracts.justTextSources import dev.inmo.tgbotapi.utils.internal.toHtmlTexts import dev.inmo.tgbotapi.utils.internal.toMarkdownV2Texts -import kotlin.test.* +import kotlin.test.Test +import kotlin.test.assertEquals class TextPartsCreatingTests { @Test diff --git a/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFileFromJavaFile.kt b/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFileFromJavaFile.kt index 7492cc3d98..34350831f3 100644 --- a/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFileFromJavaFile.kt +++ b/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFileFromJavaFile.kt @@ -1,9 +1,7 @@ package dev.inmo.tgbotapi.requests.abstracts -import dev.inmo.tgbotapi.utils.MimeType import dev.inmo.tgbotapi.utils.StorageFile import java.io.File -import java.io.InputStream fun File.toInputFile() = if (exists()) { MultipartFile( diff --git a/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/utils/StorageFileFactory.kt b/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/utils/StorageFileFactory.kt index 4aab4c57b6..8d7ebe5c53 100644 --- a/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/utils/StorageFileFactory.kt +++ b/tgbotapi.core/src/jvmMain/kotlin/dev/inmo/tgbotapi/utils/StorageFileFactory.kt @@ -2,7 +2,6 @@ package dev.inmo.tgbotapi.utils import io.ktor.utils.io.streams.asInput import java.io.File -import java.io.InputStream import java.nio.file.Files fun StorageFile( diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotExtensions.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotExtensions.kt index 69c65e2421..c704fc94b2 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotExtensions.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotExtensions.kt @@ -1,7 +1,7 @@ package dev.inmo.tgbotapi.extensions.api -import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.bot.Ktor.telegramBot +import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl import io.ktor.client.HttpClient diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinChatMessage.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinChatMessage.kt index ada3cc7b95..41b26fafa9 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinChatMessage.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/modify/UnpinChatMessage.kt @@ -5,7 +5,6 @@ import dev.inmo.tgbotapi.requests.chat.modify.UnpinChatMessage import dev.inmo.tgbotapi.types.ChatIdentifier import dev.inmo.tgbotapi.types.MessageIdentifier import dev.inmo.tgbotapi.types.chat.abstracts.Chat -import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat import dev.inmo.tgbotapi.types.message.abstracts.Message suspend fun TelegramBot.unpinChatMessage( diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendVenue.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendVenue.kt index 31cabb0734..1f444aa8c0 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendVenue.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendVenue.kt @@ -2,12 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.send import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.requests.send.SendVenue -import dev.inmo.tgbotapi.types.ChatIdentifier -import dev.inmo.tgbotapi.types.FoursquareId -import dev.inmo.tgbotapi.types.FoursquareType -import dev.inmo.tgbotapi.types.GooglePlaceId -import dev.inmo.tgbotapi.types.GooglePlaceType -import dev.inmo.tgbotapi.types.MessageIdentifier +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.abstracts.Chat import dev.inmo.tgbotapi.types.location.StaticLocation diff --git a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContent.kt b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContent.kt index 6e55a5c484..26a55849df 100644 --- a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContent.kt +++ b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContent.kt @@ -7,7 +7,6 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage -import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage import dev.inmo.tgbotapi.types.message.content.* import dev.inmo.tgbotapi.types.message.content.abstracts.* import dev.inmo.tgbotapi.types.message.content.media.* diff --git a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroup.kt b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroup.kt index f3ac40ad09..f94531487a 100644 --- a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroup.kt +++ b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitMediaGroup.kt @@ -1,7 +1,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.utils.* +import dev.inmo.tgbotapi.extensions.utils.asSentMediaGroupUpdate import dev.inmo.tgbotapi.requests.abstracts.Request import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage import dev.inmo.tgbotapi.types.message.content.abstracts.* diff --git a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt index 419aac3b6a..e273335bf8 100644 --- a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt +++ b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt @@ -10,9 +10,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.expectFlow import dev.inmo.tgbotapi.extensions.utils.* import dev.inmo.tgbotapi.extensions.utils.extensions.sourceChat import dev.inmo.tgbotapi.extensions.utils.shortcuts.chat -import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage import dev.inmo.tgbotapi.types.message.abstracts.MediaGroupMessage -import dev.inmo.tgbotapi.types.message.content.ContactContent import dev.inmo.tgbotapi.types.message.content.abstracts.* import dev.inmo.tgbotapi.types.message.content.media.PhotoContent import dev.inmo.tgbotapi.types.message.content.media.VideoContent diff --git a/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt b/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt index 86ce5a165c..a6956c3282 100644 --- a/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt +++ b/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/ClassCasts.kt @@ -1,6 +1,8 @@ @file:Suppress("NOTHING_TO_INLINE", "unused", "UNCHECKED_CAST") package dev.inmo.tgbotapi.extensions.utils +import dev.inmo.tgbotapi.CommonAbstracts.MultilevelTextSource +import dev.inmo.tgbotapi.CommonAbstracts.TextSource import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.CallbackQuery.* import dev.inmo.tgbotapi.types.ChatMember.* @@ -20,6 +22,7 @@ import dev.inmo.tgbotapi.types.InlineQueries.abstracts.InputMessageContent import dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery import dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery import dev.inmo.tgbotapi.types.InputMedia.* +import dev.inmo.tgbotapi.types.MessageEntity.textsources.* import dev.inmo.tgbotapi.types.actions.* import dev.inmo.tgbotapi.types.buttons.* import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.* @@ -30,58 +33,15 @@ import dev.inmo.tgbotapi.types.files.abstracts.* import dev.inmo.tgbotapi.types.message.* import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.abstracts.* -import dev.inmo.tgbotapi.types.message.abstracts.ChannelMessage -import dev.inmo.tgbotapi.types.message.abstracts.GroupEventMessage -import dev.inmo.tgbotapi.types.message.abstracts.SupergroupEventMessage -import dev.inmo.tgbotapi.types.message.content.abstracts.MessageContent -import dev.inmo.tgbotapi.types.message.content.abstracts.PossiblySentViaBotCommonMessage +import dev.inmo.tgbotapi.types.message.content.* +import dev.inmo.tgbotapi.types.message.content.abstracts.* +import dev.inmo.tgbotapi.types.message.content.media.* +import dev.inmo.tgbotapi.types.message.payments.InvoiceContent import dev.inmo.tgbotapi.types.polls.* import dev.inmo.tgbotapi.types.update.* import dev.inmo.tgbotapi.types.update.MediaGroupUpdates.* import dev.inmo.tgbotapi.types.update.abstracts.* import dev.inmo.tgbotapi.utils.PreviewFeature -import dev.inmo.tgbotapi.types.message.content.abstracts.ResendableContent -import dev.inmo.tgbotapi.types.message.content.ContactContent -import dev.inmo.tgbotapi.types.message.content.DiceContent -import dev.inmo.tgbotapi.types.message.content.GameContent -import dev.inmo.tgbotapi.types.message.content.LocationContent -import dev.inmo.tgbotapi.types.message.content.PollContent -import dev.inmo.tgbotapi.types.message.content.TextContent -import dev.inmo.tgbotapi.types.message.content.VenueContent -import dev.inmo.tgbotapi.types.message.content.abstracts.AudioMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.abstracts.DocumentMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.abstracts.MediaCollectionContent -import dev.inmo.tgbotapi.types.files.abstracts.TelegramMediaFile -import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent -import dev.inmo.tgbotapi.types.message.content.abstracts.MediaGroupContent -import dev.inmo.tgbotapi.types.message.content.abstracts.VisualMediaGroupContent -import dev.inmo.tgbotapi.types.message.content.media.AnimationContent -import dev.inmo.tgbotapi.types.message.content.media.AudioContent -import dev.inmo.tgbotapi.types.message.content.media.DocumentContent -import dev.inmo.tgbotapi.types.message.content.media.PhotoContent -import dev.inmo.tgbotapi.types.message.content.media.StickerContent -import dev.inmo.tgbotapi.types.message.content.media.VideoContent -import dev.inmo.tgbotapi.types.message.content.media.VideoNoteContent -import dev.inmo.tgbotapi.types.message.content.media.VoiceContent -import dev.inmo.tgbotapi.types.message.payments.InvoiceContent -import dev.inmo.tgbotapi.CommonAbstracts.TextSource -import dev.inmo.tgbotapi.CommonAbstracts.MultilevelTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.BoldTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.BotCommandTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.CashTagTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.CodeTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.EMailTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.HashTagTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.ItalicTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.MentionTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.PhoneNumberTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.PreTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.RegularTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.StrikethroughTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextLinkTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextMentionTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.URLTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.UnderlineTextSource @PreviewFeature inline fun Chat.asBot(): Bot? = this as? Bot diff --git a/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt b/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt index 26a2bc674e..8d7e2687d6 100644 --- a/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt +++ b/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt @@ -2,7 +2,6 @@ package dev.inmo.tgbotapi.extensions.utils.formatting import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.MessageEntity.textsources.link -import dev.inmo.tgbotapi.types.ParseMode.* import dev.inmo.tgbotapi.types.chat.abstracts.* import dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedPublicChat import dev.inmo.tgbotapi.types.message.abstracts.Message diff --git a/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/EventsShortcuts.kt b/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/EventsShortcuts.kt index c9f0831301..54df4bdd03 100644 --- a/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/EventsShortcuts.kt +++ b/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/shortcuts/EventsShortcuts.kt @@ -9,7 +9,8 @@ import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.* import dev.inmo.tgbotapi.types.message.abstracts.* import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter import dev.inmo.tgbotapi.utils.RiskFeature -import kotlinx.coroutines.flow.* +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.mapNotNull @RiskFeature("Use with caution") inline fun FlowsUpdatesFilter.events(): Flow> {