1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00

StorageFile#asMultipartFile

This commit is contained in:
InsanusMokrassar 2021-08-13 11:45:21 +06:00
parent 17806cde25
commit 58dcbe8751
2 changed files with 3 additions and 0 deletions

View File

@ -6,6 +6,7 @@
* Several new extensions `ByteReadChannel#asStorageFile` and `ByteReadChannelAllocator#asStorageFile` * Several new extensions `ByteReadChannel#asStorageFile` and `ByteReadChannelAllocator#asStorageFile`
* Several new extensions `ByteArray#asMultipartFile`, `ByteReadChannel#asMultipartFile` and * Several new extensions `ByteArray#asMultipartFile`, `ByteReadChannel#asMultipartFile` and
`ByteReadChannelAllocator#asMultipartFile` `ByteReadChannelAllocator#asMultipartFile`
* New extension `StorageFile#asMultipartFile`
* `API`: * `API`:
* New extensions `TelegramBot#downloadFile` for writing of incoming bytes to the file * New extensions `TelegramBot#downloadFile` for writing of incoming bytes to the file
* New extensions `TelegramBot#downloadFileStream` and `TelegramBot#downloadFileStreamAllocator` for getting of input * New extensions `TelegramBot#downloadFileStream` and `TelegramBot#downloadFileStreamAllocator` for getting of input

View File

@ -54,6 +54,8 @@ data class MultipartFile (
override val fileId: String = file.storageFileInfo.generateCustomName() override val fileId: String = file.storageFileInfo.generateCustomName()
} }
@Suppress("NOTHING_TO_INLINE", "unused")
inline fun StorageFile.asMultipartFile() = MultipartFile(this)
@Suppress("NOTHING_TO_INLINE", "unused") @Suppress("NOTHING_TO_INLINE", "unused")
inline fun ByteArray.asMultipartFile( inline fun ByteArray.asMultipartFile(