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
|
|
|
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
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.MessageIdentifier
|
|
|
|
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?,
|
2021-04-27 10:08:36 +00:00
|
|
|
override val textSources: TextSourcesList = emptyList()
|
2022-04-03 13:06:27 +00:00
|
|
|
) : TextedMediaContent {
|
2020-10-04 11:06:30 +00:00
|
|
|
override fun createResend(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
disableNotification: Boolean,
|
2022-01-01 14:13:22 +00:00
|
|
|
protectContent: Boolean,
|
2020-10-04 11:06:30 +00:00
|
|
|
replyToMessageId: MessageIdentifier?,
|
2020-11-05 17:48:23 +00:00
|
|
|
allowSendingWithoutReply: Boolean?,
|
2020-10-04 11:06:30 +00:00
|
|
|
replyMarkup: KeyboardMarkup?
|
|
|
|
): Request<ContentMessage<AnimationContent>> = SendAnimation(
|
|
|
|
chatId,
|
|
|
|
media.fileId,
|
|
|
|
media.thumb ?.fileId,
|
2021-02-09 12:26:10 +00:00
|
|
|
textSources,
|
2020-10-04 11:06:30 +00:00
|
|
|
media.duration,
|
|
|
|
media.width,
|
|
|
|
media.height,
|
|
|
|
disableNotification,
|
2022-01-01 14:13:22 +00:00
|
|
|
protectContent,
|
2020-10-04 11:06:30 +00:00
|
|
|
replyToMessageId,
|
2020-11-05 17:48:23 +00:00
|
|
|
allowSendingWithoutReply,
|
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,
|
2020-10-04 11:06:30 +00:00
|
|
|
media.width,
|
|
|
|
media.height,
|
|
|
|
media.duration,
|
|
|
|
media.thumb ?.fileId
|
|
|
|
)
|
|
|
|
}
|