From ee81f49a750b5fc9bb4050947419d5db857b72ce Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 8 Sep 2021 21:13:42 +0600 Subject: [PATCH] add docs for InputFile --- .../dev/inmo/tgbotapi/requests/abstracts/InputFile.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFile.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFile.kt index 027b2effa7..834437b25f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFile.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/abstracts/InputFile.kt @@ -10,6 +10,17 @@ import kotlinx.serialization.descriptors.* import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder +/** + * Common type for all files in Telegram Bot API which can be sent via requests like [dev.inmo.tgbotapi.requests.send.media.SendDocument]. + * You may use methods like [MPPFile.asMultipartFile] when you want to send files from your file system, but you should + * remember about [restrictions][https://core.telegram.org/bots/api#sending-files] in Telegram for bots. In case you + * wish to send file by its url, use [FileId] and pass your url as [FileId.fileId] + * + * @see MPPFile.asMultipartFile + * @see ByteArray.asMultipartFile + * @see ByteReadChannel.asMultipartFile + * @see ByteReadChannelAllocator.asMultipartFile + */ @Serializable(InputFileSerializer::class) sealed class InputFile { abstract val fileId: String