mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-26 03:58:44 +00:00
optimize imports
This commit is contained in:
parent
0ef4341baf
commit
a09af8870a
@ -5,8 +5,13 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.call.HttpClientCall
|
||||
import io.ktor.client.call.call
|
||||
import io.ktor.client.request.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.client.request.accept
|
||||
import io.ktor.client.request.url
|
||||
import io.ktor.http.ContentType
|
||||
import io.ktor.http.HttpMethod
|
||||
import kotlin.collections.MutableMap
|
||||
import kotlin.collections.mutableMapOf
|
||||
import kotlin.collections.set
|
||||
|
||||
abstract class AbstractRequestCallFactory : KtorCallFactory {
|
||||
private val methodsCache: MutableMap<String, String> = mutableMapOf()
|
||||
|
@ -7,7 +7,6 @@ import io.ktor.client.request.forms.MultiPartFormDataContent
|
||||
import io.ktor.client.request.forms.formData
|
||||
import io.ktor.http.Headers
|
||||
import io.ktor.http.HttpHeaders
|
||||
import kotlinx.io.core.readBytes
|
||||
|
||||
class MultipartRequestCallFactory : AbstractRequestCallFactory() {
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.base
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.toJsonWithoutNulls
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.http.ContentType
|
||||
import io.ktor.http.content.TextContent
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts
|
||||
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.DeserializationStrategy
|
||||
|
||||
interface Request<T: Any> {
|
||||
fun method(): String
|
||||
|
@ -4,7 +4,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleReque
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.PreCheckoutQueryId
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.internal.BooleanSerializer
|
||||
import kotlinx.serialization.serializer
|
||||
|
||||
interface AnswerPreCheckoutQuery : SimpleRequest<Boolean> {
|
||||
override fun method(): String = "answerPreCheckoutQuery"
|
||||
|
@ -2,7 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.answers.payments.abs
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ShippingQueryIdentifier
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.DeserializationStrategy
|
||||
import kotlinx.serialization.internal.BooleanSerializer
|
||||
|
||||
interface AnswerShippingQuery : SimpleRequest<Boolean> {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.caption.EditInlineMessageCaption
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
|
||||
import kotlinx.serialization.*
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.ReplyMarkup
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation.EditInlineMessageLiveLocation
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditInlineMessage
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditReplyMessage
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
|
@ -2,7 +2,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.DeserializationStrategy
|
||||
import kotlinx.serialization.internal.BooleanSerializer
|
||||
|
||||
interface EditInlineMessage : SimpleRequest<Boolean> {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation.EditInlineMessageLiveLocation
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.InputMedia
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.text
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation.EditInlineMessageLiveLocation
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media.editMessageMediaMethod
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
|
@ -2,7 +2,8 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.games.abstracts
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.UserId
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.DeserializationStrategy
|
||||
import kotlinx.serialization.serializer
|
||||
|
||||
interface SetGameScore : SimpleRequest<Boolean> {
|
||||
val userId: UserId
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
||||
import kotlinx.serialization.*
|
||||
|
||||
interface DataRequest<T: Any> : SimpleRequest<T>
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.DeserializationStrategy
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
|
||||
/**
|
||||
|
@ -3,7 +3,8 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.CallbackQuery
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
internal data class RawCallbackQuery(
|
||||
|
@ -2,7 +2,8 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.abstracts.ChatMember
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
internal data class RawChatMember(
|
||||
|
@ -2,7 +2,8 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.ChosenInl
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.ChosenInlineResult
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
internal data class RawChosenInlineResult(
|
||||
|
@ -1,7 +1,8 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.query
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
internal data class RawInlineQuery(
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types
|
||||
|
||||
import kotlinx.serialization.*
|
||||
import com.soywiz.klock.DateTime
|
||||
import kotlinx.serialization.*
|
||||
|
||||
@Serializable(TelegramDateSerializer::class)
|
||||
data class TelegramDate(
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.types
|
||||
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class User(
|
||||
|
@ -5,7 +5,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Titled
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.MessageEntity
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.AnimationFile
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.Photo
|
||||
import kotlinx.serialization.Transient
|
||||
|
||||
data class Game(
|
||||
override val title: String,
|
||||
|
@ -3,9 +3,9 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
||||
import com.soywiz.klock.DateTime
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.internal.StringDescriptor
|
||||
import com.soywiz.klock.DateTime
|
||||
|
||||
interface Message {
|
||||
val messageId: MessageIdentifier
|
||||
|
@ -11,7 +11,8 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.payments.ShippingQuery
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.polls.Poll
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.updateIdField
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
internal data class RawUpdate constructor(
|
||||
|
@ -3,7 +3,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.updateshandlers
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.KtorRequestsExecutor
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ALL_UPDATES_LIST
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.TelegramAPIUrlsKeeper
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.UpdateReceiver
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.engine.cio.CIO
|
||||
|
Loading…
Reference in New Issue
Block a user