17 lines
326 B
Kotlin
17 lines
326 B
Kotlin
package com.github.insanusmokrassar.TelegramBotAPI.utils
|
|
|
|
import io.ktor.utils.io.streams.asInput
|
|
import java.io.File
|
|
import java.nio.file.Files
|
|
|
|
fun StorageFile(
|
|
file: File
|
|
) = StorageFile(
|
|
StorageFileInfo(
|
|
Files.probeContentType(file.toPath()),
|
|
file.name
|
|
)
|
|
) {
|
|
file.inputStream().asInput()
|
|
}
|