1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

add support of availableReactions

This commit is contained in:
InsanusMokrassar 2023-12-31 16:38:22 +06:00
parent 3026c8708d
commit 90225a9380
3 changed files with 16 additions and 4 deletions

View File

@ -464,6 +464,7 @@ const val userField = "user"
const val dateField = "date" const val dateField = "date"
const val reactionsField = "reactions" const val reactionsField = "reactions"
const val reactionField = "reaction" const val reactionField = "reaction"
const val availableReactionsField = "available_reactions"
const val isBigField = "is_big" const val isBigField = "is_big"
const val oldReactionField = "old_reaction" const val oldReactionField = "old_reaction"
const val newReactionField = "new_reaction" const val newReactionField = "new_reaction"

View File

@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.types.chat
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
import dev.inmo.tgbotapi.types.reactions.Reaction
import dev.inmo.tgbotapi.utils.RiskFeature import dev.inmo.tgbotapi.utils.RiskFeature
import korlibs.time.DateTime import korlibs.time.DateTime
import kotlinx.serialization.SerialName import kotlinx.serialization.SerialName
@ -32,7 +33,9 @@ data class ExtendedChannelChatImpl(
@SerialName(linkedChatIdField) @SerialName(linkedChatIdField)
override val linkedGroupChatId: IdChatIdentifier? = null, override val linkedGroupChatId: IdChatIdentifier? = null,
@SerialName(hasHiddenMembersField) @SerialName(hasHiddenMembersField)
override val membersHidden: Boolean = false override val membersHidden: Boolean = false,
@SerialName(availableReactionsField)
override val availableReactions: List<Reaction>? = null
) : ExtendedChannelChat ) : ExtendedChannelChat
@Serializable @Serializable
@ -54,7 +57,9 @@ data class ExtendedGroupChatImpl(
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class) @Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
override val pinnedMessage: Message? = null, override val pinnedMessage: Message? = null,
@SerialName(hasHiddenMembersField) @SerialName(hasHiddenMembersField)
override val membersHidden: Boolean = false override val membersHidden: Boolean = false,
@SerialName(availableReactionsField)
override val availableReactions: List<Reaction>? = null
) : ExtendedGroupChat ) : ExtendedGroupChat
@Serializable @Serializable
@ -125,7 +130,9 @@ data class ExtendedSupergroupChatImpl(
@SerialName(hasAggressiveAntiSpamEnabledField) @SerialName(hasAggressiveAntiSpamEnabledField)
override val isAggressiveAntiSpamEnabled: Boolean = false, override val isAggressiveAntiSpamEnabled: Boolean = false,
@SerialName(hasHiddenMembersField) @SerialName(hasHiddenMembersField)
override val membersHidden: Boolean = false override val membersHidden: Boolean = false,
@SerialName(availableReactionsField)
override val availableReactions: List<Reaction>? = null
) : ExtendedSupergroupChat ) : ExtendedSupergroupChat
@Serializable @Serializable
@ -167,7 +174,9 @@ data class ExtendedForumChatImpl(
@SerialName(hasAggressiveAntiSpamEnabledField) @SerialName(hasAggressiveAntiSpamEnabledField)
override val isAggressiveAntiSpamEnabled: Boolean = false, override val isAggressiveAntiSpamEnabled: Boolean = false,
@SerialName(hasHiddenMembersField) @SerialName(hasHiddenMembersField)
override val membersHidden: Boolean = false override val membersHidden: Boolean = false,
@SerialName(availableReactionsField)
override val availableReactions: List<Reaction>? = null
) : ExtendedForumChat ) : ExtendedForumChat
@Serializable @Serializable

View File

@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.types.chat
import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
import dev.inmo.tgbotapi.types.reactions.Reaction
import korlibs.time.DateTime import korlibs.time.DateTime
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
@ -34,6 +35,7 @@ sealed interface ExtendedPublicChat : ExtendedChat, PublicChat {
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class) @Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
val pinnedMessage: Message? val pinnedMessage: Message?
val membersHidden: Boolean val membersHidden: Boolean
val availableReactions: List<Reaction>?
} }
@Serializable(ExtendedChatSerializer.Companion::class) @Serializable(ExtendedChatSerializer.Companion::class)