diff --git a/CHANGELOG.md b/CHANGELOG.md index e4fcf056a5..8a1edb6593 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,13 @@ * Total rework of serialization for requests. Now all `SimpleRequest` children have: * `requestSerializer` - field, which must provide serializer of current type * `resultDeserializer` - field, which must provide opportunity to deserializer result. Previously it was a function - +* Removed deprecations: + * `com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.WebhookPrivateKeyConfig` + * `com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.UpdatesFilter` + * `com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.createSimpleUpdateFilter` + * `com.github.insanusmokrassar.TelegramBotAPI.utils.createMarkdownText` + * `com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaption` + * `com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownText` ## 0.18.0 Raws cleaning diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/MarkdownCaptionSourcer.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/MarkdownCaptionSourcer.kt index f1ebbc0f6d..30d32aa32e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/MarkdownCaptionSourcer.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/MarkdownCaptionSourcer.kt @@ -7,46 +7,16 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.captionLength import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.TextContent import com.github.insanusmokrassar.TelegramBotAPI.types.textLength -@Deprecated( - "Deprecated because old version have problem with long texts, but new one must return list of strings" -) -fun createMarkdownText( - text: String, - messageEntities: List -): String { - return createMarkdownText( - convertToFullMessageEntityList(text, messageEntities) - ).first() -} - fun createMarkdownText( entities: List, partLength: Int = 4096 ): List = createFormattedText(entities, partLength, MarkdownParseMode) -@Deprecated( - "Deprecated because old version have problem with long texts, but new one must return list of strings", - ReplaceWith( - "toMarkdownCaptions().firstOrNull()", - "com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaptions" - ) -) -fun CaptionedInput.toMarkdownCaption(): String? = toMarkdownCaptions().firstOrNull() - fun CaptionedInput.toMarkdownCaptions(): List = createMarkdownText( fullEntitiesList(), captionLength.endInclusive + 1 ) -@Deprecated( - "Deprecated because old version have problem with long texts, but new one must return list of strings", - ReplaceWith( - "toMarkdownTexts().first()", - "com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownTexts" - ) -) -fun TextContent.toMarkdownText(): String = toMarkdownTexts().first() - fun TextContent.toMarkdownTexts(): List = createMarkdownText( fullEntitiesList(), textLength.endInclusive + 1 diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/UpdatesFilter.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/UpdatesFilter.kt deleted file mode 100644 index 4538d225ad..0000000000 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/UpdatesFilter.kt +++ /dev/null @@ -1,45 +0,0 @@ -package com.github.insanusmokrassar.TelegramBotAPI.utils.extensions - -import com.github.insanusmokrassar.TelegramBotAPI.types.update.* -import com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdates.MediaGroupUpdate -import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.UpdatesFilter - -@Deprecated( - "Replaced in separated package", - ReplaceWith( - "UpdatesFilter", - "com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.UpdatesFilter" - ) -) -typealias UpdatesFilter = UpdatesFilter - -@Deprecated( - "Replaced in separated package", - ReplaceWith( - "createSimpleUpdateFilter", - "com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.createSimpleUpdateFilter" - ) -) -fun createSimpleUpdateFilter( - messageCallback: UpdateReceiver? = null, - mediaGroupCallback: UpdateReceiver? = null, - editedMessageCallback: UpdateReceiver? = null, - channelPostCallback: UpdateReceiver? = null, - editedChannelPostCallback: UpdateReceiver? = null, - chosenInlineResultCallback: UpdateReceiver? = null, - inlineQueryCallback: UpdateReceiver? = null, - callbackQueryCallback: UpdateReceiver? = null, - shippingQueryCallback: UpdateReceiver? = null, - preCheckoutQueryCallback: UpdateReceiver? = null -): UpdatesFilter = com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.createSimpleUpdateFilter( - messageCallback, - mediaGroupCallback, - editedMessageCallback, - channelPostCallback, - editedChannelPostCallback, - chosenInlineResultCallback, - inlineQueryCallback, - callbackQueryCallback, - shippingQueryCallback, - preCheckoutQueryCallback -) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/WebhookPrivateKeyConfig.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/WebhookPrivateKeyConfig.kt deleted file mode 100644 index 9462b67e2b..0000000000 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/WebhookPrivateKeyConfig.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.github.insanusmokrassar.TelegramBotAPI.utils.extensions - -import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.webhook.WebhookPrivateKeyConfig - -@Deprecated( - "Replaced in separated package", - ReplaceWith( - "WebhookPrivateKeyConfig", - "com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.webhook.WebhookPrivateKeyConfig" - ) -) -typealias WebhookPrivateKeyConfig = WebhookPrivateKeyConfig