From 5b98c5f821a25da61cc0edb82a049246685a62a8 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 1 Oct 2021 16:40:04 +0600 Subject: [PATCH] update dependencies --- CHANGELOG.md | 8 + gradle.properties | 4 +- .../tgbotapi/CommonAbstracts/TextSource.kt | 79 ------ .../Ktor/base/MultipartRequestCallFactory.kt | 3 - .../bot/Ktor/base/SimpleRequestCallFactory.kt | 3 - .../tgbotapi/requests/abstracts/InputFile.kt | 10 - .../requests/chat/get/GetChatMemberCount.kt | 3 - .../requests/chat/members/BanChatMember.kt | 3 - .../types/ChatMember/LeftChatMemberImpl.kt | 3 - .../types/ChatMember/MemberChatMemberImpl.kt | 3 - .../abstracts/ChosenInlineResult.kt | 6 - .../InlineQueries/abstracts/InlineQuery.kt | 6 - .../abstracts/InputMessageContent.kt | 6 - .../MessageEntity/textsources/TextSource.kt | 3 - .../inmo/tgbotapi/types/buttons/ReplyForce.kt | 3 - .../inmo/tgbotapi/types/files/PathedFile.kt | 3 - .../updateshandlers/FlowsUpdatesFilter.kt | 55 ---- .../dev/inmo/tgbotapi/utils/StorageFile.kt | 25 -- .../tgbotapi/extensions/api/DownloadFile.kt | 25 -- .../api/chat/get/GetChatMemberCount.kt | 10 - .../api/chat/members/BanChatMember.kt | 32 --- .../extensions/api/send/games/SendGame.kt | 36 --- .../api/send/media/SendAnimation.kt | 125 --------- .../extensions/api/send/media/SendAudio.kt | 94 ------- .../extensions/api/send/media/SendDocument.kt | 90 ------ .../api/send/media/SendMediaGroup.kt | 57 ---- .../extensions/api/send/media/SendPhoto.kt | 83 ------ .../extensions/api/send/media/SendSticker.kt | 37 --- .../extensions/api/send/media/SendVideo.kt | 90 ------ .../api/send/media/SendVideoNote.kt | 43 --- .../extensions/api/send/media/SendVoice.kt | 85 ------ .../api/send/payments/SendInvoice.kt | 29 -- .../extensions/api/send/polls/SendPoll.kt | 111 -------- .../behaviour_builder/BehaviourBuilders.kt | 32 +-- .../CallbackQueryTriggers.kt | 109 -------- .../ChatMemberUpdatedTriggers.kt | 39 --- .../triggers_handling/CommandHandling.kt | 112 -------- .../triggers_handling/ContentTriggers.kt | 261 ------------------ .../triggers_handling/EventTriggers.kt | 144 ---------- .../triggers_handling/InlineQueryTriggers.kt | 27 -- .../triggers_handling/MediaGroupTriggers.kt | 52 ---- .../triggers_handling/PassportTriggers.kt | 13 - .../utils/extensions/FlowsUpdatesFilter.kt | 14 - .../inmo/tgbotapi/types/files/PathedFile.kt | 23 +- 44 files changed, 12 insertions(+), 1987 deletions(-) delete mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/TextSource.kt delete mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/abstracts/ChosenInlineResult.kt delete mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/abstracts/InlineQuery.kt delete mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/abstracts/InputMessageContent.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 49ac0ac817..b0ed2b5720 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ ## 0.36.0 +**ALL PREVIOUS DEPRECATIONS HAVE BEEN REMOVED** + +* `Common`: + * `Version`: + * `Serialization`: `1.2.2` -> `1.3.0` + * `Ktor`: `1.6.3` -> `1.6.4` + * `MicroUtils`: `0.5.28` -> `0.5.31` + ## 0.35.9 * `Common`: diff --git a/gradle.properties b/gradle.properties index c690485bc7..7b05ee0f74 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,10 +7,10 @@ kotlin.incremental.js=true kotlin_version=1.5.31 kotlin_coroutines_version=1.5.2 -kotlin_serialisation_runtime_version=1.2.2 +kotlin_serialisation_runtime_version=1.3.0 klock_version=2.4.3 uuid_version=0.3.1 -ktor_version=1.6.3 +ktor_version=1.6.4 micro_utils_version=0.5.31 diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/TextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/TextSource.kt deleted file mode 100644 index 951cb4b17d..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/CommonAbstracts/TextSource.kt +++ /dev/null @@ -1,79 +0,0 @@ -package dev.inmo.tgbotapi.CommonAbstracts - -import dev.inmo.tgbotapi.types.MessageEntity.textsources.* -import dev.inmo.tgbotapi.types.MessageEntity.textsources.MultilevelTextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource -import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList -import dev.inmo.tgbotapi.types.MessageEntity.textsources.separateForCaption -import dev.inmo.tgbotapi.types.MessageEntity.textsources.separateForMessage -import dev.inmo.tgbotapi.types.MessageEntity.textsources.separateForText -import dev.inmo.tgbotapi.types.captionLength -import dev.inmo.tgbotapi.types.textLength -import dev.inmo.tgbotapi.utils.extensions.makeString - -const val DirectInvocationOfTextSourceConstructor = - "It is strongly not recommended to use constructors directly instead of factory methods" - -@Deprecated( - "Replaced", - ReplaceWith("TextSourcesList", "dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList") -) -typealias TextSourcesList = TextSourcesList - -@Deprecated("Replaced", ReplaceWith("TextSource", "dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource")) -typealias TextSource = TextSource - -@Suppress("NOTHING_TO_INLINE") -@Deprecated("Replaced", ReplaceWith("plus", "dev.inmo.tgbotapi.types.MessageEntity.textsources.plus")) -inline operator fun TextSource.plus(other: TextSource) = - listOf(this, other) - -@Suppress("NOTHING_TO_INLINE") -@Deprecated("Replaced", ReplaceWith("plus", "dev.inmo.tgbotapi.types.MessageEntity.textsources.plus")) -inline operator fun TextSource.plus(other: List) = - listOf(this) + other - -@Suppress("NOTHING_TO_INLINE") -@Deprecated("Replaced", ReplaceWith("plus", "dev.inmo.tgbotapi.types.MessageEntity.textsources.plus")) -inline operator fun TextSource.plus(text: String) = - listOf(this, regular(text)) - -@Suppress("NOTHING_TO_INLINE") -@Deprecated("Replaced", ReplaceWith("plus", "dev.inmo.tgbotapi.types.MessageEntity.textsources.plus")) -inline operator fun List.plus(text: String) = this + regular(text) - -@Deprecated( - "Replaced", - ReplaceWith("MultilevelTextSource", "dev.inmo.tgbotapi.types.MessageEntity.textsources.MultilevelTextSource") -) -typealias MultilevelTextSource = MultilevelTextSource - -@Deprecated("Replaced", ReplaceWith("makeString()", "dev.inmo.tgbotapi.utils.extensions.makeString")) -fun List.makeString() = makeString() - -@Deprecated( - "Replaced", - ReplaceWith("separateForMessage", "dev.inmo.tgbotapi.types.MessageEntity.textsources.separateForMessage") -) -fun List.separateForMessage(limit: IntRange, numberOfParts: Int? = null) = - separateForMessage(limit, numberOfParts) - -/** - * This method will prepare [TextSource]s list for messages. Remember, that first part will be separated with - * [captionLength] and all others with - */ -@Deprecated( - "Replaced", - ReplaceWith("separateForCaption", "dev.inmo.tgbotapi.types.MessageEntity.textsources.separateForCaption") -) -fun List.separateForCaption() = separateForCaption() - -/** - * This method will prepare [TextSource]s list for messages with [textLength] - */ -@Suppress("NOTHING_TO_INLINE") -@Deprecated( - "Replaced", - ReplaceWith("separateForText", "dev.inmo.tgbotapi.types.MessageEntity.textsources.separateForText") -) -inline fun List.separateForText() = separateForText() diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/MultipartRequestCallFactory.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/MultipartRequestCallFactory.kt index fab01c75fb..feb0daeb65 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/MultipartRequestCallFactory.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/MultipartRequestCallFactory.kt @@ -35,7 +35,4 @@ class MultipartRequestCallFactory : AbstractRequestCallFactory() { } ) } - - @Deprecated("Use class MultipartRequestCallFactory() constructor call instead of just MultipartRequestCallFactory") - companion object : KtorCallFactory by MultipartRequestCallFactory() } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/SimpleRequestCallFactory.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/SimpleRequestCallFactory.kt index 6c83ac9eeb..e774819815 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/SimpleRequestCallFactory.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/Ktor/base/SimpleRequestCallFactory.kt @@ -20,7 +20,4 @@ class SimpleRequestCallFactory : AbstractRequestCallFactory() { ContentType.Application.Json ) } - - @Deprecated("Use class SimpleRequestCallFactory() constructor call instead of just SimpleRequestCallFactory") - companion object : KtorCallFactory by SimpleRequestCallFactory() } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFile.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFile.kt index 834437b25f..8c71b6c6c8 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFile.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFile.kt @@ -64,21 +64,11 @@ data class MultipartFile ( val filename: String = file.storageFileInfo.fileName ) : InputFile() { override val fileId: String = file.storageFileInfo.generateCustomName() - - @Deprecated("This constructor is redundant. Use constructor without mime type") - constructor(file: StorageFile, mimeType: String, filename: String): this(file, filename) } @Suppress("NOTHING_TO_INLINE", "unused") inline fun StorageFile.asMultipartFile() = MultipartFile(this) -@Deprecated("This method is redundant. Use asMultipartFile without mime type") -@Suppress("NOTHING_TO_INLINE", "unused") -inline fun ByteArray.asMultipartFile( - fileName: String, - mimeType: MimeType -) = MultipartFile(asStorageFile(fileName)) - @Suppress("NOTHING_TO_INLINE", "unused") suspend inline fun ByteReadChannel.asMultipartFile( fileName: String diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/get/GetChatMemberCount.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/get/GetChatMemberCount.kt index c8c5a688b8..af54d4992f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/get/GetChatMemberCount.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/get/GetChatMemberCount.kt @@ -18,6 +18,3 @@ data class GetChatMemberCount( override val requestSerializer: SerializationStrategy<*> get() = serializer() } - -@Deprecated("Renamed", ReplaceWith("GetChatMemberCount", "dev.inmo.tgbotapi.requests.chat.get.GetChatMemberCount")) -typealias GetChatMembersCount = GetChatMemberCount diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/members/BanChatMember.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/members/BanChatMember.kt index 2dacaab43c..0aac06c4f6 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/members/BanChatMember.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/members/BanChatMember.kt @@ -23,6 +23,3 @@ data class BanChatMember( override val requestSerializer: SerializationStrategy<*> get() = serializer() } - -@Deprecated("Renamed", ReplaceWith("BanChatMember", "dev.inmo.tgbotapi.requests.chat.members.BanChatMember")) -typealias KickChatMember = BanChatMember diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatMember/LeftChatMemberImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatMember/LeftChatMemberImpl.kt index 50990b860c..d12e4b551b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatMember/LeftChatMemberImpl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatMember/LeftChatMemberImpl.kt @@ -10,6 +10,3 @@ data class LeftChatMemberImpl(@SerialName(userField) override val user: User) : @Required private val type: String = "left" } - -@Deprecated("Renamed", ReplaceWith("LeftChatMemberImpl", "dev.inmo.tgbotapi.types.ChatMember.LeftChatMemberImpl")) -typealias LeftChatMember = LeftChatMemberImpl diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatMember/MemberChatMemberImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatMember/MemberChatMemberImpl.kt index 3adbac1b3c..0f76788380 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatMember/MemberChatMemberImpl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatMember/MemberChatMemberImpl.kt @@ -10,6 +10,3 @@ data class MemberChatMemberImpl(@SerialName(userField) override val user: User) @Required private val type: String = "member" } - -@Deprecated("Renamed", ReplaceWith("MemberChatMember", "dev.inmo.tgbotapi.types.ChatMember.MemberChatMemberImpl")) -typealias MemberChatMember = MemberChatMemberImpl diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/abstracts/ChosenInlineResult.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/abstracts/ChosenInlineResult.kt deleted file mode 100644 index 999d0deba6..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/abstracts/ChosenInlineResult.kt +++ /dev/null @@ -1,6 +0,0 @@ -package dev.inmo.tgbotapi.types.InlineQueries.abstracts - -import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult - -@Deprecated("Replaced", ReplaceWith("ChosenInlineResult", "dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult")) -typealias ChosenInlineResult = ChosenInlineResult diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/abstracts/InlineQuery.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/abstracts/InlineQuery.kt deleted file mode 100644 index 8d73477fa8..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/abstracts/InlineQuery.kt +++ /dev/null @@ -1,6 +0,0 @@ -package dev.inmo.tgbotapi.types.InlineQueries.abstracts - -import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery - -@Deprecated("Replaced", ReplaceWith("InlineQuery", "dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery")) -typealias InlineQuery = InlineQuery diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/abstracts/InputMessageContent.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/abstracts/InputMessageContent.kt deleted file mode 100644 index e3fb5789b0..0000000000 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/abstracts/InputMessageContent.kt +++ /dev/null @@ -1,6 +0,0 @@ -package dev.inmo.tgbotapi.types.InlineQueries.abstracts - -import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputMessageContent - -@Deprecated("Replaced", ReplaceWith("InputMessageContent", "dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputMessageContent")) -typealias InputMessageContent = InputMessageContent diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextSource.kt index 340ccd1937..539410980d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/textsources/TextSource.kt @@ -2,7 +2,6 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources import dev.inmo.tgbotapi.types.captionLength import dev.inmo.tgbotapi.types.textLength -import dev.inmo.tgbotapi.utils.extensions.makeString import kotlinx.serialization.Serializable const val DirectInvocationOfTextSourceConstructor = "It is strongly not recommended to use constructors directly instead of factory methods" @@ -43,8 +42,6 @@ sealed interface MultilevelTextSource : TextSource { } } -@Deprecated("Replaced", ReplaceWith("makeString()", "dev.inmo.tgbotapi.utils.extensions.makeString")) -fun TextSourcesList.makeString() = makeString(null) fun List.separateForMessage(limit: IntRange, numberOfParts: Int? = null): List> { if (isEmpty()) { return emptyList() diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/ReplyForce.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/ReplyForce.kt index bfa3ad377e..d8d68db3ad 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/ReplyForce.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/ReplyForce.kt @@ -26,6 +26,3 @@ data class ReplyForce( } } } - -@Deprecated("Renamed", ReplaceWith("ReplyForce", "dev.inmo.tgbotapi.types.buttons.ReplyForce")) -typealias ForceReply = ReplyForce diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/PathedFile.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/PathedFile.kt index 247aa63c12..e1dd2ac001 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/PathedFile.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/PathedFile.kt @@ -24,8 +24,5 @@ data class PathedFile( } } -@Deprecated("Use fileName property instead", ReplaceWith("fileName")) -val PathedFile.filename: FileName - get() = filePath.filenameFromUrl fun TelegramAPIUrlsKeeper.resolveFileURL(file: PathedFile): String = "$fileBaseUrl/${file.filePath}" fun PathedFile.fullUrl(keeper: TelegramAPIUrlsKeeper): String = keeper.resolveFileURL(this) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt index a926a0c719..afc186883d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt @@ -32,61 +32,6 @@ interface FlowsUpdatesFilter : UpdatesFilter { val chatMemberUpdatesFlow: Flow val myChatMemberUpdatesFlow: Flow val unknownUpdatesFlow: Flow - - @Deprecated("Renamed", ReplaceWith("messagesFlow")) - val messageFlow: Flow - get() = messagesFlow - @Deprecated("Renamed", ReplaceWith("messageMediaGroupsFlow")) - val messageMediaGroupFlow: Flow - get() = messageMediaGroupsFlow - @Deprecated("Renamed", ReplaceWith("editedMessagesFlow")) - val editedMessageFlow: Flow - get() = editedMessagesFlow - @Deprecated("Renamed", ReplaceWith("editedMessageMediaGroupsFlow")) - val editedMessageMediaGroupFlow: Flow - get() = editedMessageMediaGroupsFlow - @Deprecated("Renamed", ReplaceWith("channelPostsFlow")) - val channelPostFlow: Flow - get() = channelPostsFlow - @Deprecated("Renamed", ReplaceWith("channelPostMediaGroupsFlow")) - val channelPostMediaGroupFlow: Flow - get() = channelPostMediaGroupsFlow - @Deprecated("Renamed", ReplaceWith("editedChannelPostsFlow")) - val editedChannelPostFlow: Flow - get() = editedChannelPostsFlow - @Deprecated("Renamed", ReplaceWith("editedChannelPostMediaGroupsFlow")) - val editedChannelPostMediaGroupFlow: Flow - get() = editedChannelPostMediaGroupsFlow - @Deprecated("Renamed", ReplaceWith("chosenInlineResultsFlow")) - val chosenInlineResultFlow: Flow - get() = chosenInlineResultsFlow - @Deprecated("Renamed", ReplaceWith("inlineQueriesFlow")) - val inlineQueryFlow: Flow - get() = inlineQueriesFlow - @Deprecated("Renamed", ReplaceWith("callbackQueriesFlow")) - val callbackQueryFlow: Flow - get() = callbackQueriesFlow - @Deprecated("Renamed", ReplaceWith("shippingQueriesFlow")) - val shippingQueryFlow: Flow - get() = shippingQueriesFlow - @Deprecated("Renamed", ReplaceWith("preCheckoutQueriesFlow")) - val preCheckoutQueryFlow: Flow - get() = preCheckoutQueriesFlow - @Deprecated("Renamed", ReplaceWith("pollsFlow")) - val pollFlow: Flow - get() = pollsFlow - @Deprecated("Renamed", ReplaceWith("pollAnswersFlow")) - val pollAnswerFlow: Flow - get() = pollAnswersFlow - @Deprecated("Renamed", ReplaceWith("chatMemberUpdatesFlow")) - val chatMemberUpdatedFlow: Flow - get() = chatMemberUpdatesFlow - @Deprecated("Renamed", ReplaceWith("myChatMemberUpdatesFlow")) - val myChatMemberUpdatedFlow: Flow - get() = myChatMemberUpdatesFlow - @Deprecated("Renamed", ReplaceWith("unknownUpdatesFlow")) - val unknownUpdateTypeFlow: Flow - get() = unknownUpdatesFlow } /** diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/StorageFile.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/StorageFile.kt index a67bb9f19e..2296e232dd 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/StorageFile.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/StorageFile.kt @@ -16,12 +16,6 @@ import kotlinx.serialization.Serializable data class StorageFileInfo( val fileName: String ) { - @Deprecated("This constructor is redundant. Use constructor without mime type") - constructor( - contentType: String, - fileName: String - ): this(fileName) - /** * This methods is required for random generation of name for keeping warranties about unique file name */ @@ -45,18 +39,6 @@ data class StorageFile( get() = inputSource() } -@Deprecated("This constructor is redundant. Use constructor without mime type") -@Suppress("NOTHING_TO_INLINE") -inline fun StorageFile( - fileName: String, - bytes: ByteArray, - mimeType: MimeType -) = StorageFile( - StorageFileInfo(fileName) -) { - ByteReadPacket(bytes) -} - @Suppress("NOTHING_TO_INLINE") inline fun StorageFile( fileName: String, @@ -81,13 +63,6 @@ inline fun ByteArray.asStorageFile( fileName: String ) = StorageFile(fileName, this) -@Deprecated("This constructor is redundant. Use constructor without mime type") -@Suppress("NOTHING_TO_INLINE", "unused") -inline fun ByteArray.asStorageFile( - fileName: String, - mimeType: MimeType -) = asStorageFile(fileName) - @Suppress("NOTHING_TO_INLINE", "unused") suspend inline fun ByteReadChannel.asStorageFile( fileName: String diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DownloadFile.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DownloadFile.kt index 627f75ec8b..c3ca7ab6e0 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DownloadFile.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/DownloadFile.kt @@ -6,28 +6,3 @@ import dev.inmo.tgbotapi.requests.abstracts.FileId import dev.inmo.tgbotapi.types.files.PathedFile import dev.inmo.tgbotapi.types.files.abstracts.TelegramMediaFile import dev.inmo.tgbotapi.types.message.content.abstracts.MediaContent - -@Deprecated("Replaced", ReplaceWith("downloadFile", "dev.inmo.tgbotapi.extensions.api.files.downloadFile")) -suspend fun TelegramBot.downloadFile( - filePath: String -): ByteArray = downloadFile(filePath) - -@Deprecated("Replaced", ReplaceWith("downloadFile", "dev.inmo.tgbotapi.extensions.api.files.downloadFile")) -suspend fun TelegramBot.downloadFile( - pathedFile: PathedFile -): ByteArray = downloadFile(pathedFile) - -@Deprecated("Replaced", ReplaceWith("downloadFile", "dev.inmo.tgbotapi.extensions.api.files.downloadFile")) -suspend fun TelegramBot.downloadFile( - fileId: FileId -): ByteArray = downloadFile(fileId) - -@Deprecated("Replaced", ReplaceWith("downloadFile", "dev.inmo.tgbotapi.extensions.api.files.downloadFile")) -suspend fun TelegramBot.downloadFile( - file: TelegramMediaFile -): ByteArray = downloadFile(file) - -@Deprecated("Replaced", ReplaceWith("downloadFile", "dev.inmo.tgbotapi.extensions.api.files.downloadFile")) -suspend fun TelegramBot.downloadFile( - file: MediaContent -): ByteArray = downloadFile(file) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatMemberCount.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatMemberCount.kt index 0f165b759a..b53fe39ac6 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatMemberCount.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/get/GetChatMemberCount.kt @@ -12,13 +12,3 @@ suspend fun TelegramBot.getChatMemberCount( suspend fun TelegramBot.getChatMemberCount( chat: PublicChat ) = getChatMemberCount(chat.id) - -@Deprecated("Renamed", ReplaceWith("getChatMemberCount", "dev.inmo.tgbotapi.extensions.api.chat.get.getChatMemberCount")) -suspend fun TelegramBot.getChatMembersCount( - chatId: ChatIdentifier -) = getChatMemberCount(chatId) - -@Deprecated("Renamed", ReplaceWith("getChatMemberCount", "dev.inmo.tgbotapi.extensions.api.chat.get.getChatMemberCount")) -suspend fun TelegramBot.getChatMembersCount( - chat: PublicChat -) = getChatMemberCount(chat) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/BanChatMember.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/BanChatMember.kt index 6cf936caa6..dc8a069e78 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/BanChatMember.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/chat/members/BanChatMember.kt @@ -32,35 +32,3 @@ suspend fun TelegramBot.banChatMember( untilDate: TelegramDate? = null, revokeMessages: Boolean? = null ) = banChatMember(chat.id, user.id, untilDate, revokeMessages) - -@Deprecated("Renamed", ReplaceWith("banChatMember", "dev.inmo.tgbotapi.extensions.api.chat.members.banChatMember")) -suspend fun TelegramBot.kickChatMember( - chatId: ChatIdentifier, - userId: UserId, - untilDate: TelegramDate? = null, - revokeMessages: Boolean? = null -) = banChatMember(chatId, userId, untilDate, revokeMessages) - -@Deprecated("Renamed", ReplaceWith("banChatMember", "dev.inmo.tgbotapi.extensions.api.chat.members.banChatMember")) -suspend fun TelegramBot.kickChatMember( - chat: PublicChat, - userId: UserId, - untilDate: TelegramDate? = null, - revokeMessages: Boolean? = null -) = banChatMember(chat, userId, untilDate, revokeMessages) - -@Deprecated("Renamed", ReplaceWith("banChatMember", "dev.inmo.tgbotapi.extensions.api.chat.members.banChatMember")) -suspend fun TelegramBot.kickChatMember( - chatId: ChatId, - user: User, - untilDate: TelegramDate? = null, - revokeMessages: Boolean? = null -) = banChatMember(chatId, user, untilDate, revokeMessages) - -@Deprecated("Renamed", ReplaceWith("banChatMember", "dev.inmo.tgbotapi.extensions.api.chat.members.banChatMember")) -suspend fun TelegramBot.kickChatMember( - chat: PublicChat, - user: User, - untilDate: TelegramDate? = null, - revokeMessages: Boolean? = null -) = banChatMember(chat, user, untilDate, revokeMessages) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/games/SendGame.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/games/SendGame.kt index 5dd0fa73d0..fea4bc7185 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/games/SendGame.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/games/SendGame.kt @@ -56,39 +56,3 @@ suspend fun TelegramBot.sendGame( ) = sendGame( chat.id, game.title, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup ) - -@Deprecated( - "Replaced", - ReplaceWith("replyWithGame", "dev.inmo.tgbotapi.extensions.api.send.replyWithGame") -) -suspend inline fun TelegramBot.replyWithGame( - to: Message, - gameShortName: String, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithGame(to, gameShortName, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("replyWithGame", "dev.inmo.tgbotapi.extensions.api.send.replyWithGame") -) -suspend inline fun TelegramBot.replyWithGame( - to: Message, - game: Game, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithGame(to, game, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - game: Game, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, game, disableNotification, allowSendingWithoutReply, replyMarkup) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAnimation.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAnimation.kt index 67a3d7ba79..fa3210e83a 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAnimation.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAnimation.kt @@ -159,128 +159,3 @@ suspend fun TelegramBot.sendAnimation( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null ) = sendAnimation(chat.id, animation, entities, duration, width, height, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("replyWithAnimation", "dev.inmo.tgbotapi.extensions.api.send.replyWithAnimation") -) -suspend inline fun TelegramBot.replyWithAnimation( - to: Message, - animation: InputFile, - thumb: InputFile? = null, - entities: TextSourcesList, - duration: Long? = null, - width: Int? = null, - height: Int? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithAnimation( - to, - animation, - entities, - thumb, - duration, - width, - height, - disableNotification, - allowSendingWithoutReply, - replyMarkup -) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithAnimation( - to: Message, - animation: AnimationFile, - entities: TextSourcesList, - duration: Long? = null, - width: Int? = null, - height: Int? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, animation, entities, duration, width, height, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - animation: AnimationFile, - entities: TextSourcesList, - duration: Long? = null, - width: Int? = null, - height: Int? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, animation, entities, duration, width, height, disableNotification, allowSendingWithoutReply, replyMarkup) - - -@Deprecated( - "Replaced", - ReplaceWith("replyWithAnimation", "dev.inmo.tgbotapi.extensions.api.send.replyWithAnimation") -) -suspend inline fun TelegramBot.replyWithAnimation( - to: Message, - animation: InputFile, - thumb: InputFile? = null, - text: String? = null, - parseMode: ParseMode? = null, - duration: Long? = null, - width: Int? = null, - height: Int? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithAnimation( - to, - animation, - thumb, - text, - parseMode, - duration, - width, - height, - disableNotification, - allowSendingWithoutReply, - replyMarkup -) - -@Deprecated( - "Replaced", - ReplaceWith("replyWithAnimation", "dev.inmo.tgbotapi.extensions.api.send.replyWithAnimation") -) -suspend inline fun TelegramBot.replyWithAnimation( - to: Message, - animation: AnimationFile, - text: String? = null, - parseMode: ParseMode? = null, - duration: Long? = null, - width: Int? = null, - height: Int? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, animation, text, parseMode, duration, width, height, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - animation: AnimationFile, - text: String? = null, - parseMode: ParseMode? = null, - duration: Long? = null, - width: Int? = null, - height: Int? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, animation, text, parseMode, duration, width, height, disableNotification, allowSendingWithoutReply, replyMarkup) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAudio.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAudio.kt index e3846e02f4..b7cd0846b9 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAudio.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAudio.kt @@ -147,97 +147,3 @@ suspend inline fun TelegramBot.sendAudio( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null ) = sendAudio(chat.id, audio, entities, title, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) - - -@Deprecated( - "Replaced", - ReplaceWith("replyWithAudio", "dev.inmo.tgbotapi.extensions.api.send.replyWithAudio") -) -suspend inline fun TelegramBot.replyWithAudio( - to: Message, - audio: InputFile, - thumb: InputFile? = null, - text: String? = null, - parseMode: ParseMode? = null, - duration: Long? = null, - performer: String? = null, - title: String? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithAudio(to, audio, thumb, text, parseMode, duration, performer, title, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithAudio( - to: Message, - audio: AudioFile, - text: String? = null, - parseMode: ParseMode? = null, - title: String? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, audio, text, parseMode, title, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - audio: AudioFile, - text: String? = null, - parseMode: ParseMode? = null, - title: String? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, audio, text, parseMode, title, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("replyWithAudio", "dev.inmo.tgbotapi.extensions.api.send.replyWithAudio") -) -suspend inline fun TelegramBot.replyWithAudio( - to: Message, - audio: InputFile, - thumb: InputFile? = null, - entities: TextSourcesList, - duration: Long? = null, - performer: String? = null, - title: String? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithAudio(to, audio, thumb, entities, duration, performer, title, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithAudio( - to: Message, - audio: AudioFile, - entities: TextSourcesList, - title: String? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, audio, entities, title, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.repl") -) -suspend inline fun TelegramBot.reply( - to: Message, - audio: AudioFile, - entities: TextSourcesList, - title: String? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, audio, entities, title, disableNotification, allowSendingWithoutReply, replyMarkup) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendDocument.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendDocument.kt index bd3ce148e5..2766ee1d49 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendDocument.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendDocument.kt @@ -138,93 +138,3 @@ suspend inline fun TelegramBot.sendDocument( replyMarkup: KeyboardMarkup? = null, disableContentTypeDetection: Boolean? = null ) = sendDocument(chat.id, document, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) - - -@Deprecated( - "Replaced", - ReplaceWith("replyWithDocument", "dev.inmo.tgbotapi.extensions.api.send.replyWithDocument") -) -suspend inline fun TelegramBot.replyWithDocument( - to: Message, - document: InputFile, - thumb: InputFile? = null, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null, - disableContentTypeDetection: Boolean? = null -) = replyWithDocument(to, document, thumb, text, parseMode, disableNotification, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithDocument( - to: Message, - document: DocumentFile, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null, - disableContentTypeDetection: Boolean? = null -) = reply(to, document, text, parseMode, disableNotification, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - document: DocumentFile, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null, - disableContentTypeDetection: Boolean? = null -) = reply(to, document, text, parseMode, disableNotification, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) - -@Deprecated( - "Replaced", - ReplaceWith("replyWithDocument", "dev.inmo.tgbotapi.extensions.api.send.replyWithDocument") -) -suspend inline fun TelegramBot.replyWithDocument( - to: Message, - document: InputFile, - thumb: InputFile? = null, - entities: TextSourcesList, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null, - disableContentTypeDetection: Boolean? = null -) = replyWithDocument(to, document, thumb, entities, disableNotification, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithDocument( - to: Message, - document: DocumentFile, - entities: TextSourcesList, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null, - disableContentTypeDetection: Boolean? = null -) = reply(to, document, entities, disableNotification, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - document: DocumentFile, - entities: TextSourcesList, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null, - disableContentTypeDetection: Boolean? = null -) = reply(to, document, entities, disableNotification, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt index 7bc3706479..7a14aaf82e 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendMediaGroup.kt @@ -127,60 +127,3 @@ suspend fun TelegramBot.sendVisualMediaGroup( ) = sendVisualMediaGroup( chat.id, media, disableNotification, replyToMessageId, allowSendingWithoutReply ) - - -@Deprecated( - "Replaced", - ReplaceWith("replyWithMediaGroup", "dev.inmo.tgbotapi.extensions.api.send.replyWithMediaGroup") -) -@RiskFeature(rawSendingMediaGroupsWarning) -suspend inline fun TelegramBot.replyWithMediaGroup( - to: Message, - media: List, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null -) = replyWithMediaGroup(to, media, disableNotification, allowSendingWithoutReply) - -@Deprecated( - "Replaced", - ReplaceWith("replyWithPlaylist", "dev.inmo.tgbotapi.extensions.api.send.replyWithPlaylist") -) -suspend inline fun TelegramBot.replyWithPlaylist( - to: Message, - media: List, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null -) = replyWithPlaylist(to, media, disableNotification, allowSendingWithoutReply) - -@Deprecated( - "Replaced", - ReplaceWith("replyWithDocuments", "dev.inmo.tgbotapi.extensions.api.send.replyWithDocuments") -) -suspend inline fun TelegramBot.replyWithDocumentsGroup( - to: Message, - media: List, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null -) = replyWithDocuments(to, media, disableNotification, allowSendingWithoutReply) - -@Deprecated( - "Replaced", - ReplaceWith("replyWithGallery", "dev.inmo.tgbotapi.extensions.api.send.replyWithGallery") -) -suspend inline fun TelegramBot.replyWithVisualMediaGroup( - to: Message, - media: List, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null -) = replyWithGallery(to, media, disableNotification, allowSendingWithoutReply) - -@Deprecated( - "Replaced", - ReplaceWith("replyWithMediaGroup", "dev.inmo.tgbotapi.extensions.api.send.replyWithMediaGroup") -) -suspend inline fun TelegramBot.reply( - to: Message, - media: List, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null -) = replyWithMediaGroup(to, media, disableNotification, allowSendingWithoutReply) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt index 6b562f5c0e..1decf11793 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendPhoto.kt @@ -120,86 +120,3 @@ suspend inline fun TelegramBot.sendPhoto( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null ) = sendPhoto(chat.id, photo, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) - - -@Deprecated( - "Replaced", - ReplaceWith("replyWithPhoto", "dev.inmo.tgbotapi.extensions.api.send.replyWithPhoto") -) -suspend inline fun TelegramBot.replyWithPhoto( - to: Message, - fileId: InputFile, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithPhoto(to, fileId, text, parseMode, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithPhoto( - to: Message, - photo: Photo, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, photo, text, parseMode, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - photo: Photo, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, photo, text, parseMode, disableNotification, allowSendingWithoutReply, replyMarkup) - - -@Deprecated( - "Replaced", - ReplaceWith("replyWithPhoto", "dev.inmo.tgbotapi.extensions.api.send.replyWithPhoto") -) -suspend inline fun TelegramBot.replyWithPhoto( - to: Message, - fileId: InputFile, - entities: TextSourcesList, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithPhoto(to, fileId, entities, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithPhoto( - to: Message, - photo: Photo, - entities: TextSourcesList, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, photo, entities, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - photo: Photo, - entities: TextSourcesList, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, photo, entities, disableNotification, allowSendingWithoutReply, replyMarkup) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendSticker.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendSticker.kt index 08b00f0704..03d489b6bf 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendSticker.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendSticker.kt @@ -49,40 +49,3 @@ suspend fun TelegramBot.sendSticker( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null ) = sendSticker(chat, sticker.fileId, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) - - -@Deprecated( - "Replaced", - ReplaceWith("replyWithSticker", "dev.inmo.tgbotapi.extensions.api.send.replyWithSticker") -) -suspend inline fun TelegramBot.replyWithSticker( - to: Message, - sticker: InputFile, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithSticker(to, sticker, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithSticker( - to: Message, - sticker: Sticker, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, sticker, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - sticker: Sticker, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, sticker, disableNotification, allowSendingWithoutReply, replyMarkup) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideo.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideo.kt index b4b29b3292..6cc62cb512 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideo.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideo.kt @@ -146,93 +146,3 @@ suspend inline fun TelegramBot.sendVideo( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null ) = sendVideo(chat.id, video, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) - - -@Deprecated( - "Replaced", - ReplaceWith("replyWithVideo", "dev.inmo.tgbotapi.extensions.api.send.replyWithVideo") -) -suspend inline fun TelegramBot.replyWithVideo( - to: Message, - video: InputFile, - thumb: InputFile? = null, - text: String? = null, - parseMode: ParseMode? = null, - duration: Long? = null, - width: Int? = null, - height: Int? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithVideo(to, video, thumb, text, parseMode, duration, width, height, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithVideo( - to: Message, - video: VideoFile, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, video, text, parseMode, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - video: VideoFile, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, video, text, parseMode, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("replyWithVideo", "dev.inmo.tgbotapi.extensions.api.send.replyWithVideo") -) -suspend inline fun TelegramBot.replyWithVideo( - to: Message, - video: InputFile, - thumb: InputFile? = null, - entities: TextSourcesList, - duration: Long? = null, - width: Int? = null, - height: Int? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithVideo(to, video, thumb, entities, duration, width, height, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithVideo( - to: Message, - video: VideoFile, - entities: TextSourcesList, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, video, entities, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - video: VideoFile, - entities: TextSourcesList, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, video, entities, disableNotification, allowSendingWithoutReply, replyMarkup) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideoNote.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideoNote.kt index 211d8b3427..bc54f04403 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideoNote.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideoNote.kt @@ -1,8 +1,6 @@ package dev.inmo.tgbotapi.extensions.api.send.media import dev.inmo.tgbotapi.bot.TelegramBot -import dev.inmo.tgbotapi.extensions.api.send.reply -import dev.inmo.tgbotapi.extensions.api.send.replyWithVideoNote import dev.inmo.tgbotapi.requests.abstracts.InputFile import dev.inmo.tgbotapi.requests.send.media.SendVideoNote import dev.inmo.tgbotapi.types.ChatIdentifier @@ -10,7 +8,6 @@ import dev.inmo.tgbotapi.types.MessageIdentifier import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup import dev.inmo.tgbotapi.types.chat.abstracts.Chat import dev.inmo.tgbotapi.types.files.VideoNoteFile -import dev.inmo.tgbotapi.types.message.abstracts.Message suspend fun TelegramBot.sendVideoNote( chatId: ChatIdentifier, @@ -67,43 +64,3 @@ suspend fun TelegramBot.sendVideoNote( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null ) = sendVideoNote(chat.id, videoNote, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) - - -@Deprecated( - "Replaced", - ReplaceWith("replyWithVideoNote", "dev.inmo.tgbotapi.extensions.api.send.replyWithVideoNote") -) -suspend inline fun TelegramBot.replyWithVideoNote( - to: Message, - videoNote: InputFile, - thumb: InputFile? = null, - duration: Long? = null, - size: Int? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithVideoNote(to, videoNote, thumb, duration, size, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithVideoNote( - to: Message, - videoNote: VideoNoteFile, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, videoNote, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - videoNote: VideoNoteFile, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, videoNote, disableNotification, allowSendingWithoutReply, replyMarkup) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVoice.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVoice.kt index 697c2d181c..3474250cfc 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVoice.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVoice.kt @@ -129,88 +129,3 @@ suspend inline fun TelegramBot.sendVoice( allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null ) = sendVoice(chat.id, voice, entities, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) - - -@Deprecated( - "Replaced", - ReplaceWith("replyWithVoice", "dev.inmo.tgbotapi.extensions.api.send.replyWithVoice") -) -suspend inline fun TelegramBot.replyWithVoice( - to: Message, - voice: InputFile, - text: String? = null, - parseMode: ParseMode? = null, - duration: Long? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithVoice(to, voice, text, parseMode, duration, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithVoice( - to: Message, - voice: VoiceFile, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, voice, text, parseMode, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - voice: VoiceFile, - text: String? = null, - parseMode: ParseMode? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, voice, text, parseMode, disableNotification, allowSendingWithoutReply, replyMarkup) - - -@Deprecated( - "Replaced", - ReplaceWith("replyWithVoice", "dev.inmo.tgbotapi.extensions.api.send.replyWithVoice") -) -suspend inline fun TelegramBot.replyWithVoice( - to: Message, - voice: InputFile, - entities: TextSourcesList, - duration: Long? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = replyWithVoice(to, voice, entities, duration, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithVoice( - to: Message, - voice: VoiceFile, - entities: TextSourcesList, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, voice, entities, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.reply( - to: Message, - voice: VoiceFile, - entities: TextSourcesList, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, voice, entities, disableNotification, allowSendingWithoutReply, replyMarkup) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/SendInvoice.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/SendInvoice.kt index 9aaabef97d..5489f27b17 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/SendInvoice.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/payments/SendInvoice.kt @@ -60,32 +60,3 @@ suspend fun TelegramBot.sendInvoice( allowSendingWithoutReply: Boolean? = null, replyMarkup: InlineKeyboardMarkup? = null ) = sendInvoice(user.id, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) - - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithInvoice( - to: Message, - title: String, - description: String, - payload: String, - providerToken: String, - currency: Currency, - prices: List, - maxTipAmount: Int? = null, - suggestedTipAmounts: List? = null, - startParameter: StartParameter? = null, - providerData: String? = null, - requireName: Boolean = false, - requirePhoneNumber: Boolean = false, - requireEmail: Boolean = false, - requireShippingAddress: Boolean = false, - shouldSendPhoneNumberToProvider: Boolean = false, - shouldSendEmailToProvider: Boolean = false, - priceDependOnShipAddress: Boolean = false, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: InlineKeyboardMarkup? = null -) = reply(to, title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts, startParameter, providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress, disableNotification, allowSendingWithoutReply, replyMarkup) diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendPoll.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendPoll.kt index 96db4a23d0..c6df9d1ca1 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendPoll.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/polls/SendPoll.kt @@ -227,114 +227,3 @@ suspend inline fun TelegramBot.sendQuizPoll( ) = sendQuizPoll( chat.id, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup ) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithRegularPoll( - to: Message, - question: String, - options: List, - isAnonymous: Boolean = true, - isClosed: Boolean = false, - allowMultipleAnswers: Boolean = false, - closeInfo: ScheduledCloseInfo? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithRegularPoll( - to: Message, - poll: RegularPoll, - isClosed: Boolean = false, - question: String = poll.question, - options: List = poll.options.map { it.text }, - isAnonymous: Boolean = poll.isAnonymous, - allowMultipleAnswers: Boolean = poll.allowMultipleAnswers, - closeInfo: ScheduledCloseInfo? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithQuizPoll( - to: Message, - question: String, - options: List, - correctOptionId: Int, - isAnonymous: Boolean = true, - isClosed: Boolean = false, - explanation: String? = null, - parseMode: ParseMode? = null, - closeInfo: ScheduledCloseInfo? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithQuizPoll( - to: Message, - isClosed: Boolean = false, - quizPoll: QuizPoll, - question: String = quizPoll.question, - options: List = quizPoll.options.map { it.text }, - correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"), - isAnonymous: Boolean = quizPoll.isAnonymous, - explanation: String? = null, - parseMode: ParseMode? = null, - closeInfo: ScheduledCloseInfo? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, quizPoll, isClosed, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, disableNotification, allowSendingWithoutReply, replyMarkup) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithQuizPoll( - to: Message, - question: String, - options: List, - correctOptionId: Int, - isAnonymous: Boolean = true, - isClosed: Boolean = false, - entities: TextSourcesList, - closeInfo: ScheduledCloseInfo? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, question, options, correctOptionId, isAnonymous, isClosed) - -@Deprecated( - "Replaced", - ReplaceWith("reply", "dev.inmo.tgbotapi.extensions.api.send.reply") -) -suspend inline fun TelegramBot.replyWithQuizPoll( - to: Message, - isClosed: Boolean = false, - quizPoll: QuizPoll, - question: String = quizPoll.question, - options: List = quizPoll.options.map { it.text }, - correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"), - isAnonymous: Boolean = quizPoll.isAnonymous, - entities: TextSourcesList, - closeInfo: ScheduledCloseInfo? = null, - disableNotification: Boolean = false, - allowSendingWithoutReply: Boolean? = null, - replyMarkup: KeyboardMarkup? = null -) = reply(to, quizPoll, entities, isClosed, question, options, correctOptionId, isAnonymous, closeInfo, disableNotification, allowSendingWithoutReply, replyMarkup) diff --git a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuilders.kt b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuilders.kt index 6ec5c5a862..00e0a527d4 100644 --- a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuilders.kt +++ b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuilders.kt @@ -16,36 +16,6 @@ import kotlinx.coroutines.plus */ expect var defaultCoroutineScopeProvider: () -> CoroutineScope -/** - * Use this method in case you wish to make some additional actions with [flowUpdatesFilter]. - * - * **WARNING** This method WILL NOT launch any listening of updates. Use something like - * [startGettingOfUpdatesByLongPolling] or tools for work with webhooks - * - * @see [BehaviourContext] - * @see startGettingOfUpdatesByLongPolling - */ -@PreviewFeature -@Deprecated("Parameters has been reordered. Replace scope and flowUpdatesFilter for correct order") -suspend fun TelegramBot.buildBehaviour( - scope: CoroutineScope, - flowUpdatesFilter: FlowsUpdatesFilter, - defaultExceptionsHandler: ExceptionHandler? = null, - block: BehaviourContextReceiver -) { - BehaviourContext( - this, - scope.let { - if (defaultExceptionsHandler == null) { - it - } else { - it + ContextSafelyExceptionHandler(defaultExceptionsHandler) - } - }, - flowUpdatesFilter - ).block() -} - /** * Use this method in case you wish to make some additional actions with [flowUpdatesFilter]. * @@ -90,8 +60,8 @@ suspend fun TelegramBot.buildBehaviour( block: BehaviourContextReceiver ) = FlowsUpdatesFilter().let { buildBehaviour( - scope, it, + scope, defaultExceptionsHandler, block ) diff --git a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt index 4de838699d..dd972014fd 100644 --- a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt +++ b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt @@ -20,115 +20,6 @@ internal suspend inline fun BehaviourContext.onCallb (it.asCallbackQueryUpdate() ?.data as? T) ?.let(::listOfNotNull) } -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onDataCallbackQuery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onCallbackQuery( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) CallbackQueryFilterByUser else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onGameShortNameCallbackQuery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onCallbackQuery( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) CallbackQueryFilterByUser else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onInlineMessageIdCallbackQuery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onCallbackQuery( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) CallbackQueryFilterByUser else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onInlineMessageIdDataCallbackQuery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onCallbackQuery( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) CallbackQueryFilterByUser else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onInlineMessageIdGameShortNameCallbackQuery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onCallbackQuery( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) CallbackQueryFilterByUser else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onMessageCallbackQuery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onCallbackQuery( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) CallbackQueryFilterByUser else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onMessageDataCallbackQuery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onCallbackQuery( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) CallbackQueryFilterByUser else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onMessageGameShortNameCallbackQuery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onCallbackQuery( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) CallbackQueryFilterByUser else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onUnknownCallbackQueryType( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onCallbackQuery( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) CallbackQueryFilterByUser else null, - markerFactory, - scenarioReceiver -) - /** * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call * @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example, diff --git a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMemberUpdatedTriggers.kt b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMemberUpdatedTriggers.kt index f6dfb202fe..f39006f3a2 100644 --- a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMemberUpdatedTriggers.kt +++ b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMemberUpdatedTriggers.kt @@ -22,45 +22,6 @@ internal suspend inline fun BehaviourConte ((it as? U) ?.data) ?.let(::listOfNotNull) } -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onChatMemberUpdated( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByChatChatMemberUpdatedMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onChatMemberUpdatedInternal( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) ChatMemberUpdatedFilterByChat else null, - markerFactory, - scenarioReceiver -) - -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onCommonChatMemberUpdated( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByChatChatMemberUpdatedMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onChatMemberUpdatedInternal( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) ChatMemberUpdatedFilterByChat else null, - markerFactory, - scenarioReceiver -) - -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onMyChatMemberUpdated( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByChatChatMemberUpdatedMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onChatMemberUpdatedInternal( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) ChatMemberUpdatedFilterByChat else null, - markerFactory, - scenarioReceiver -) - /** * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call diff --git a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt index 6fc9e8317a..5273249781 100644 --- a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt +++ b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt @@ -15,118 +15,6 @@ import dev.inmo.tgbotapi.types.message.content.TextContent import dev.inmo.tgbotapi.types.update.abstracts.Update import kotlinx.coroutines.Job -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.command( - commandRegex: Regex, - requireOnlyCommandInMessage: Boolean = true, - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -): Job = onText( - includeFilterByChatInBehaviourSubContext, - CommonMessageFilter { message -> - val content = message.content - val textSources = content.textSources - val sizeRequirement = if (requireOnlyCommandInMessage) { - textSources.size == 1 - } else { - true - } - sizeRequirement && textSources.any { - commandRegex.matches(it.asBotCommandTextSource() ?.command ?: return@any false) - } && (additionalFilter ?.invoke(message) != false) - }.let { - additionalFilter ?.times(it) ?: it - }, - markerFactory, - scenarioReceiver -) - -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.command( - command: String, - requireOnlyCommandInMessage: Boolean = true, - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = command(command.toRegex(), requireOnlyCommandInMessage, includeFilterByChatInBehaviourSubContext, additionalFilter, markerFactory, scenarioReceiver) - -@Deprecated(OldAPITriggersDeprecationText) -suspend inline fun BehaviourContext.onCommand( - commandRegex: Regex, - requireOnlyCommandInMessage: Boolean = true, - includeFilterByChatInBehaviourSubContext: Boolean, - noinline additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - noinline scenarioReceiver: BehaviourContextAndTypeReceiver> -): Job = command(commandRegex, requireOnlyCommandInMessage, includeFilterByChatInBehaviourSubContext, additionalFilter, markerFactory, scenarioReceiver) - -@Deprecated(OldAPITriggersDeprecationText) -suspend inline fun BehaviourContext.onCommand( - command: String, - requireOnlyCommandInMessage: Boolean = true, - includeFilterByChatInBehaviourSubContext: Boolean, - noinline additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - noinline scenarioReceiver: BehaviourContextAndTypeReceiver> -): Job = onCommand(command.toRegex(), requireOnlyCommandInMessage, includeFilterByChatInBehaviourSubContext, additionalFilter, markerFactory, scenarioReceiver) - -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.commandWithArgs( - commandRegex: Regex, - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTwoTypesReceiver, Array> -) = command( - commandRegex, - requireOnlyCommandInMessage = false, - includeFilterByChatInBehaviourSubContext = includeFilterByChatInBehaviourSubContext, - additionalFilter = additionalFilter, - markerFactory = markerFactory -) { - val args = it.parseCommandsWithParams().let { commandsWithArgs -> - val key = commandsWithArgs.keys.firstOrNull { it.matches(commandRegex) } ?: return@let null - commandsWithArgs[key] - } ?: emptyArray() - scenarioReceiver(it, args) -} - -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.commandWithArgs( - command: String, - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTwoTypesReceiver, Array> -) = commandWithArgs( - command.toRegex(), - includeFilterByChatInBehaviourSubContext = includeFilterByChatInBehaviourSubContext, - additionalFilter = additionalFilter, - markerFactory = markerFactory, - scenarioReceiver = scenarioReceiver -) - -@Deprecated(OldAPITriggersDeprecationText) -suspend inline fun BehaviourContext.onCommandWithArgs( - commandRegex: Regex, - includeFilterByChatInBehaviourSubContext: Boolean, - noinline additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - noinline scenarioReceiver: BehaviourContextAndTwoTypesReceiver, Array> -): Job = commandWithArgs(commandRegex, includeFilterByChatInBehaviourSubContext, additionalFilter, markerFactory, scenarioReceiver) - -@Deprecated(OldAPITriggersDeprecationText) -suspend inline fun BehaviourContext.onCommandWithArgs( - command: String, - includeFilterByChatInBehaviourSubContext: Boolean, - noinline additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - noinline scenarioReceiver: BehaviourContextAndTwoTypesReceiver, Array> -): Job = onCommandWithArgs(command.toRegex(), includeFilterByChatInBehaviourSubContext, additionalFilter, markerFactory, scenarioReceiver) - suspend fun BehaviourContext.command( commandRegex: Regex, diff --git a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt index 246eaccdc6..028a97d102 100644 --- a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt +++ b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt @@ -37,267 +37,6 @@ internal suspend inline fun BehaviourContext.onCont } } -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onContentMessage( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - includeMediaGroups: Boolean = true, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: if (includeMediaGroups) null else CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onContact( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onDice( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onGame( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onLocation( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onPoll( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onText( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onVenue( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onAudioMediaGroup( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onDocumentMediaGroupContent( - includeFilterByChatInBehaviourSubContext: Boolean, - includeMediaGroups: Boolean = true, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: if (includeMediaGroups) null else CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onMediaCollection( - includeFilterByChatInBehaviourSubContext: Boolean, - includeMediaGroups: Boolean = false, - additionalFilter: SimpleFilter>>? = null, - markerFactory: MarkerFactory>, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver>> -) = onContent( - additionalFilter ?: if (includeMediaGroups) null else CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onMedia( - includeFilterByChatInBehaviourSubContext: Boolean, - includeMediaGroups: Boolean = true, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: if (includeMediaGroups) null else CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onAnimation( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onAudio( - includeFilterByChatInBehaviourSubContext: Boolean, - includeMediaGroups: Boolean = false, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: if (includeMediaGroups) null else CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onDocument( - includeFilterByChatInBehaviourSubContext: Boolean, - includeMediaGroups: Boolean = false, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: if (includeMediaGroups) null else CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onPhoto( - includeFilterByChatInBehaviourSubContext: Boolean, - includeMediaGroups: Boolean = false, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: if (includeMediaGroups) null else CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onSticker( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onVideo( - includeFilterByChatInBehaviourSubContext: Boolean, - includeMediaGroups: Boolean = false, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: if (includeMediaGroups) null else CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onVideoNote( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onVoice( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onInvoice( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: CommonMessageFilter? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onContent( - additionalFilter ?: CommonMessageFilterExcludeMediaGroups, - if (includeFilterByChatInBehaviourSubContext) { MessageFilterByChat } else null, - markerFactory, - scenarioReceiver -) - /** * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call diff --git a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt index b8fd04acc3..52876f5374 100644 --- a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt +++ b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt @@ -24,150 +24,6 @@ internal suspend inline fun BehaviourContext.onEvent( (it.asBaseSentMessageUpdate() ?.data ?.asChatEventMessage() ?.takeIf { it.chatEvent is T } as? ChatEventMessage) ?.let(::listOfNotNull) } -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onChannelEvent( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onChatEvent( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onVoiceChatEvent( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onVoiceChatStartedEvent( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onVoiceChatEndedEvent( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onVoiceChatParticipantsInvitedEvent( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onMessageAutoDeleteTimerChangedEvent( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onCommonEvent( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onGroupEvent( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onSupergroupEvent( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) - -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onChannelChatCreated( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onDeleteChatPhoto( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onGroupChatCreated( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onLeftChatMember( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onNewChatMembers( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onNewChatPhoto( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onNewChatTitle( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onPinnedMessage( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onProximityAlertTriggered( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onSupergroupChatCreated( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver> -) = onEvent(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, markerFactory, scenarioReceiver) - - - /** * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call * @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example, diff --git a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt index 52567eab55..be677995c9 100644 --- a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt +++ b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt @@ -18,33 +18,6 @@ internal suspend inline fun BehaviourContext.onInlineQ (it.asInlineQueryUpdate() ?.data as? T) ?.let(::listOfNotNull) } - -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onAnyInlineQuery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByUserInlineQueryMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onInlineQuery(additionalFilter, if (includeFilterByChatInBehaviourSubContext) InlineQueryFilterByUser else null, markerFactory, scenarioReceiver) - -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onBaseInlineQuery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByUserInlineQueryMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onInlineQuery(additionalFilter, if (includeFilterByChatInBehaviourSubContext) InlineQueryFilterByUser else null, markerFactory, scenarioReceiver) - -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onLocationInlineQuery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByUserInlineQueryMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onInlineQuery(additionalFilter, if (includeFilterByChatInBehaviourSubContext) InlineQueryFilterByUser else null, markerFactory, scenarioReceiver) - - - /** * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call * @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example, diff --git a/tgbotapi.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 f402d97c0a..7ba44da28f 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 @@ -25,58 +25,6 @@ internal suspend inline fun BehaviourContext.bui (it.asSentMediaGroupUpdate() ?.data ?.takeIf { it.all { it is T } } as? List>) ?.let(::listOfNotNull) } -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onMediaGroup( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>>? = null, - markerFactory: MarkerFactory>, Any> = ByChatMediaGroupMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver>> -) = buildMediaGroupTrigger(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessagesFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onPlaylist( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>>? = null, - markerFactory: MarkerFactory>, Any> = ByChatMediaGroupMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver>> -) = buildMediaGroupTrigger(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessagesFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onDocumentsGroup( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>>? = null, - markerFactory: MarkerFactory>, Any> = ByChatMediaGroupMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver>> -) = buildMediaGroupTrigger(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessagesFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onVisualGallery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>>? = null, - markerFactory: MarkerFactory>, Any> = ByChatMediaGroupMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver>> -) = buildMediaGroupTrigger(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessagesFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onVisualMediaGroup( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>>? = null, - markerFactory: MarkerFactory>, Any> = ByChatMediaGroupMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver>> -) = onVisualGallery(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessagesFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onPhotoGallery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>>? = null, - markerFactory: MarkerFactory>, Any> = ByChatMediaGroupMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver>> -) = buildMediaGroupTrigger(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessagesFilterByChat else null, markerFactory, scenarioReceiver) -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onVideoGallery( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter>>? = null, - markerFactory: MarkerFactory>, Any> = ByChatMediaGroupMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver>> -) = buildMediaGroupTrigger(additionalFilter, if (includeFilterByChatInBehaviourSubContext) MessagesFilterByChat else null, markerFactory, scenarioReceiver) - - - /** * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call * @param subcontextUpdatesFilter This filter will be applied to each update inside of [scenarioReceiver]. For example, diff --git a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt index 31de2cd1ba..84f1c177ec 100644 --- a/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt +++ b/tgbotapi.extensions.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt @@ -20,19 +20,6 @@ internal suspend inline fun BehaviourCont (it.asMessageUpdate() ?.data ?.asPassportMessage() ?.takeIf { it.passportData.data.any { it is T } }) ?.let(::listOfNotNull) } -@Deprecated(OldAPITriggersDeprecationText) -suspend fun BehaviourContext.onPassportMessage( - includeFilterByChatInBehaviourSubContext: Boolean, - additionalFilter: SimpleFilter? = null, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, - scenarioReceiver: BehaviourContextAndTypeReceiver -) = onPassportMessageWith( - additionalFilter, - if (includeFilterByChatInBehaviourSubContext) MessageFilterByChat else null, - markerFactory, - scenarioReceiver -) - /** * @param initialFilter This filter will be called to remove unnecessary data BEFORE [scenarioReceiver] call diff --git a/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/FlowsUpdatesFilter.kt b/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/FlowsUpdatesFilter.kt index 168c4ca798..202785be46 100644 --- a/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/FlowsUpdatesFilter.kt +++ b/tgbotapi.extensions.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/extensions/FlowsUpdatesFilter.kt @@ -5,17 +5,3 @@ import dev.inmo.tgbotapi.types.update.abstracts.BaseSentMessageUpdate import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.merge - -@Deprecated("Will be removed soon", ReplaceWith("messagesFlow + channelPostsFlow")) -val FlowsUpdatesFilter.allSentMessagesFlow: Flow - get() = merge( - messagesFlow, - channelPostsFlow - ) - -@Deprecated("Will be removed soon", ReplaceWith("messageMediaGroupsFlow + channelPostMediaGroupsFlow")) -val FlowsUpdatesFilter.allSentMediaGroupsFlow: Flow - get() = merge( - messageMediaGroupsFlow, - channelPostMediaGroupsFlow - ) diff --git a/tgbotapi.extensions.utils/src/jvmMain/kotlin/dev/inmo/tgbotapi/types/files/PathedFile.kt b/tgbotapi.extensions.utils/src/jvmMain/kotlin/dev/inmo/tgbotapi/types/files/PathedFile.kt index e0cfe38006..cffc04184f 100644 --- a/tgbotapi.extensions.utils/src/jvmMain/kotlin/dev/inmo/tgbotapi/types/files/PathedFile.kt +++ b/tgbotapi.extensions.utils/src/jvmMain/kotlin/dev/inmo/tgbotapi/types/files/PathedFile.kt @@ -2,29 +2,8 @@ package dev.inmo.tgbotapi.types.files import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper import java.io.* -import java.io.File import java.net.URL fun PathedFile.asStream( - telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper + telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper ): InputStream = URL(this.fullUrl(telegramAPIUrlsKeeper)).openStream() - -@Deprecated("This api will be removed soon. Use `downloadFile` instead") -fun PathedFile.asFile( - telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper, - dest: File = File.createTempFile(this.fileUniqueId, this.filename), - defaultBufferSize: Int = DEFAULT_BUFFER_SIZE -): File { - this.asStream(telegramAPIUrlsKeeper).use { input -> - FileOutputStream(dest).use { out -> - input.copyTo(out, defaultBufferSize) - } - } - return dest -} - -@Deprecated("This api will be removed soon. Use `downloadFile` instead") -fun PathedFile.asBytes( - telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper -): ByteArray = this.asStream(telegramAPIUrlsKeeper) - .use { input -> input.readBytes() }