From ec6cf0f0299b9b3e746b0d7f1cb1a85dc0faff58 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 11 May 2020 20:44:03 +0600 Subject: [PATCH] docs --- .../SetChatAdministratorCustomTitle.kt | 5 --- .../send/media/base/MultipartRequestImpl.kt | 3 -- .../TelegramBotAPI/types/actions/BotAction.kt | 33 +++++++++++++++++-- .../files/abstracts/TelegramMediaFile.kt | 2 +- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/SetChatAdministratorCustomTitle.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/SetChatAdministratorCustomTitle.kt index f91dcfc41b..c914522a27 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/SetChatAdministratorCustomTitle.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/chat/members/SetChatAdministratorCustomTitle.kt @@ -5,11 +5,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.* import kotlinx.serialization.* import kotlinx.serialization.builtins.serializer -/** - * Representation of https://core.telegram.org/bots/api#setchatadministratorcustomtitle - * - * Please, remember about restrictions for characters in custom title - */ @Serializable data class SetChatAdministratorCustomTitle( @SerialName(chatIdField) diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/base/MultipartRequestImpl.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/base/MultipartRequestImpl.kt index 7090488dde..c4464466f6 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/base/MultipartRequestImpl.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/media/base/MultipartRequestImpl.kt @@ -4,9 +4,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.* import kotlinx.serialization.DeserializationStrategy import kotlinx.serialization.json.JsonObject -/** - * Will be used as SimpleRequest if - */ class MultipartRequestImpl, F: Files, R: Any>( val data: D, val files: F diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/actions/BotAction.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/actions/BotAction.kt index f8bd33f045..cce421d77b 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/actions/BotAction.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/actions/BotAction.kt @@ -2,6 +2,9 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.actions import kotlinx.serialization.* +/** + * Use BotAction objects realisations to notify user about bot actions + */ @Serializable(BotActionSerializer::class) sealed class BotAction { abstract val actionName: String @@ -31,54 +34,80 @@ internal object BotActionSerializer: KSerializer { } /** - * Use BotAction objects realisations to notify user about bot actions + * Will notify user that bot is "typing" something */ - @Serializable(BotActionSerializer::class) object TypingAction : BotAction() { override val actionName: String = "typing" } +/** + * Will notify user that bot is uploading some photo + */ @Serializable(BotActionSerializer::class) object UploadPhotoAction : BotAction() { override val actionName: String = "upload_photo" } +/** + * Will notify user that bot is recording some video + */ @Serializable(BotActionSerializer::class) object RecordVideoAction : BotAction() { override val actionName: String = "record_video" } +/** + * Will notify user that bot is uploading some photo + */ @Serializable(BotActionSerializer::class) object UploadVideoAction : BotAction() { override val actionName: String = "upload_video" } +/** + * Will notify user that bot is recording some audio + */ @Serializable(BotActionSerializer::class) object RecordAudioAction : BotAction() { override val actionName: String = "record_audio" } +/** + * Will notify user that bot is uploading some audio + */ @Serializable(BotActionSerializer::class) object UploadAudioAction : BotAction() { override val actionName: String = "upload_audio" } +/** + * Will notify user that bot is uploading some document + */ @Serializable(BotActionSerializer::class) object UploadDocumentAction : BotAction() { override val actionName: String = "upload_document" } +/** + * Will notify user that bot is trying to find location + */ @Serializable(BotActionSerializer::class) object FindLocationAction : BotAction() { override val actionName: String = "find_location" } +/** + * Will notify user that bot is recording video note + */ @Serializable(BotActionSerializer::class) object RecordVideoNoteAction : BotAction() { override val actionName: String = "record_video_note" } +/** + * Will notify user that bot is uploading video note + */ @Serializable(BotActionSerializer::class) object UploadVideoNoteAction : BotAction() { override val actionName: String = "upload_video_note" diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/files/abstracts/TelegramMediaFile.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/files/abstracts/TelegramMediaFile.kt index 67a34b9457..5a3ae1e393 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/files/abstracts/TelegramMediaFile.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/files/abstracts/TelegramMediaFile.kt @@ -8,7 +8,7 @@ internal const val fileSizeField = "file_size" internal const val filePathField = "file_path" /** - * Declare common part of media files in Telegram. Note: it is not representation of `File` type + * Declare common part of media files in Telegram. Note: it is not representation of JVM `File` type */ interface TelegramMediaFile { val fileId: FileId