diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 77fe66ed95..f4482e3fec 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -232,6 +232,10 @@ const val hasPrivateForwardsField = "has_private_forwards" const val hasRestrictedVoiceAndVideoMessagesField = "has_restricted_voice_and_video_messages" const val emojiStatusCustomEmojiIdField = "emoji_status_custom_emoji_id" const val emojiStatusExpirationDateField = "emoji_status_expiration_date" +const val accentColorIdField = "accent_color_id" +const val profileAccentColorIdField = "profile_accent_color_id" +const val backgroundCustomEmojiIdField = "background_custom_emoji_id" +const val profileBackgroundCustomEmojiIdField = "profile_background_custom_emoji_id" const val iconCustomEmojiIdField = "icon_custom_emoji_id" const val canJoinGroupsField = "can_join_groups" const val canReadAllGroupMessagesField = "can_read_all_group_messages" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt index aba9e0e404..4478b120ca 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/Extended.kt @@ -1,6 +1,7 @@ package dev.inmo.tgbotapi.types.chat import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.colors.ColorId import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer import dev.inmo.tgbotapi.types.reactions.Reaction @@ -39,7 +40,15 @@ data class ExtendedChannelChatImpl( @SerialName(emojiStatusCustomEmojiIdField) override val statusEmojiId: CustomEmojiId? = null, @SerialName(emojiStatusExpirationDateField) - override val statusEmojiExpiration: TelegramDate? = null + override val statusEmojiExpiration: TelegramDate? = null, + @SerialName(accentColorIdField) + override val accentColorId: ColorId = ColorId(0), + @SerialName(profileAccentColorIdField) + override val profileAccentColorId: ColorId? = null, + @SerialName(backgroundCustomEmojiIdField) + override val backgroundCustomEmojiId: CustomEmojiId? = null, + @SerialName(profileBackgroundCustomEmojiIdField) + override val profileBackgroundCustomEmojiId: CustomEmojiId? = null, ) : ExtendedChannelChat @Serializable @@ -67,7 +76,15 @@ data class ExtendedGroupChatImpl( @SerialName(emojiStatusCustomEmojiIdField) override val statusEmojiId: CustomEmojiId? = null, @SerialName(emojiStatusExpirationDateField) - override val statusEmojiExpiration: TelegramDate? = null + override val statusEmojiExpiration: TelegramDate? = null, + @SerialName(accentColorIdField) + override val accentColorId: ColorId = ColorId(0), + @SerialName(profileAccentColorIdField) + override val profileAccentColorId: ColorId? = null, + @SerialName(backgroundCustomEmojiIdField) + override val backgroundCustomEmojiId: CustomEmojiId? = null, + @SerialName(profileBackgroundCustomEmojiIdField) + override val profileBackgroundCustomEmojiId: CustomEmojiId? = null, ) : ExtendedGroupChat @Serializable @@ -94,7 +111,15 @@ data class ExtendedPrivateChatImpl( @SerialName(emojiStatusCustomEmojiIdField) override val statusEmojiId: CustomEmojiId? = null, @SerialName(emojiStatusExpirationDateField) - override val statusEmojiExpiration: TelegramDate? = null + override val statusEmojiExpiration: TelegramDate? = null, + @SerialName(accentColorIdField) + override val accentColorId: ColorId = ColorId(0), + @SerialName(profileAccentColorIdField) + override val profileAccentColorId: ColorId? = null, + @SerialName(backgroundCustomEmojiIdField) + override val backgroundCustomEmojiId: CustomEmojiId? = null, + @SerialName(profileBackgroundCustomEmojiIdField) + override val profileBackgroundCustomEmojiId: CustomEmojiId? = null, ) : ExtendedPrivateChat typealias ExtendedUser = ExtendedPrivateChatImpl @@ -144,7 +169,15 @@ data class ExtendedSupergroupChatImpl( @SerialName(emojiStatusCustomEmojiIdField) override val statusEmojiId: CustomEmojiId? = null, @SerialName(emojiStatusExpirationDateField) - override val statusEmojiExpiration: TelegramDate? = null + override val statusEmojiExpiration: TelegramDate? = null, + @SerialName(accentColorIdField) + override val accentColorId: ColorId = ColorId(0), + @SerialName(profileAccentColorIdField) + override val profileAccentColorId: ColorId? = null, + @SerialName(backgroundCustomEmojiIdField) + override val backgroundCustomEmojiId: CustomEmojiId? = null, + @SerialName(profileBackgroundCustomEmojiIdField) + override val profileBackgroundCustomEmojiId: CustomEmojiId? = null, ) : ExtendedSupergroupChat @Serializable @@ -192,7 +225,15 @@ data class ExtendedForumChatImpl( @SerialName(emojiStatusCustomEmojiIdField) override val statusEmojiId: CustomEmojiId? = null, @SerialName(emojiStatusExpirationDateField) - override val statusEmojiExpiration: TelegramDate? = null + override val statusEmojiExpiration: TelegramDate? = null, + @SerialName(accentColorIdField) + override val accentColorId: ColorId = ColorId(0), + @SerialName(profileAccentColorIdField) + override val profileAccentColorId: ColorId? = null, + @SerialName(backgroundCustomEmojiIdField) + override val backgroundCustomEmojiId: CustomEmojiId? = null, + @SerialName(profileBackgroundCustomEmojiIdField) + override val profileBackgroundCustomEmojiId: CustomEmojiId? = null, ) : ExtendedForumChat @Serializable @@ -211,7 +252,15 @@ data class ExtendedBot( @SerialName(supportInlineQueriesField) val supportsInlineQueries: Boolean = false, @SerialName(photoField) - override val chatPhoto: ChatPhoto? = null + override val chatPhoto: ChatPhoto? = null, + @SerialName(accentColorIdField) + override val accentColorId: ColorId = ColorId(0), + @SerialName(profileAccentColorIdField) + override val profileAccentColorId: ColorId? = null, + @SerialName(backgroundCustomEmojiIdField) + override val backgroundCustomEmojiId: CustomEmojiId? = null, + @SerialName(profileBackgroundCustomEmojiIdField) + override val profileBackgroundCustomEmojiId: CustomEmojiId? = null, ) : Bot(), ExtendedChat { @SerialName(isBotField) private val isBot = true @@ -223,4 +272,12 @@ data class UnknownExtendedChat( val rawJson: JsonObject ) : ExtendedChat { override val chatPhoto: ChatPhoto? = null + @SerialName(accentColorIdField) + override val accentColorId: ColorId = ColorId(0) + @SerialName(profileAccentColorIdField) + override val profileAccentColorId: ColorId? = null + @SerialName(backgroundCustomEmojiIdField) + override val backgroundCustomEmojiId: CustomEmojiId? = null + @SerialName(profileBackgroundCustomEmojiIdField) + override val profileBackgroundCustomEmojiId: CustomEmojiId? = null,\ } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt index 16be3e7ee4..7df107fade 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt @@ -1,6 +1,7 @@ package dev.inmo.tgbotapi.types.chat import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.colors.ColorId import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer import dev.inmo.tgbotapi.types.reactions.Reaction @@ -10,6 +11,10 @@ import kotlinx.serialization.Serializable @Serializable(ExtendedChatSerializer.Companion::class) sealed interface ExtendedChat : Chat { val chatPhoto: ChatPhoto? + val accentColorId: ColorId + val profileAccentColorId: ColorId? + val backgroundCustomEmojiId: CustomEmojiId? + val profileBackgroundCustomEmojiId: CustomEmojiId? } @Serializable(ExtendedChatSerializer.Companion::class) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/colors/ColorId.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/colors/ColorId.kt index 1e8e3e6e26..c53bb5410f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/colors/ColorId.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/colors/ColorId.kt @@ -8,10 +8,4 @@ import kotlin.jvm.JvmInline @JvmInline value class ColorId( val int: Int -) { - companion object { - val defaultAccentColors = mapOf( - ColorId(0) to setOf(HEXAColor(0xff0000ffu)), - ) - } -} \ No newline at end of file +) \ No newline at end of file