mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +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.HttpClient
|
||||||
import io.ktor.client.call.HttpClientCall
|
import io.ktor.client.call.HttpClientCall
|
||||||
import io.ktor.client.call.call
|
import io.ktor.client.call.call
|
||||||
import io.ktor.client.request.*
|
import io.ktor.client.request.accept
|
||||||
import io.ktor.http.*
|
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 {
|
abstract class AbstractRequestCallFactory : KtorCallFactory {
|
||||||
private val methodsCache: MutableMap<String, String> = mutableMapOf()
|
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.client.request.forms.formData
|
||||||
import io.ktor.http.Headers
|
import io.ktor.http.Headers
|
||||||
import io.ktor.http.HttpHeaders
|
import io.ktor.http.HttpHeaders
|
||||||
import kotlinx.io.core.readBytes
|
|
||||||
|
|
||||||
class MultipartRequestCallFactory : AbstractRequestCallFactory() {
|
class MultipartRequestCallFactory : AbstractRequestCallFactory() {
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.base
|
package com.github.insanusmokrassar.TelegramBotAPI.bot.Ktor.base
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.toJsonWithoutNulls
|
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.http.ContentType
|
import io.ktor.http.ContentType
|
||||||
import io.ktor.http.content.TextContent
|
import io.ktor.http.content.TextContent
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts
|
package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts
|
||||||
|
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.DeserializationStrategy
|
||||||
|
|
||||||
interface Request<T: Any> {
|
interface Request<T: Any> {
|
||||||
fun method(): String
|
fun method(): String
|
||||||
|
@ -4,7 +4,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleReque
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.PreCheckoutQueryId
|
import com.github.insanusmokrassar.TelegramBotAPI.types.PreCheckoutQueryId
|
||||||
import kotlinx.serialization.KSerializer
|
import kotlinx.serialization.KSerializer
|
||||||
import kotlinx.serialization.internal.BooleanSerializer
|
import kotlinx.serialization.internal.BooleanSerializer
|
||||||
import kotlinx.serialization.serializer
|
|
||||||
|
|
||||||
interface AnswerPreCheckoutQuery : SimpleRequest<Boolean> {
|
interface AnswerPreCheckoutQuery : SimpleRequest<Boolean> {
|
||||||
override fun method(): String = "answerPreCheckoutQuery"
|
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.requests.abstracts.SimpleRequest
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ShippingQueryIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ShippingQueryIdentifier
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.DeserializationStrategy
|
||||||
import kotlinx.serialization.internal.BooleanSerializer
|
import kotlinx.serialization.internal.BooleanSerializer
|
||||||
|
|
||||||
interface AnswerShippingQuery : SimpleRequest<Boolean> {
|
interface AnswerShippingQuery : SimpleRequest<Boolean> {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation
|
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.LiveLocation
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.*
|
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.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.ReplyMarkup
|
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.EditInlineMessage
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditReplyMessage
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.abstracts.EditReplyMessage
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
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.requests.abstracts.SimpleRequest
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineMessageIdentifier
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.DeserializationStrategy
|
||||||
import kotlinx.serialization.internal.BooleanSerializer
|
import kotlinx.serialization.internal.BooleanSerializer
|
||||||
|
|
||||||
interface EditInlineMessage : SimpleRequest<Boolean> {
|
interface EditInlineMessage : SimpleRequest<Boolean> {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media
|
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile
|
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.requests.edit.abstracts.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.InputMedia
|
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.InputMedia
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.edit.text
|
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.abstracts.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media.editMessageMediaMethod
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.edit.media.editMessageMediaMethod
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
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.requests.abstracts.SimpleRequest
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.UserId
|
import com.github.insanusmokrassar.TelegramBotAPI.types.UserId
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.DeserializationStrategy
|
||||||
|
import kotlinx.serialization.serializer
|
||||||
|
|
||||||
interface SetGameScore : SimpleRequest<Boolean> {
|
interface SetGameScore : SimpleRequest<Boolean> {
|
||||||
val userId: UserId
|
val userId: UserId
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base
|
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
||||||
import kotlinx.serialization.*
|
|
||||||
|
|
||||||
interface DataRequest<T: Any> : SimpleRequest<T>
|
interface DataRequest<T: Any> : SimpleRequest<T>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base
|
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.DeserializationStrategy
|
||||||
import kotlinx.serialization.json.JsonObject
|
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.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
internal data class RawCallbackQuery(
|
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.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.abstracts.ChatMember
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatMember.abstracts.ChatMember
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
internal data class RawChatMember(
|
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.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.ChosenInlineResult
|
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.ChosenInlineResult
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
internal data class RawChosenInlineResult(
|
internal data class RawChosenInlineResult(
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.query
|
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.query
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
internal data class RawInlineQuery(
|
internal data class RawInlineQuery(
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types
|
package com.github.insanusmokrassar.TelegramBotAPI.types
|
||||||
|
|
||||||
import kotlinx.serialization.*
|
|
||||||
import com.soywiz.klock.DateTime
|
import com.soywiz.klock.DateTime
|
||||||
|
import kotlinx.serialization.*
|
||||||
|
|
||||||
@Serializable(TelegramDateSerializer::class)
|
@Serializable(TelegramDateSerializer::class)
|
||||||
data class TelegramDate(
|
data class TelegramDate(
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types
|
package com.github.insanusmokrassar.TelegramBotAPI.types
|
||||||
|
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class User(
|
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.MessageEntity.MessageEntity
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.AnimationFile
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.AnimationFile
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.Photo
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.Photo
|
||||||
import kotlinx.serialization.Transient
|
|
||||||
|
|
||||||
data class Game(
|
data class Game(
|
||||||
override val title: String,
|
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.MessageIdentifier
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
||||||
|
import com.soywiz.klock.DateTime
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.internal.StringDescriptor
|
import kotlinx.serialization.internal.StringDescriptor
|
||||||
import com.soywiz.klock.DateTime
|
|
||||||
|
|
||||||
interface Message {
|
interface Message {
|
||||||
val messageId: MessageIdentifier
|
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.polls.Poll
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.updateIdField
|
import com.github.insanusmokrassar.TelegramBotAPI.types.updateIdField
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
internal data class RawUpdate constructor(
|
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.bot.Ktor.KtorRequestsExecutor
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ALL_UPDATES_LIST
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ALL_UPDATES_LIST
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
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 com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.UpdateReceiver
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.client.engine.cio.CIO
|
import io.ktor.client.engine.cio.CIO
|
||||||
|
Loading…
Reference in New Issue
Block a user