All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.github.insanusmokrassar.TelegramBotAPI.utils.StorageFile.kt Maven / Gradle / Ivy

There is a newer version: 0.28.3
Show newest version
package com.github.insanusmokrassar.TelegramBotAPI.utils

import com.benasher44.uuid.uuid4
import io.ktor.utils.io.core.Input
import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy