2022-05-01 05:52:02 +00:00
|
|
|
package dev.inmo.tgbotapi.types.message.content
|
2020-10-04 11:06:30 +00:00
|
|
|
|
|
|
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
|
|
|
import dev.inmo.tgbotapi.requests.send.media.SendAnimation
|
2024-01-07 16:42:46 +00:00
|
|
|
import dev.inmo.tgbotapi.types.*
|
2024-04-17 09:09:45 +00:00
|
|
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
2022-04-22 07:54:06 +00:00
|
|
|
import dev.inmo.tgbotapi.types.media.TelegramMediaAnimation
|
2022-05-01 14:36:07 +00:00
|
|
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
2020-10-04 11:06:30 +00:00
|
|
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
|
|
|
import dev.inmo.tgbotapi.types.files.AnimationFile
|
|
|
|
import dev.inmo.tgbotapi.types.files.DocumentFile
|
|
|
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
2021-06-28 18:06:07 +00:00
|
|
|
import kotlinx.serialization.Serializable
|
2020-10-04 11:06:30 +00:00
|
|
|
|
2021-06-28 18:06:07 +00:00
|
|
|
@Serializable
|
2020-10-04 11:06:30 +00:00
|
|
|
data class AnimationContent(
|
|
|
|
override val media: AnimationFile,
|
|
|
|
val includedDocument: DocumentFile?,
|
2021-04-26 15:25:52 +00:00
|
|
|
override val text: String?,
|
2022-12-30 14:10:35 +00:00
|
|
|
override val textSources: TextSourcesList = emptyList(),
|
2024-01-07 14:51:29 +00:00
|
|
|
override val spoilered: Boolean = false,
|
|
|
|
override val quote: TextQuote? = null
|
2022-12-30 14:10:35 +00:00
|
|
|
) : TextedMediaContent, SpoilerableMediaContent {
|
2020-10-04 11:06:30 +00:00
|
|
|
override fun createResend(
|
|
|
|
chatId: ChatIdentifier,
|
2022-11-07 18:11:14 +00:00
|
|
|
messageThreadId: MessageThreadId?,
|
2024-04-17 09:09:45 +00:00
|
|
|
businessConnectionId: BusinessConnectionId?,
|
2020-10-04 11:06:30 +00:00
|
|
|
disableNotification: Boolean,
|
2022-01-01 14:13:22 +00:00
|
|
|
protectContent: Boolean,
|
2024-01-07 16:42:46 +00:00
|
|
|
replyParameters: ReplyParameters?,
|
2020-10-04 11:06:30 +00:00
|
|
|
replyMarkup: KeyboardMarkup?
|
|
|
|
): Request<ContentMessage<AnimationContent>> = SendAnimation(
|
|
|
|
chatId,
|
|
|
|
media.fileId,
|
2023-03-10 06:01:08 +00:00
|
|
|
media.thumbnail ?.fileId,
|
2021-02-09 12:26:10 +00:00
|
|
|
textSources,
|
2022-12-30 14:28:22 +00:00
|
|
|
spoilered,
|
2020-10-04 11:06:30 +00:00
|
|
|
media.duration,
|
|
|
|
media.width,
|
|
|
|
media.height,
|
2022-11-07 18:11:14 +00:00
|
|
|
messageThreadId,
|
2024-04-17 09:09:45 +00:00
|
|
|
businessConnectionId,
|
2020-10-04 11:06:30 +00:00
|
|
|
disableNotification,
|
2022-01-01 14:13:22 +00:00
|
|
|
protectContent,
|
2024-01-07 16:42:46 +00:00
|
|
|
replyParameters,
|
2020-10-04 11:06:30 +00:00
|
|
|
replyMarkup
|
|
|
|
)
|
|
|
|
|
2022-04-22 07:54:06 +00:00
|
|
|
override fun asTelegramMedia(): TelegramMediaAnimation = TelegramMediaAnimation(
|
2020-10-04 11:06:30 +00:00
|
|
|
media.fileId,
|
2021-02-09 12:26:10 +00:00
|
|
|
textSources,
|
2022-12-30 14:28:22 +00:00
|
|
|
spoilered,
|
2020-10-04 11:06:30 +00:00
|
|
|
media.width,
|
|
|
|
media.height,
|
|
|
|
media.duration,
|
2023-03-10 06:01:08 +00:00
|
|
|
media.thumbnail ?.fileId
|
2020-10-04 11:06:30 +00:00
|
|
|
)
|
|
|
|
}
|