From 0c24aa1270baaf933c86f992610fccba8b360f53 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 11 Mar 2023 00:53:36 +0600 Subject: [PATCH] add sticker format to stickerset --- .../tgbotapi/types/stickers/StickerSet.kt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/stickers/StickerSet.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/stickers/StickerSet.kt index 354d84947a..4f80e71d49 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/stickers/StickerSet.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/stickers/StickerSet.kt @@ -25,6 +25,7 @@ sealed interface StickerSet { val name: String val title: String val stickerType: StickerType + val stickerFormat: StickerFormat val stickers: List val isAnimated: Boolean get() = false @@ -124,11 +125,19 @@ sealed interface StickerSet { sealed interface AnimatedStickerSet : StickerSet { override val isAnimated: Boolean get() = true + @SerialName(stickerFormatField) + @EncodeDefault + override val stickerFormat: StickerFormat + get() = StickerFormat.Animated } @Serializable sealed interface VideoStickerSet : StickerSet { override val isVideo: Boolean get() = true + @SerialName(stickerFormatField) + @EncodeDefault + override val stickerFormat: StickerFormat + get() = StickerFormat.Video } @Serializable sealed interface RegularStickerSet : StickerSet @@ -151,6 +160,9 @@ data class RegularSimpleStickerSet( @SerialName(stickerTypeField) @EncodeDefault override val stickerType: StickerType = StickerType.Regular + @SerialName(stickerFormatField) + @EncodeDefault + override val stickerFormat: StickerFormat = StickerFormat.Static } @Serializable @@ -199,6 +211,10 @@ data class MaskSimpleStickerSet( @SerialName(stickerTypeField) @EncodeDefault override val stickerType: StickerType = StickerType.Mask + + @SerialName(stickerFormatField) + @EncodeDefault + override val stickerFormat: StickerFormat = StickerFormat.Static } @Serializable @@ -247,6 +263,10 @@ data class CustomEmojiSimpleStickerSet( @SerialName(stickerTypeField) @EncodeDefault override val stickerType: StickerType = StickerType.CustomEmoji + + @SerialName(stickerFormatField) + @EncodeDefault + override val stickerFormat: StickerFormat = StickerFormat.Static } @Serializable