mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-16 05:40:32 +00:00
update dependencies
This commit is contained in:
@@ -1,79 +0,0 @@
|
||||
package dev.inmo.tgbotapi.CommonAbstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.*
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.MultilevelTextSource
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.separateForCaption
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.separateForMessage
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.separateForText
|
||||
import dev.inmo.tgbotapi.types.captionLength
|
||||
import dev.inmo.tgbotapi.types.textLength
|
||||
import dev.inmo.tgbotapi.utils.extensions.makeString
|
||||
|
||||
const val DirectInvocationOfTextSourceConstructor =
|
||||
"It is strongly not recommended to use constructors directly instead of factory methods"
|
||||
|
||||
@Deprecated(
|
||||
"Replaced",
|
||||
ReplaceWith("TextSourcesList", "dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList")
|
||||
)
|
||||
typealias TextSourcesList = TextSourcesList
|
||||
|
||||
@Deprecated("Replaced", ReplaceWith("TextSource", "dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource"))
|
||||
typealias TextSource = TextSource
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
@Deprecated("Replaced", ReplaceWith("plus", "dev.inmo.tgbotapi.types.MessageEntity.textsources.plus"))
|
||||
inline operator fun TextSource.plus(other: TextSource) =
|
||||
listOf(this, other)
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
@Deprecated("Replaced", ReplaceWith("plus", "dev.inmo.tgbotapi.types.MessageEntity.textsources.plus"))
|
||||
inline operator fun TextSource.plus(other: List<TextSource>) =
|
||||
listOf(this) + other
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
@Deprecated("Replaced", ReplaceWith("plus", "dev.inmo.tgbotapi.types.MessageEntity.textsources.plus"))
|
||||
inline operator fun TextSource.plus(text: String) =
|
||||
listOf(this, regular(text))
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
@Deprecated("Replaced", ReplaceWith("plus", "dev.inmo.tgbotapi.types.MessageEntity.textsources.plus"))
|
||||
inline operator fun List<TextSource>.plus(text: String) = this + regular(text)
|
||||
|
||||
@Deprecated(
|
||||
"Replaced",
|
||||
ReplaceWith("MultilevelTextSource", "dev.inmo.tgbotapi.types.MessageEntity.textsources.MultilevelTextSource")
|
||||
)
|
||||
typealias MultilevelTextSource = MultilevelTextSource
|
||||
|
||||
@Deprecated("Replaced", ReplaceWith("makeString()", "dev.inmo.tgbotapi.utils.extensions.makeString"))
|
||||
fun List<TextSource>.makeString() = makeString()
|
||||
|
||||
@Deprecated(
|
||||
"Replaced",
|
||||
ReplaceWith("separateForMessage", "dev.inmo.tgbotapi.types.MessageEntity.textsources.separateForMessage")
|
||||
)
|
||||
fun List<TextSource>.separateForMessage(limit: IntRange, numberOfParts: Int? = null) =
|
||||
separateForMessage(limit, numberOfParts)
|
||||
|
||||
/**
|
||||
* This method will prepare [TextSource]s list for messages. Remember, that first part will be separated with
|
||||
* [captionLength] and all others with
|
||||
*/
|
||||
@Deprecated(
|
||||
"Replaced",
|
||||
ReplaceWith("separateForCaption", "dev.inmo.tgbotapi.types.MessageEntity.textsources.separateForCaption")
|
||||
)
|
||||
fun List<TextSource>.separateForCaption() = separateForCaption()
|
||||
|
||||
/**
|
||||
* This method will prepare [TextSource]s list for messages with [textLength]
|
||||
*/
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
@Deprecated(
|
||||
"Replaced",
|
||||
ReplaceWith("separateForText", "dev.inmo.tgbotapi.types.MessageEntity.textsources.separateForText")
|
||||
)
|
||||
inline fun List<TextSource>.separateForText() = separateForText()
|
@@ -35,7 +35,4 @@ class MultipartRequestCallFactory : AbstractRequestCallFactory() {
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@Deprecated("Use class MultipartRequestCallFactory() constructor call instead of just MultipartRequestCallFactory")
|
||||
companion object : KtorCallFactory by MultipartRequestCallFactory()
|
||||
}
|
||||
|
@@ -20,7 +20,4 @@ class SimpleRequestCallFactory : AbstractRequestCallFactory() {
|
||||
ContentType.Application.Json
|
||||
)
|
||||
}
|
||||
|
||||
@Deprecated("Use class SimpleRequestCallFactory() constructor call instead of just SimpleRequestCallFactory")
|
||||
companion object : KtorCallFactory by SimpleRequestCallFactory()
|
||||
}
|
||||
|
@@ -64,21 +64,11 @@ data class MultipartFile (
|
||||
val filename: String = file.storageFileInfo.fileName
|
||||
) : InputFile() {
|
||||
override val fileId: String = file.storageFileInfo.generateCustomName()
|
||||
|
||||
@Deprecated("This constructor is redundant. Use constructor without mime type")
|
||||
constructor(file: StorageFile, mimeType: String, filename: String): this(file, filename)
|
||||
}
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE", "unused")
|
||||
inline fun StorageFile.asMultipartFile() = MultipartFile(this)
|
||||
|
||||
@Deprecated("This method is redundant. Use asMultipartFile without mime type")
|
||||
@Suppress("NOTHING_TO_INLINE", "unused")
|
||||
inline fun ByteArray.asMultipartFile(
|
||||
fileName: String,
|
||||
mimeType: MimeType
|
||||
) = MultipartFile(asStorageFile(fileName))
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE", "unused")
|
||||
suspend inline fun ByteReadChannel.asMultipartFile(
|
||||
fileName: String
|
||||
|
@@ -18,6 +18,3 @@ data class GetChatMemberCount(
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
}
|
||||
|
||||
@Deprecated("Renamed", ReplaceWith("GetChatMemberCount", "dev.inmo.tgbotapi.requests.chat.get.GetChatMemberCount"))
|
||||
typealias GetChatMembersCount = GetChatMemberCount
|
||||
|
@@ -23,6 +23,3 @@ data class BanChatMember(
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
}
|
||||
|
||||
@Deprecated("Renamed", ReplaceWith("BanChatMember", "dev.inmo.tgbotapi.requests.chat.members.BanChatMember"))
|
||||
typealias KickChatMember = BanChatMember
|
||||
|
@@ -10,6 +10,3 @@ data class LeftChatMemberImpl(@SerialName(userField) override val user: User) :
|
||||
@Required
|
||||
private val type: String = "left"
|
||||
}
|
||||
|
||||
@Deprecated("Renamed", ReplaceWith("LeftChatMemberImpl", "dev.inmo.tgbotapi.types.ChatMember.LeftChatMemberImpl"))
|
||||
typealias LeftChatMember = LeftChatMemberImpl
|
||||
|
@@ -10,6 +10,3 @@ data class MemberChatMemberImpl(@SerialName(userField) override val user: User)
|
||||
@Required
|
||||
private val type: String = "member"
|
||||
}
|
||||
|
||||
@Deprecated("Renamed", ReplaceWith("MemberChatMember", "dev.inmo.tgbotapi.types.ChatMember.MemberChatMemberImpl"))
|
||||
typealias MemberChatMember = MemberChatMemberImpl
|
||||
|
@@ -1,6 +0,0 @@
|
||||
package dev.inmo.tgbotapi.types.InlineQueries.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult
|
||||
|
||||
@Deprecated("Replaced", ReplaceWith("ChosenInlineResult", "dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult"))
|
||||
typealias ChosenInlineResult = ChosenInlineResult
|
@@ -1,6 +0,0 @@
|
||||
package dev.inmo.tgbotapi.types.InlineQueries.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
|
||||
|
||||
@Deprecated("Replaced", ReplaceWith("InlineQuery", "dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery"))
|
||||
typealias InlineQuery = InlineQuery
|
@@ -1,6 +0,0 @@
|
||||
package dev.inmo.tgbotapi.types.InlineQueries.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputMessageContent
|
||||
|
||||
@Deprecated("Replaced", ReplaceWith("InputMessageContent", "dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputMessageContent"))
|
||||
typealias InputMessageContent = InputMessageContent
|
@@ -2,7 +2,6 @@ package dev.inmo.tgbotapi.types.MessageEntity.textsources
|
||||
|
||||
import dev.inmo.tgbotapi.types.captionLength
|
||||
import dev.inmo.tgbotapi.types.textLength
|
||||
import dev.inmo.tgbotapi.utils.extensions.makeString
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
const val DirectInvocationOfTextSourceConstructor = "It is strongly not recommended to use constructors directly instead of factory methods"
|
||||
@@ -43,8 +42,6 @@ sealed interface MultilevelTextSource : TextSource {
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Replaced", ReplaceWith("makeString()", "dev.inmo.tgbotapi.utils.extensions.makeString"))
|
||||
fun TextSourcesList.makeString() = makeString(null)
|
||||
fun List<TextSource>.separateForMessage(limit: IntRange, numberOfParts: Int? = null): List<List<TextSource>> {
|
||||
if (isEmpty()) {
|
||||
return emptyList()
|
||||
|
@@ -26,6 +26,3 @@ data class ReplyForce(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Renamed", ReplaceWith("ReplyForce", "dev.inmo.tgbotapi.types.buttons.ReplyForce"))
|
||||
typealias ForceReply = ReplyForce
|
||||
|
@@ -24,8 +24,5 @@ data class PathedFile(
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Use fileName property instead", ReplaceWith("fileName"))
|
||||
val PathedFile.filename: FileName
|
||||
get() = filePath.filenameFromUrl
|
||||
fun TelegramAPIUrlsKeeper.resolveFileURL(file: PathedFile): String = "$fileBaseUrl/${file.filePath}"
|
||||
fun PathedFile.fullUrl(keeper: TelegramAPIUrlsKeeper): String = keeper.resolveFileURL(this)
|
||||
|
@@ -32,61 +32,6 @@ interface FlowsUpdatesFilter : UpdatesFilter {
|
||||
val chatMemberUpdatesFlow: Flow<CommonChatMemberUpdatedUpdate>
|
||||
val myChatMemberUpdatesFlow: Flow<MyChatMemberUpdatedUpdate>
|
||||
val unknownUpdatesFlow: Flow<UnknownUpdate>
|
||||
|
||||
@Deprecated("Renamed", ReplaceWith("messagesFlow"))
|
||||
val messageFlow: Flow<MessageUpdate>
|
||||
get() = messagesFlow
|
||||
@Deprecated("Renamed", ReplaceWith("messageMediaGroupsFlow"))
|
||||
val messageMediaGroupFlow: Flow<MessageMediaGroupUpdate>
|
||||
get() = messageMediaGroupsFlow
|
||||
@Deprecated("Renamed", ReplaceWith("editedMessagesFlow"))
|
||||
val editedMessageFlow: Flow<EditMessageUpdate>
|
||||
get() = editedMessagesFlow
|
||||
@Deprecated("Renamed", ReplaceWith("editedMessageMediaGroupsFlow"))
|
||||
val editedMessageMediaGroupFlow: Flow<EditMessageMediaGroupUpdate>
|
||||
get() = editedMessageMediaGroupsFlow
|
||||
@Deprecated("Renamed", ReplaceWith("channelPostsFlow"))
|
||||
val channelPostFlow: Flow<ChannelPostUpdate>
|
||||
get() = channelPostsFlow
|
||||
@Deprecated("Renamed", ReplaceWith("channelPostMediaGroupsFlow"))
|
||||
val channelPostMediaGroupFlow: Flow<ChannelPostMediaGroupUpdate>
|
||||
get() = channelPostMediaGroupsFlow
|
||||
@Deprecated("Renamed", ReplaceWith("editedChannelPostsFlow"))
|
||||
val editedChannelPostFlow: Flow<EditChannelPostUpdate>
|
||||
get() = editedChannelPostsFlow
|
||||
@Deprecated("Renamed", ReplaceWith("editedChannelPostMediaGroupsFlow"))
|
||||
val editedChannelPostMediaGroupFlow: Flow<EditChannelPostMediaGroupUpdate>
|
||||
get() = editedChannelPostMediaGroupsFlow
|
||||
@Deprecated("Renamed", ReplaceWith("chosenInlineResultsFlow"))
|
||||
val chosenInlineResultFlow: Flow<ChosenInlineResultUpdate>
|
||||
get() = chosenInlineResultsFlow
|
||||
@Deprecated("Renamed", ReplaceWith("inlineQueriesFlow"))
|
||||
val inlineQueryFlow: Flow<InlineQueryUpdate>
|
||||
get() = inlineQueriesFlow
|
||||
@Deprecated("Renamed", ReplaceWith("callbackQueriesFlow"))
|
||||
val callbackQueryFlow: Flow<CallbackQueryUpdate>
|
||||
get() = callbackQueriesFlow
|
||||
@Deprecated("Renamed", ReplaceWith("shippingQueriesFlow"))
|
||||
val shippingQueryFlow: Flow<ShippingQueryUpdate>
|
||||
get() = shippingQueriesFlow
|
||||
@Deprecated("Renamed", ReplaceWith("preCheckoutQueriesFlow"))
|
||||
val preCheckoutQueryFlow: Flow<PreCheckoutQueryUpdate>
|
||||
get() = preCheckoutQueriesFlow
|
||||
@Deprecated("Renamed", ReplaceWith("pollsFlow"))
|
||||
val pollFlow: Flow<PollUpdate>
|
||||
get() = pollsFlow
|
||||
@Deprecated("Renamed", ReplaceWith("pollAnswersFlow"))
|
||||
val pollAnswerFlow: Flow<PollAnswerUpdate>
|
||||
get() = pollAnswersFlow
|
||||
@Deprecated("Renamed", ReplaceWith("chatMemberUpdatesFlow"))
|
||||
val chatMemberUpdatedFlow: Flow<CommonChatMemberUpdatedUpdate>
|
||||
get() = chatMemberUpdatesFlow
|
||||
@Deprecated("Renamed", ReplaceWith("myChatMemberUpdatesFlow"))
|
||||
val myChatMemberUpdatedFlow: Flow<MyChatMemberUpdatedUpdate>
|
||||
get() = myChatMemberUpdatesFlow
|
||||
@Deprecated("Renamed", ReplaceWith("unknownUpdatesFlow"))
|
||||
val unknownUpdateTypeFlow: Flow<UnknownUpdate>
|
||||
get() = unknownUpdatesFlow
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -16,12 +16,6 @@ import kotlinx.serialization.Serializable
|
||||
data class StorageFileInfo(
|
||||
val fileName: String
|
||||
) {
|
||||
@Deprecated("This constructor is redundant. Use constructor without mime type")
|
||||
constructor(
|
||||
contentType: String,
|
||||
fileName: String
|
||||
): this(fileName)
|
||||
|
||||
/**
|
||||
* This methods is required for random generation of name for keeping warranties about unique file name
|
||||
*/
|
||||
@@ -45,18 +39,6 @@ data class StorageFile(
|
||||
get() = inputSource()
|
||||
}
|
||||
|
||||
@Deprecated("This constructor is redundant. Use constructor without mime type")
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun StorageFile(
|
||||
fileName: String,
|
||||
bytes: ByteArray,
|
||||
mimeType: MimeType
|
||||
) = StorageFile(
|
||||
StorageFileInfo(fileName)
|
||||
) {
|
||||
ByteReadPacket(bytes)
|
||||
}
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun StorageFile(
|
||||
fileName: String,
|
||||
@@ -81,13 +63,6 @@ inline fun ByteArray.asStorageFile(
|
||||
fileName: String
|
||||
) = StorageFile(fileName, this)
|
||||
|
||||
@Deprecated("This constructor is redundant. Use constructor without mime type")
|
||||
@Suppress("NOTHING_TO_INLINE", "unused")
|
||||
inline fun ByteArray.asStorageFile(
|
||||
fileName: String,
|
||||
mimeType: MimeType
|
||||
) = asStorageFile(fileName)
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE", "unused")
|
||||
suspend inline fun ByteReadChannel.asStorageFile(
|
||||
fileName: String
|
||||
|
Reference in New Issue
Block a user