# dev.inmo.tgbotapi.requests.abstracts

docs

# Package dev.inmo.tgbotapi.requests.abstracts

## Types

FileId
Link copied to clipboard
data class FileId (val fileId: String ) : InputFile
Content copied to clipboard

Contains file id or file url

FileUrl
Link copied to clipboard
typealias FileUrl = FileId
Content copied to clipboard
InputFile
Link copied to clipboard
sealed class InputFile
Content copied to clipboard

Common type for all files in Telegram Bot API which can be sent via requests like dev.inmo.tgbotapi.requests.send.media.SendDocument. You may use methods like MPPFile.asMultipartFile when you want to send files from your file system, but you should remember about restrictions[https://core.telegram.org/bots/api#sending-files] in Telegram for bots. In case you wish to send file by its url, use FileId and pass your url as FileId.fileId

InputFileSerializer
Link copied to clipboard
object InputFileSerializer : KSerializer< InputFile >
Content copied to clipboard
MultipartFile
Link copied to clipboard
data class MultipartFile (val filename: String , inputSource: () -> Input) : InputFile
Content copied to clipboard

Contains info about file for sending

MultipartRequest
Link copied to clipboard
interface MultipartRequest < T : Any > : Request < T >
Content copied to clipboard
Request
Link copied to clipboard
interface Request < T : Any >
Content copied to clipboard
SimpleRequest
Link copied to clipboard
interface SimpleRequest < T : Any > : Request < T >
Content copied to clipboard

## Functions

asMultipartFile
Link copied to clipboard
expect fun MPPFile. asMultipartFile (): MultipartFile
Content copied to clipboard
inline suspend fun ByteReadChannelAllocator . asMultipartFile (fileName: String ): MultipartFile
Content copied to clipboard
inline suspend fun ByteReadChannel. asMultipartFile (fileName: String ): MultipartFile
Content copied to clipboard
inline fun ByteArray . asMultipartFile (fileName: String ): MultipartFile
Content copied to clipboard
multipartFile
Link copied to clipboard
inline fun MPPFile. multipartFile (): MultipartFile
Content copied to clipboard
toInputFile
Link copied to clipboard
fun String . toInputFile (): FileId
Content copied to clipboard