mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-06-03 00:15:27 +00:00
21 lines
489 B
Kotlin
21 lines
489 B
Kotlin
package com.github.insanusmokrassar.TelegramBotAPI.utils
|
|
|
|
import com.benasher44.uuid.uuid4
|
|
import io.ktor.utils.io.core.Input
|
|
import kotlinx.serialization.Serializable
|
|
|
|
@Serializable
|
|
data class StorageFileInfo(
|
|
val contentType: String,
|
|
val fileName: String
|
|
) {
|
|
fun generateCustomName() = "${uuid4()}.${fileName.fileExtension}"
|
|
}
|
|
|
|
data class StorageFile(
|
|
val storageFileInfo: StorageFileInfo,
|
|
private val inputSource: () -> Input
|
|
) {
|
|
fun asInput() = inputSource()
|
|
}
|