From 8fd6a09763df1ecc569480fb5f19bfcb89d0a0ea Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 7 Feb 2020 22:12:18 +0600 Subject: [PATCH] toInputFile specifying return types --- CHANGELOG.md | 1 + .../TelegramBotAPI/requests/abstracts/InputFile.kt | 2 +- .../TelegramBotAPI/requests/abstracts/InputFileFromJavaFile.kt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12fe9c222a..c349f873d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ * `paymentInfo` inside of `CommonMessageImpl` now can be set only to `SuccessfulPaymentInfo` * Added `RecordVideoNoteAction` and `UploadVideoNoteAction` for `record_video_note` and `upload_video_note` actions * For most part of messages was added `RequestsExecutor` extensions for more useful way of usage +* `toInputFile` extensions now will return more exact types ## 0.22.0 diff --git a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/InputFile.kt b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/InputFile.kt index 6c2f6c96d9..4a7cebba14 100644 --- a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/InputFile.kt +++ b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/InputFile.kt @@ -18,7 +18,7 @@ data class FileId( override val fileId: String ) : InputFile() -fun String.toInputFile(): InputFile = FileId(this) +fun String.toInputFile() = FileId(this) @Serializer(InputFile::class) internal object InputFileSerializer : KSerializer { diff --git a/src/jvmMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/InputFileFromJavaFile.kt b/src/jvmMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/InputFileFromJavaFile.kt index e521ef23e1..99b52b76e6 100644 --- a/src/jvmMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/InputFileFromJavaFile.kt +++ b/src/jvmMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/abstracts/InputFileFromJavaFile.kt @@ -3,6 +3,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts import com.github.insanusmokrassar.TelegramBotAPI.utils.StorageFile import java.io.File -fun File.toInputFile(): InputFile = MultipartFile( +fun File.toInputFile() = MultipartFile( StorageFile(this) )