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:
parent
aa333d7c58
commit
8fd6a09763
@ -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
|
||||
|
||||
|
@ -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> {
|
||||
|
@ -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)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user