1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 16:23:48 +00:00

third part of deprecations removing

This commit is contained in:
InsanusMokrassar 2019-12-02 14:48:23 +06:00
parent ed60dc49e7
commit e296c2ee00
7 changed files with 9 additions and 66 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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))
}
) : RequestsExecutor

View File

@ -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<KtorCallFactory> = 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<KtorCallFactory> = callsFactories.run {
if (!excludeDefaultFactories) {
asSequence().plus(SimpleRequestCallFactory()).plus(MultipartRequestCallFactory()).toList()

View File

@ -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

View File

@ -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