mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-06-29 04:47:48 +00:00
38 lines
1.3 KiB
Kotlin
38 lines
1.3 KiB
Kotlin
|
package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia
|
||
|
|
||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
|
||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
|
||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.mediaField
|
||
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
|
||
|
import kotlinx.serialization.*
|
||
|
|
||
|
@Serializable
|
||
|
data class InputMediaAnimation(
|
||
|
@Transient
|
||
|
override val file: InputFile = throw IllegalStateException("Must be created with file"),
|
||
|
@Optional
|
||
|
override val caption: String? = null,
|
||
|
@SerialName(parseModeField)
|
||
|
@Optional
|
||
|
override val parseMode: ParseMode? = null,
|
||
|
@Optional
|
||
|
override val width: Int? = null,
|
||
|
@Optional
|
||
|
override val height: Int? = null,
|
||
|
@Optional
|
||
|
override val duration: Int? = null,
|
||
|
@Transient
|
||
|
override val thumb: InputFile? = null
|
||
|
) : InputMedia, SizedInputMedia, DuratedInputMedia, ThumbedInputMedia, CaptionedInputMedia {
|
||
|
override val type: String = "animation"
|
||
|
|
||
|
@SerialName(mediaField)
|
||
|
val media: String
|
||
|
get() = file.let {
|
||
|
when (it) {
|
||
|
is FileId -> it.fileId
|
||
|
is MultipartFile -> inputMediaFileAttachmentNameTemplate.format(it.fileId)
|
||
|
}
|
||
|
}
|
||
|
}
|