Package-level declarations

Types

Link copied to clipboard
@Serializable(with = InputFileSerializer::class)
data class FileId(val fileId: String) : InputFile

Contains file id or file url

Link copied to clipboard
typealias FileUrl = FileId
Link copied to clipboard
@Serializable(with = InputFileSerializer::class)
sealed class InputFile

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

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

Contains info about file for sending

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

Functions

Link copied to clipboard
expect fun MPPFile.asMultipartFile(): MultipartFile
inline suspend fun ByteReadChannel.asMultipartFile(fileName: String): MultipartFile
Link copied to clipboard
inline fun MPPFile.multipartFile(): MultipartFile
Link copied to clipboard