From e296c2ee00c48ef68688d340ff72c2d90dbb82db Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 2 Dec 2019 14:48:23 +0600 Subject: [PATCH] third part of deprecations removing --- CHANGELOG.md | 8 +++++++ .../types/ByInlineMessageId.kt | 7 ------ .../CommonAbstracts/types/ByMessageId.kt | 8 ------- .../bot/BaseRequestsExecutor.kt | 12 +--------- .../bot/Ktor/KtorRequestsExecutor.kt | 22 ------------------- .../TelegramBotAPI/bot/RequestException.kt | 12 ---------- .../bot/exceptions/RequestException.kt | 6 ----- 7 files changed, 9 insertions(+), 66 deletions(-) delete mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByInlineMessageId.kt delete mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByMessageId.kt delete mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestException.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d436f0bd7..0945021b5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,14 @@ * `com.github.insanusmokrassar.TelegramBotAPI.types.files.PathedFileKt.makeFileUrl` * `com.github.insanusmokrassar.TelegramBotAPI.types.files.PathedFileKt.downloadingFilesBaseUrl` * `com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.Data` + * `com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ByInlineMessageId` + * `com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ByMessageId` + * `com.github.insanusmokrassar.TelegramBotAPI.bot.RequestException` + * `com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.ReplyMessageNotFound` + * `com.github.insanusmokrassar.TelegramBotAPI.bot.BaseRequestsExecutor#baseUrl` + * `com.github.insanusmokrassar.TelegramBotAPI.bot.BaseRequestsExecutor#constructor(token, hostUrl)` + * `com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.KtorRequestsExecutor#constructor(token, client, hostUrl, callsFactories, excludeDefaultFactories, requestsLimiter, jsonFormatter)` + * `com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.KtorRequestsExecutor#constructor(token, engine, hostUrl)` ## 0.18.0 Raws cleaning diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByInlineMessageId.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByInlineMessageId.kt deleted file mode 100644 index a2b66df4b6..0000000000 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByInlineMessageId.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types - -@Deprecated( - "Deprecated for the reason of creating of more obvious type interface", - ReplaceWith("InlineMessageAction", "com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.InlineMessageAction") -) -typealias ByInlineMessageId = InlineMessageAction \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByMessageId.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByMessageId.kt deleted file mode 100644 index e208e86096..0000000000 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ByMessageId.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types - -@Deprecated( - "Deprecated for the reason of creating of more obvious type interface", - ReplaceWith("MessageAction", "com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.MessageAction") - -) -typealias ByMessageId = MessageAction \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/BaseRequestsExecutor.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/BaseRequestsExecutor.kt index 3aef77e43a..a971a939ae 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/BaseRequestsExecutor.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/BaseRequestsExecutor.kt @@ -4,14 +4,4 @@ import com.github.insanusmokrassar.TelegramBotAPI.utils.TelegramAPIUrlsKeeper abstract class BaseRequestsExecutor( protected val telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper -) : RequestsExecutor { - @Deprecated("Deprecated due to new TelegramAPIUrlKeeper API", ReplaceWith("telegramAPIUrlsKeeper.commonAPIUrl")) - protected val baseUrl: String - get() = telegramAPIUrlsKeeper.commonAPIUrl - - @Deprecated("Deprecated due to new TelegramAPIUrlKeeper API") - constructor( - token: String, - hostUrl: String = "https://api.telegram.org" - ) : this (TelegramAPIUrlsKeeper(token, hostUrl)) -} \ No newline at end of file +) : RequestsExecutor diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt index a0a3d4efe6..bd768347fe 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt @@ -25,28 +25,6 @@ class KtorRequestsExecutor( private val requestsLimiter: RequestLimiter = EmptyLimiter, private val jsonFormatter: Json = Json.nonstrict ) : BaseRequestsExecutor(telegramAPIUrlsKeeper) { - - @Deprecated("Deprecated due to new TelegramAPIUrlKeeper API") - constructor( - token: String, - client: HttpClient = HttpClient(), - hostUrl: String = "https://api.telegram.org", - callsFactories: List = emptyList(), - excludeDefaultFactories: Boolean = false, - requestsLimiter: RequestLimiter = EmptyLimiter, - jsonFormatter: Json = Json.nonstrict - ) : this(TelegramAPIUrlsKeeper(token, hostUrl), client, callsFactories, excludeDefaultFactories, requestsLimiter, jsonFormatter) - - @Deprecated("Deprecated due to new TelegramAPIUrlKeeper API") - constructor( - token: String, - engine: HttpClientEngine? = null, - hostUrl: String = "https://api.telegram.org" - ) : this( - TelegramAPIUrlsKeeper(token, hostUrl), - engine ?.let { HttpClient(engine) } ?: HttpClient() - ) - private val callsFactories: List = callsFactories.run { if (!excludeDefaultFactories) { asSequence().plus(SimpleRequestCallFactory()).plus(MultipartRequestCallFactory()).toList() diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestException.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestException.kt deleted file mode 100644 index a531196030..0000000000 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/RequestException.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.github.insanusmokrassar.TelegramBotAPI.bot - -import com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException - -@Deprecated( - "Replaced to another package", - ReplaceWith( - "RequestException", - "com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.RequestException" - ) -) -typealias RequestException = RequestException \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/exceptions/RequestException.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/exceptions/RequestException.kt index 9fd0ef8e03..0176512f7e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/exceptions/RequestException.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/exceptions/RequestException.kt @@ -32,9 +32,3 @@ class UnauthorizedException(response: Response, plainAnswer: String, message: St class ReplyMessageNotFoundException(response: Response, plainAnswer: String, message: String?, cause: Throwable?) : RequestException(response, plainAnswer, message, cause) - -@Deprecated( - "Replaced by ReplyMessageNotFoundException", - ReplaceWith("ReplyMessageNotFoundException", "com.github.insanusmokrassar.TelegramBotAPI.bot.exceptions.ReplyMessageNotFoundException") -) -typealias ReplyMessageNotFound = ReplyMessageNotFoundException \ No newline at end of file