# dev.inmo.tgbotapi.types.files

docs

# Package dev.inmo.tgbotapi.types.files

## Types

AnimatedSticker
Link copied to clipboard
data class AnimatedSticker ( val fileId: FileId , val fileUniqueId: FileUniqueId , val width: Int , val height: Int , val thumb: PhotoSize ? = null, val emoji: String ? = null, val stickerSetName: StickerSetName ? = null, val maskPosition: MaskPosition ? = null, val fileSize: Long ? = null) : Sticker
Content copied to clipboard
AnimationFile
Link copied to clipboard
data class AnimationFile ( val fileId: FileId , val fileUniqueId: FileUniqueId , val width: Int , val height: Int , val duration: Long ? = null, val thumb: PhotoSize ? = null, val fileName: String ? = null, val mimeType: MimeType ? = null, val fileSize: Long ? = null) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, CustomNamedMediaFile, SizedMediaFile
Content copied to clipboard
AudioFile
Link copied to clipboard
data class AudioFile ( val fileId: FileId , val fileUniqueId: FileUniqueId , val duration: Long ? = null, val performer: String ? = null, val title: String ? = null, val fileName: String ? = null, val mimeType: MimeType ? = null, val fileSize: Long ? = null, val thumb: PhotoSize ? = null) : TelegramMediaFile, CustomNamedMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, TitledMediaFile, Performerable
Content copied to clipboard
CustomNamedMediaFile
Link copied to clipboard
interface CustomNamedMediaFile
Content copied to clipboard
DocumentFile
Link copied to clipboard
data class DocumentFile ( val fileId: FileId , val fileUniqueId: FileUniqueId , val fileSize: Long ? = null, val thumb: PhotoSize ? = null, val mimeType: MimeType ? = null, val fileName: String ? = null) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, CustomNamedMediaFile
Content copied to clipboard
File
Link copied to clipboard
data class File ( val fileId: FileId , val fileUniqueId: FileUniqueId , val fileSize: Long ? = null) : TelegramMediaFile
Content copied to clipboard
MimedMediaFile
Link copied to clipboard
interface MimedMediaFile : TelegramMediaFile, MimeTyped
Content copied to clipboard
PassportFile
Link copied to clipboard
data class PassportFile ( val fileId: FileId , val fileUniqueId: FileUniqueId , val uploadingDate: TelegramDate , val fileSize: Long ? = null) : TelegramMediaFile
Content copied to clipboard

This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.

PathedFile
Link copied to clipboard
data class PathedFile ( val fileId: FileId , val fileUniqueId: FileUniqueId , val filePath: String , val fileSize: Long ? = null) : TelegramMediaFile
Content copied to clipboard
Photo
Link copied to clipboard
typealias Photo = List < PhotoSize >
Content copied to clipboard
PhotoSerializer
Link copied to clipboard
object PhotoSerializer : KSerializer< Photo >
Content copied to clipboard
PhotoSize
Link copied to clipboard
data class PhotoSize ( val fileId: FileId , val fileUniqueId: FileUniqueId , val fileSize: Long ? = null, val width: Int , val height: Int ) : SizedMediaFile
Content copied to clipboard
PlayableMediaFile
Link copied to clipboard
interface PlayableMediaFile : TelegramMediaFile
Content copied to clipboard
SimpleSticker
Link copied to clipboard
data class SimpleSticker ( val fileId: FileId , val fileUniqueId: FileUniqueId , val width: Int , val height: Int , val thumb: PhotoSize ? = null, val emoji: String ? = null, val stickerSetName: StickerSetName ? = null, val maskPosition: MaskPosition ? = null, val fileSize: Long ? = null) : Sticker
Content copied to clipboard
SizedMediaFile
Link copied to clipboard
interface SizedMediaFile : TelegramMediaFile
Content copied to clipboard
Sticker
Link copied to clipboard
interface Sticker : TelegramMediaFile, SizedMediaFile, ThumbedMediaFile
Content copied to clipboard
StickerSerializer
Link copied to clipboard
object StickerSerializer : KSerializer< Sticker >
Content copied to clipboard
StickerSurrogate
Link copied to clipboard
data class StickerSurrogate ( val file_id: FileId , val file_unique_id: FileUniqueId , val width: Int , val height: Int , val is_animated: Boolean ? = null, val is_video: Boolean ? = null, val thumb: PhotoSize ? = null, val emoji: String ? = null, val set_name: StickerSetName ? = null, val mask_position: MaskPosition ? = null, val file_size: Long ? = null)
Content copied to clipboard
TelegramMediaFile
Link copied to clipboard
interface TelegramMediaFile
Content copied to clipboard

Declare common part of media files in Telegram. Note: it is not representation of JVM `File` type

ThumbedMediaFile
Link copied to clipboard
interface ThumbedMediaFile : TelegramMediaFile
Content copied to clipboard
TitledMediaFile
Link copied to clipboard
interface TitledMediaFile
Content copied to clipboard
VideoFile
Link copied to clipboard
data class VideoFile ( val fileId: FileId , val fileUniqueId: FileUniqueId , val width: Int , val height: Int , val duration: Long ? = null, val thumb: PhotoSize ? = null, val fileName: String ? = null, val mimeType: MimeType ? = null, val fileSize: Long ? = null) : TelegramMediaFile, CustomNamedMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, SizedMediaFile
Content copied to clipboard
VideoNoteFile
Link copied to clipboard
data class VideoNoteFile ( val fileId: FileId , val fileUniqueId: FileUniqueId , val width: Int , val duration: Long ? = null, val thumb: PhotoSize ? = null, val fileSize: Long ? = null) : TelegramMediaFile, ThumbedMediaFile, PlayableMediaFile, SizedMediaFile
Content copied to clipboard
VideoSticker
Link copied to clipboard
data class VideoSticker ( val fileId: FileId , val fileUniqueId: FileUniqueId , val width: Int , val height: Int , val thumb: PhotoSize ? = null, val emoji: String ? = null, val stickerSetName: StickerSetName ? = null, val maskPosition: MaskPosition ? = null, val fileSize: Long ? = null) : Sticker
Content copied to clipboard
VoiceFile
Link copied to clipboard
data class VoiceFile ( val fileId: FileId , val fileUniqueId: FileUniqueId , val duration: Long ? = null, val mimeType: MimeType ? = null, val fileSize: Long ? = null) : TelegramMediaFile, MimedMediaFile, PlayableMediaFile
Content copied to clipboard

## Functions

asAudioFile
Link copied to clipboard
fun VoiceFile . asAudioFile ( performer: String ? = null, title: String ? = null, fileName: String ? = null): AudioFile
Content copied to clipboard
asDocumentFile
Link copied to clipboard
inline fun TelegramMediaFile . asDocumentFile (): DocumentFile
Content copied to clipboard
asStream
Link copied to clipboard
fun PathedFile . asStream (telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper): InputStream
Content copied to clipboard
asVoiceFile
Link copied to clipboard
fun AudioFile . asVoiceFile (): VoiceFile
Content copied to clipboard
biggest
Link copied to clipboard
fun Photo . biggest (): PhotoSize ?
Content copied to clipboard
fullUrl
Link copied to clipboard
fun PathedFile . fullUrl (keeper: TelegramAPIUrlsKeeper ): String
Content copied to clipboard
resolveFileURL
Link copied to clipboard
fun TelegramAPIUrlsKeeper . resolveFileURL (file: PathedFile ): String
Content copied to clipboard
toTelegramMediaVideo
Link copied to clipboard
inline fun VideoFile . toTelegramMediaVideo (textSources: TextSourcesList ): TelegramMediaVideo
Content copied to clipboard
inline fun VideoFile . toTelegramMediaVideo (text: String ? = null, parseMode: ParseMode ? = null): TelegramMediaVideo
Content copied to clipboard