mirror of
				https://github.com/InsanusMokrassar/TelegramBotAPI.git
				synced 2025-11-03 21:50:13 +00:00 
			
		
		
		
	second part of deprecations removing
This commit is contained in:
		@@ -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>
 | 
			
		||||
@@ -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
 | 
			
		||||
@@ -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"
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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,
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
@@ -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,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user