1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-23 00:57:13 +00:00

toInputFile specifying return types

This commit is contained in:
InsanusMokrassar 2020-02-07 22:12:18 +06:00
parent aa333d7c58
commit 8fd6a09763
3 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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<InputFile> {

View File

@ -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)
)