1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-29 04:47:48 +00:00

add support of max_reaction_count

This commit is contained in:
InsanusMokrassar 2024-05-07 00:25:27 +06:00
parent 6acf4bc927
commit 905486fff9
3 changed files with 18 additions and 2 deletions

View File

@ -150,6 +150,7 @@ 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 maxReactionCountField = "max_reaction_count"
const val personalChatField = "personal_chat"
const val birthdateField = "birthdate"
const val hasVisibleHistoryField = "has_visible_history"

View File

@ -53,7 +53,9 @@ data class ExtendedChannelChatImpl(
@SerialName(profileBackgroundCustomEmojiIdField)
override val profileBackgroundCustomEmojiId: CustomEmojiId? = null,
@SerialName(hasVisibleHistoryField)
override val newMembersSeeHistory: Boolean = false
override val newMembersSeeHistory: Boolean = false,
@SerialName(maxReactionCountField)
override val maxReactionsCount: Int = 3,
) : ExtendedChannelChat
@Serializable
@ -92,6 +94,8 @@ data class ExtendedGroupChatImpl(
override val profileBackgroundCustomEmojiId: CustomEmojiId? = null,
@SerialName(hasVisibleHistoryField)
override val newMembersSeeHistory: Boolean = false,
@SerialName(maxReactionCountField)
override val maxReactionsCount: Int = 3,
) : ExtendedGroupChat
@Serializable
@ -137,7 +141,9 @@ data class ExtendedPrivateChatImpl(
override val birthdate: Birthdate? = null,
@SerialName(personalChatField)
@Serializable(PreviewChatSerializer::class)
override val personalChat: PreviewChannelChat? = null
override val personalChat: PreviewChannelChat? = null,
@SerialName(maxReactionCountField)
override val maxReactionsCount: Int = 3,
) : ExtendedPrivateChat
typealias ExtendedUser = ExtendedPrivateChatImpl
@ -202,6 +208,8 @@ data class ExtendedSupergroupChatImpl(
override val unrestrictBoostsCount: Int? = null,
@SerialName(customEmojiStickerSetNameField)
override val customEmojiStickerSetName: StickerSetName? = null,
@SerialName(maxReactionCountField)
override val maxReactionsCount: Int = 3,
) : ExtendedSupergroupChat
@Serializable
@ -264,6 +272,8 @@ data class ExtendedForumChatImpl(
override val unrestrictBoostsCount: Int? = null,
@SerialName(customEmojiStickerSetNameField)
override val customEmojiStickerSetName: StickerSetName? = null,
@SerialName(maxReactionCountField)
override val maxReactionsCount: Int = 3,
) : ExtendedForumChat
@Serializable
@ -294,6 +304,8 @@ data class ExtendedBot(
override val backgroundCustomEmojiId: CustomEmojiId? = null,
@SerialName(profileBackgroundCustomEmojiIdField)
override val profileBackgroundCustomEmojiId: CustomEmojiId? = null,
@SerialName(maxReactionCountField)
override val maxReactionsCount: Int = 3,
) : Bot(), ExtendedChat {
@SerialName(isBotField)
private val isBot = true
@ -321,4 +333,6 @@ data class UnknownExtendedChat(
override val backgroundCustomEmojiId: CustomEmojiId? = null
@SerialName(profileBackgroundCustomEmojiIdField)
override val profileBackgroundCustomEmojiId: CustomEmojiId? = null
@SerialName(maxReactionCountField)
override val maxReactionsCount: Int = 3
}

View File

@ -18,6 +18,7 @@ sealed interface ExtendedChat : Chat {
val profileAccentColorId: ColorId?
val backgroundCustomEmojiId: CustomEmojiId?
val profileBackgroundCustomEmojiId: CustomEmojiId?
val maxReactionsCount: Int
}
@Serializable(ExtendedChatSerializer.Companion::class)