1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-09-30 06:26:08 +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 profileAccentColorIdField = "profile_accent_color_id"
const val backgroundCustomEmojiIdField = "background_custom_emoji_id" const val backgroundCustomEmojiIdField = "background_custom_emoji_id"
const val profileBackgroundCustomEmojiIdField = "profile_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 personalChatField = "personal_chat"
const val birthdateField = "birthdate" const val birthdateField = "birthdate"
const val hasVisibleHistoryField = "has_visible_history" const val hasVisibleHistoryField = "has_visible_history"

View File

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