Package-level declarations

Types

Link copied to clipboard
@Serializable
sealed interface AnimatedSticker : Sticker
Link copied to clipboard
@Serializable
data class AnimationFile(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val width: Int, val height: Int, val duration: Long? = null, val thumbnail: PhotoSize? = null, val fileName: String? = null, val mimeType: MimeType? = null, val fileSize: Long? = null) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, CustomNamedMediaFile, SizedMediaFile, MediaContentVariant
Link copied to clipboard
@Serializable
data class AudioFile(val fileId: FileId, val fileUniqueId: TgFileUniqueId, 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 thumbnail: PhotoSize? = null) : TelegramMediaFile, CustomNamedMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, TitledMediaFile, Performerable, MediaContentVariant
Link copied to clipboard
@Serializable
data class CustomEmojiAnimatedSticker(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val width: Int, val height: Int, val customEmojiId: CustomEmojiId, val thumbnail: PhotoSize? = null, val emoji: String? = null, val stickerSetName: StickerSetName? = null, val fileSize: Long? = null, val needsRepainting: Boolean = false) : CustomEmojiSticker, AnimatedSticker
Link copied to clipboard
@Serializable
data class CustomEmojiSimpleSticker(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val width: Int, val height: Int, val customEmojiId: CustomEmojiId, val thumbnail: PhotoSize? = null, val emoji: String? = null, val stickerSetName: StickerSetName? = null, val fileSize: Long? = null, val needsRepainting: Boolean = false) : CustomEmojiSticker
Link copied to clipboard
@Serializable
sealed interface CustomEmojiSticker : Sticker
Link copied to clipboard
@Serializable
data class CustomEmojiVideoSticker(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val width: Int, val height: Int, val customEmojiId: CustomEmojiId, val thumbnail: PhotoSize? = null, val emoji: String? = null, val stickerSetName: StickerSetName? = null, val fileSize: Long? = null, val needsRepainting: Boolean = false) : CustomEmojiSticker, VideoSticker
Link copied to clipboard
sealed interface CustomNamedMediaFile
Link copied to clipboard
@Serializable
data class DocumentFile(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val fileSize: Long? = null, val thumbnail: PhotoSize? = null, val mimeType: MimeType? = null, val fileName: String? = null) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, CustomNamedMediaFile, MediaContentVariant
Link copied to clipboard
@Serializable
data class File(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val fileSize: Long? = null) : TelegramMediaFile
Link copied to clipboard
@Serializable
data class MaskAnimatedSticker(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val width: Int, val height: Int, val maskPosition: MaskPosition? = null, val thumbnail: PhotoSize? = null, val emoji: String? = null, val stickerSetName: StickerSetName? = null, val fileSize: Long? = null) : MaskSticker, AnimatedSticker
Link copied to clipboard
@Serializable
data class MaskSimpleSticker(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val width: Int, val height: Int, val maskPosition: MaskPosition? = null, val thumbnail: PhotoSize? = null, val emoji: String? = null, val stickerSetName: StickerSetName? = null, val fileSize: Long? = null) : MaskSticker
Link copied to clipboard
@Serializable
sealed interface MaskSticker : Sticker
Link copied to clipboard
@Serializable
data class MaskVideoSticker(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val width: Int, val height: Int, val maskPosition: MaskPosition? = null, val thumbnail: PhotoSize? = null, val emoji: String? = null, val stickerSetName: StickerSetName? = null, val fileSize: Long? = null) : MaskSticker, VideoSticker
Link copied to clipboard
Link copied to clipboard
@Serializable
data class PaidMediaInfo(val stars: Int, val media: List<PaidMedia>) : ReplyInfo.External.ContentVariant
Link copied to clipboard
@Serializable
data class PassportFile(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val uploadingDate: TelegramDate, val fileSize: Long? = null) : TelegramMediaFile

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.

Link copied to clipboard
@Serializable
data class PathedFile(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val filePath: String, val fileSize: Long? = null) : TelegramMediaFile
Link copied to clipboard
typealias Photo = PhotoFile
Link copied to clipboard
Link copied to clipboard
object PhotoSerializer : KSerializer<PhotoFile>
Link copied to clipboard
@Serializable
data class PhotoSize(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val fileSize: Long? = null, val width: Int, val height: Int) : SizedMediaFile
Link copied to clipboard
Link copied to clipboard
@Serializable
data class RegularAnimatedSticker(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val width: Int, val height: Int, val thumbnail: PhotoSize? = null, val emoji: String? = null, val stickerSetName: StickerSetName? = null, val premiumAnimationFile: File? = null, val fileSize: Long? = null) : RegularSticker, AnimatedSticker
Link copied to clipboard
@Serializable
data class RegularSimpleSticker(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val width: Int, val height: Int, val thumbnail: PhotoSize? = null, val emoji: String? = null, val stickerSetName: StickerSetName? = null, val premiumAnimationFile: File? = null, val fileSize: Long? = null) : RegularSticker
Link copied to clipboard
@Serializable
sealed interface RegularSticker : Sticker
Link copied to clipboard
@Serializable
data class RegularVideoSticker(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val width: Int, val height: Int, val thumbnail: PhotoSize? = null, val emoji: String? = null, val stickerSetName: StickerSetName? = null, val premiumAnimationFile: File? = null, val fileSize: Long? = null) : RegularSticker, VideoSticker
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
object StickerSerializer : KSerializer<Sticker>
Link copied to clipboard
@Serializable
data class StickerSurrogate(val file_id: FileId, val file_unique_id: TgFileUniqueId, val type: StickerType, val width: Int, val height: Int, val is_animated: Boolean? = null, val is_video: Boolean? = null, val thumbnail: PhotoSize? = null, val emoji: String? = null, val set_name: StickerSetName? = null, val premium_animation: File? = null, val mask_position: MaskPosition? = null, val custom_emoji_id: CustomEmojiId? = null, val file_size: Long? = null, val needs_repainting: Boolean = false)
Link copied to clipboard
sealed interface TelegramMediaFile

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

Link copied to clipboard
Link copied to clipboard
sealed interface TitledMediaFile
Link copied to clipboard
@Serializable
data class UnknownSticker(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val width: Int, val height: Int, val thumbnail: PhotoSize? = null, val emoji: String? = null, val stickerSetName: StickerSetName? = null, val fileSize: Long? = null, val stickerFormat: StickerFormat = StickerFormat.Static, val type: StickerType = StickerType.Regular, val raw: JsonElement) : Sticker
Link copied to clipboard
Link copied to clipboard
@Serializable
data class VideoFile(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val width: Int, val height: Int, val duration: Long? = null, val thumbnail: PhotoSize? = null, val fileName: String? = null, val mimeType: MimeType? = null, val fileSize: Long? = null) : TelegramMediaFile, CustomNamedMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, SizedMediaFile, MediaContentVariant, UsefulAsPaidMediaFile
Link copied to clipboard
@Serializable
data class VideoNoteFile(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val width: Int, val duration: Long? = null, val thumbnail: PhotoSize? = null, val fileSize: Long? = null) : TelegramMediaFile, ThumbedMediaFile, PlayableMediaFile, SizedMediaFile, MediaContentVariant
Link copied to clipboard
@Serializable
sealed interface VideoSticker : Sticker
Link copied to clipboard
@Serializable
data class VoiceFile(val fileId: FileId, val fileUniqueId: TgFileUniqueId, val duration: Long? = null, val mimeType: MimeType? = null, val fileSize: Long? = null) : TelegramMediaFile, MimedMediaFile, PlayableMediaFile, MediaContentVariant

Functions

Link copied to clipboard
fun VoiceFile.asAudioFile(performer: String? = null, title: String? = null, fileName: String? = null): AudioFile
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun VideoFile.toTelegramMediaVideo(textSources: TextSourcesList, spoilered: Boolean = false, showCaptionAboveMedia: Boolean = false): TelegramMediaVideo
inline fun VideoFile.toTelegramMediaVideo(text: String? = null, parseMode: ParseMode? = null, spoilered: Boolean = false, showCaptionAboveMedia: Boolean = false): TelegramMediaVideo