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

second part of deprecations removing

This commit is contained in:
InsanusMokrassar 2019-12-02 14:44:23 +06:00
parent c1b5b3ca19
commit ed60dc49e7
8 changed files with 10 additions and 82 deletions

View File

@ -12,6 +12,15 @@
* `com.github.insanusmokrassar.TelegramBotAPI.utils.createMarkdownText`
* `com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownCaption`
* `com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownText`
* `com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.KtorUpdatesPoller`
* `com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.CaptionedMediaContent`
* `com.github.insanusmokrassar.TelegramBotAPI.types.message.CommonForwardedMessage`
* `com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.CaptionedInputMedia`
* `com.github.insanusmokrassar.TelegramBotAPI.types.games.Game#text`
* `com.github.insanusmokrassar.TelegramBotAPI.types.games.Game#textEntities`
* `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`
## 0.18.0 Raws cleaning

View File

@ -1,10 +0,0 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base
@Deprecated(
"Renamed to DataRequest",
ReplaceWith(
"DataRequest",
"com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.DataRequest"
)
)
typealias Data<T> = DataRequest<T>

View File

@ -1,9 +0,0 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CaptionedOutput
@Deprecated(
"Deprecated due to replace by common type CaptionedOutput",
ReplaceWith("CaptionedOutput", "com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CaptionedOutput")
)
typealias CaptionedInputMedia = CaptionedOutput

View File

@ -18,15 +18,3 @@ data class PathedFile(
fun TelegramAPIUrlsKeeper.resolveFileURL(file: PathedFile): String = "$fileBaseUrl/${file.filePath}"
inline fun PathedFile.fullUrl(keeper: TelegramAPIUrlsKeeper): String = keeper.resolveFileURL(this)
@Deprecated("Deprecated due to old API", ReplaceWith("fullUrl(telegramApiUrlsKeeper)"))
fun PathedFile.makeFileUrl(
botToken: String,
apiHost: String = "https://api.telegram.org"
) = "${downloadingFilesBaseUrl(botToken, apiHost)}/$filePath"
@Deprecated("Deprecated due to old API", ReplaceWith("telegramApiUrlsKeeper.fileBaseUrl"))
fun downloadingFilesBaseUrl(
botToken: String,
apiHost: String
) = "$apiHost/file/bot$botToken"

View File

@ -14,20 +14,4 @@ data class Game(
override val caption: String? = null,
override val captionEntities: List<MessageEntity> = emptyList(),
val animation: AnimationFile? = null
) : Titled, CaptionedInput {
@Deprecated(
"Missinterfaced field",
ReplaceWith("caption")
)
@Transient
val text: String?
get() = caption
@Deprecated(
"Missinterfaced field",
ReplaceWith("captionEntities")
)
@Transient
val textEntities: List<MessageEntity>?
get() = captionEntities
}
) : Titled, CaptionedInput

View File

@ -17,12 +17,6 @@ data class UserForwardedMessage(
val from: User
) : ForwardedMessage()
@Deprecated(
"Renamed according to correct meaning",
ReplaceWith("UserForwardedMessage", "com.github.insanusmokrassar.TelegramBotAPI.types.message.UserForwardedMessage")
)
typealias CommonForwardedMessage = UserForwardedMessage
data class ForwardedFromChannelMessage(
override val dateOfOriginal: TelegramDate,
val messageId: MessageIdentifier,

View File

@ -1,9 +0,0 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CaptionedInput
@Deprecated(
"Deprecated due to replace by common type CaptionedInput",
ReplaceWith("CaptionedInput", "com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CaptionedInput")
)
typealias CaptionedMediaContent = CaptionedInput

View File

@ -50,25 +50,6 @@ fun KtorUpdatesPoller(
)
}
@Deprecated("Deprecated due to new TelegramAPIUrlsKeeper")
fun KtorUpdatesPoller(
token: String,
timeoutSeconds: Int? = null,
oneTimeUpdatesLimit: Int? = null,
allowedUpdates: List<String> = ALL_UPDATES_LIST,
exceptionsHandler: (Exception) -> Boolean = { true },
updatesReceiver: UpdateReceiver<Update>
): KtorUpdatesPoller {
return KtorUpdatesPoller(
TelegramAPIUrlsKeeper(token),
timeoutSeconds,
oneTimeUpdatesLimit,
allowedUpdates,
exceptionsHandler,
updatesReceiver
)
}
class KtorUpdatesPoller(
private val executor: RequestsExecutor,
private val timeoutSeconds: Int? = null,