From 7e61b77ffe691ff4e8b716d3060286d3da65a4a0 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 12 Aug 2019 15:46:31 +0600 Subject: [PATCH] optimize imports --- .../insanusmokrassar/TelegramBotAPI/bot/UpdatesPoller.kt | 3 ++- .../buttons/InlineKeyboardButtons/InlineKeyboardButton.kt | 3 ++- .../TelegramBotAPI/types/chat/ChannelChatImpl.kt | 4 +--- .../TelegramBotAPI/types/chat/ChatSerializers.kt | 2 +- .../TelegramBotAPI/types/chat/GroupChatImpl.kt | 1 - .../TelegramBotAPI/types/chat/PrivateChatImpl.kt | 2 +- .../TelegramBotAPI/types/chat/SupergroupChatImpl.kt | 3 --- .../TelegramBotAPI/types/chat/abstracts/Chat.kt | 1 - .../TelegramBotAPI/types/message/ChannelEventMessage.kt | 1 - .../TelegramBotAPI/types/message/RawMessage.kt | 1 - .../TelegramBotAPI/types/message/SupergroupEventMessage.kt | 1 - .../types/message/content/media/AudioContent.kt | 1 - .../types/message/content/media/PhotoContent.kt | 3 ++- .../types/message/content/media/VideoContent.kt | 1 - .../types/message/content/media/VoiceContent.kt | 1 - .../MediaGroupUpdates/EditChannelPostMediaGroupUpdate.kt | 1 - .../update/MediaGroupUpdates/EditMessageMediaGroupUpdate.kt | 1 - .../TelegramBotAPI/utils/extensions/UpdatesPolling.kt | 2 +- .../TelegramBotAPI/utils/extensions/Webhooks.kt | 1 - 19 files changed, 10 insertions(+), 23 deletions(-) diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/UpdatesPoller.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/UpdatesPoller.kt index c80bfa2610..e7e78cb867 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/UpdatesPoller.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/UpdatesPoller.kt @@ -1,6 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.bot -import kotlinx.coroutines.* +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers import kotlinx.io.core.Closeable interface UpdatesPoller : Closeable { diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/buttons/InlineKeyboardButtons/InlineKeyboardButton.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/buttons/InlineKeyboardButtons/InlineKeyboardButton.kt index 26809e7284..d477c11b18 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/buttons/InlineKeyboardButtons/InlineKeyboardButton.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/buttons/InlineKeyboardButtons/InlineKeyboardButton.kt @@ -1,7 +1,8 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardButtons import com.github.insanusmokrassar.TelegramBotAPI.types.* -import kotlinx.serialization.* +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable @Serializable(InlineKeyboardButtonSerializer::class) sealed class InlineKeyboardButton { diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/ChannelChatImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/ChannelChatImpl.kt index 53a434e3c7..ce5d60655d 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/ChannelChatImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/ChannelChatImpl.kt @@ -1,9 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.chat import com.github.insanusmokrassar.TelegramBotAPI.types.* -import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.* -import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PublicChat -import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.ChannelChat import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/ChatSerializers.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/ChatSerializers.kt index 4de5303901..521b14e682 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/ChatSerializers.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/ChatSerializers.kt @@ -1,9 +1,9 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.chat -import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.extended.ExtendedChat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.extended.* +import com.github.insanusmokrassar.TelegramBotAPI.types.typeField import kotlinx.serialization.* import kotlinx.serialization.internal.StringDescriptor import kotlinx.serialization.json.Json diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/GroupChatImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/GroupChatImpl.kt index 0f97e79b70..5a5bf04394 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/GroupChatImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/GroupChatImpl.kt @@ -2,7 +2,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.chat import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.GroupChat -import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/PrivateChatImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/PrivateChatImpl.kt index e335fa4aa0..6f083135ce 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/PrivateChatImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/PrivateChatImpl.kt @@ -1,7 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.chat import com.github.insanusmokrassar.TelegramBotAPI.types.* -import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PrivateChat import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/SupergroupChatImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/SupergroupChatImpl.kt index ce53d3bd4f..44c83a9f82 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/SupergroupChatImpl.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/SupergroupChatImpl.kt @@ -1,10 +1,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.chat import com.github.insanusmokrassar.TelegramBotAPI.types.* -import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.* -import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.GroupChat import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.SupergroupChat -import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/abstracts/Chat.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/abstracts/Chat.kt index 7eead97d8e..115ef44169 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/abstracts/Chat.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/chat/abstracts/Chat.kt @@ -1,7 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId -import com.github.insanusmokrassar.TelegramBotAPI.types.ChatPhoto import com.github.insanusmokrassar.TelegramBotAPI.types.chat.PreviewChatSerializer import kotlinx.serialization.Serializable diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/ChannelEventMessage.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/ChannelEventMessage.kt index 5a08484965..9631d8183c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/ChannelEventMessage.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/ChannelEventMessage.kt @@ -1,7 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier -import com.github.insanusmokrassar.TelegramBotAPI.types.chat.ChannelChatImpl import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.ChannelChat import com.github.insanusmokrassar.TelegramBotAPI.types.message.ChatEvents.abstracts.ChannelEvent import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ChatEventMessage diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/RawMessage.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/RawMessage.kt index 02008dfd76..c2b8e36704 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/RawMessage.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/RawMessage.kt @@ -4,7 +4,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.RawMessageEntities import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.RawMessageEntitiesSerializer import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup -import com.github.insanusmokrassar.TelegramBotAPI.types.chat.* import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.* import com.github.insanusmokrassar.TelegramBotAPI.types.files.* import com.github.insanusmokrassar.TelegramBotAPI.types.games.Game diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/SupergroupEventMessage.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/SupergroupEventMessage.kt index 372be34470..cd5c34cdfc 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/SupergroupEventMessage.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/SupergroupEventMessage.kt @@ -1,7 +1,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier -import com.github.insanusmokrassar.TelegramBotAPI.types.chat.SupergroupChatImpl import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.SupergroupChat import com.github.insanusmokrassar.TelegramBotAPI.types.message.ChatEvents.abstracts.SupergroupEvent import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ChatEventMessage diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AudioContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AudioContent.kt index 818a3f1764..778498771c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AudioContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/AudioContent.kt @@ -10,7 +10,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.HTMLParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.files.AudioFile import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage -import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.CaptionedMediaContent import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaContent import com.github.insanusmokrassar.TelegramBotAPI.utils.toHtmlCaptions diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/PhotoContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/PhotoContent.kt index 919e8751ce..c0589cb9d7 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/PhotoContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/PhotoContent.kt @@ -12,7 +12,8 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.files.PhotoSize import com.github.insanusmokrassar.TelegramBotAPI.types.files.biggest import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage -import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.* +import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaCollectionContent +import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaGroupContent import com.github.insanusmokrassar.TelegramBotAPI.utils.toHtmlCaptions data class PhotoContent( diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VideoContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VideoContent.kt index 765acd5806..2de7f425ba 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VideoContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VideoContent.kt @@ -11,7 +11,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.HTMLParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.files.VideoFile import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage -import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.CaptionedMediaContent import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaGroupContent import com.github.insanusmokrassar.TelegramBotAPI.utils.toHtmlCaptions diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VoiceContent.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VoiceContent.kt index c0f84cd2f1..e29db55dee 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VoiceContent.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/message/content/media/VoiceContent.kt @@ -10,7 +10,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.HTMLParseMode import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup import com.github.insanusmokrassar.TelegramBotAPI.types.files.VoiceFile import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage -import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.CaptionedMediaContent import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaContent import com.github.insanusmokrassar.TelegramBotAPI.utils.toHtmlCaptions diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/MediaGroupUpdates/EditChannelPostMediaGroupUpdate.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/MediaGroupUpdates/EditChannelPostMediaGroupUpdate.kt index e13ba2a8d7..e2a56e4514 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/MediaGroupUpdates/EditChannelPostMediaGroupUpdate.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/MediaGroupUpdates/EditChannelPostMediaGroupUpdate.kt @@ -3,7 +3,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdate import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.MediaGroupMessage import com.github.insanusmokrassar.TelegramBotAPI.types.update.EditChannelPostUpdate -import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseMessageUpdate data class EditChannelPostMediaGroupUpdate( override val origin: EditChannelPostUpdate diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/MediaGroupUpdates/EditMessageMediaGroupUpdate.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/MediaGroupUpdates/EditMessageMediaGroupUpdate.kt index 0801f6c051..be1364dc32 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/MediaGroupUpdates/EditMessageMediaGroupUpdate.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/update/MediaGroupUpdates/EditMessageMediaGroupUpdate.kt @@ -3,7 +3,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdate import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.MediaGroupMessage import com.github.insanusmokrassar.TelegramBotAPI.types.update.EditMessageUpdate -import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseMessageUpdate data class EditMessageMediaGroupUpdate( override val origin: EditMessageUpdate diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/UpdatesPolling.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/UpdatesPolling.kt index 8166e653d4..8ef77a802f 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/UpdatesPolling.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/UpdatesPolling.kt @@ -6,8 +6,8 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ALL_UPDATES_LIST import com.github.insanusmokrassar.TelegramBotAPI.types.update.* import com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdates.* import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update -import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.UpdatesFilter import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.KtorUpdatesPoller +import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.UpdatesFilter import kotlinx.coroutines.* import java.util.concurrent.Executors diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/Webhooks.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/Webhooks.kt index 86011af428..e10e4c9347 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/Webhooks.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/extensions/Webhooks.kt @@ -11,7 +11,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.UpdatesFilter import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.webhook.WebhookPrivateKeyConfig import com.github.insanusmokrassar.TelegramBotAPI.utils.convertWithMediaGroupUpdates -import com.github.insanusmokrassar.TelegramBotAPI.utils.toSentMediaGroupUpdate import io.ktor.application.call import io.ktor.request.receiveText import io.ktor.response.respond