Attachment

sealed interface Attachment(source)

Represents different types of content that can be attached to messages. Check nested implementation classes for supported formats and details.

Inheritors

Types

Link copied to clipboard
data class Audio(val content: AttachmentContent, val format: String, val mimeType: String = "audio/", val fileName: String? = null) : Attachment

Audio attachment (mp3, wav, etc.).

Link copied to clipboard
data class File(val content: AttachmentContent, val format: String, val mimeType: String, val fileName: String? = null) : Attachment

Other types of file attachments. E.g. pdf, md, txt.

Link copied to clipboard
data class Image(val content: AttachmentContent, val format: String, val mimeType: String = "image/", val fileName: String? = null) : Attachment

Image attachment (jpg, png, gif, etc.).

Link copied to clipboard
data class Video(val content: AttachmentContent, val format: String, val mimeType: String = "video/", val fileName: String? = null) : Attachment

Video attachment (mp4, avi, etc.).

Properties

Link copied to clipboard

Attachment content.

Link copied to clipboard
abstract val fileName: String?

Optional file name of the attachment file.

Link copied to clipboard
abstract val format: String

File format (usually file extension) of the attachment file. E.g. jpg, png, mp4, pdf.

Link copied to clipboard
abstract val mimeType: String

MIME type of the attachment E.g. image/jpg, video/mp4