1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-25 19:48:43 +00:00

add emoji status in the most extended chats

This commit is contained in:
InsanusMokrassar 2024-01-04 18:06:40 +06:00
parent 860e35258c
commit 430240a6ad
2 changed files with 33 additions and 13 deletions

View File

@ -35,7 +35,11 @@ data class ExtendedChannelChatImpl(
@SerialName(hasHiddenMembersField)
override val membersHidden: Boolean = false,
@SerialName(availableReactionsField)
override val availableReactions: List<Reaction>? = null
override val availableReactions: List<Reaction>? = null,
@SerialName(emojiStatusCustomEmojiIdField)
override val statusEmojiId: CustomEmojiId? = null,
@SerialName(emojiStatusExpirationDateField)
override val statusEmojiExpiration: TelegramDate? = null
) : ExtendedChannelChat
@Serializable
@ -59,7 +63,11 @@ data class ExtendedGroupChatImpl(
@SerialName(hasHiddenMembersField)
override val membersHidden: Boolean = false,
@SerialName(availableReactionsField)
override val availableReactions: List<Reaction>? = null
override val availableReactions: List<Reaction>? = null,
@SerialName(emojiStatusCustomEmojiIdField)
override val statusEmojiId: CustomEmojiId? = null,
@SerialName(emojiStatusExpirationDateField)
override val statusEmojiExpiration: TelegramDate? = null
) : ExtendedGroupChat
@Serializable
@ -132,7 +140,11 @@ data class ExtendedSupergroupChatImpl(
@SerialName(hasHiddenMembersField)
override val membersHidden: Boolean = false,
@SerialName(availableReactionsField)
override val availableReactions: List<Reaction>? = null
override val availableReactions: List<Reaction>? = null,
@SerialName(emojiStatusCustomEmojiIdField)
override val statusEmojiId: CustomEmojiId? = null,
@SerialName(emojiStatusExpirationDateField)
override val statusEmojiExpiration: TelegramDate? = null
) : ExtendedSupergroupChat
@Serializable
@ -176,7 +188,11 @@ data class ExtendedForumChatImpl(
@SerialName(hasHiddenMembersField)
override val membersHidden: Boolean = false,
@SerialName(availableReactionsField)
override val availableReactions: List<Reaction>? = null
override val availableReactions: List<Reaction>? = null,
@SerialName(emojiStatusCustomEmojiIdField)
override val statusEmojiId: CustomEmojiId? = null,
@SerialName(emojiStatusExpirationDateField)
override val statusEmojiExpiration: TelegramDate? = null
) : ExtendedForumChat
@Serializable

View File

@ -7,6 +7,17 @@ import dev.inmo.tgbotapi.types.reactions.Reaction
import korlibs.time.DateTime
import kotlinx.serialization.Serializable
@Serializable(ExtendedChatSerializer.Companion::class)
sealed interface ExtendedChat : Chat {
val chatPhoto: ChatPhoto?
}
@Serializable(ExtendedChatSerializer.Companion::class)
sealed interface ExtendedNonBotChat : ExtendedChat {
val statusEmojiId: CustomEmojiId?
val statusEmojiExpiration: TelegramDate?
}
@Serializable(ExtendedChatSerializer.Companion::class)
sealed interface ExtendedChannelChat : ChannelChat, ExtendedPublicChat, ExtendedChatWithUsername {
val linkedGroupChatId: IdChatIdentifier?
@ -18,18 +29,16 @@ sealed interface ExtendedGroupChat : GroupChat, ExtendedPublicChat {
}
@Serializable(ExtendedChatSerializer.Companion::class)
sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername {
sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername, ExtendedNonBotChat {
val bio: String
val hasPrivateForwards: Boolean
val hasRestrictedVoiceAndVideoMessages: Boolean
val statusEmojiId: CustomEmojiId?
val statusEmojiExpiration: TelegramDate?
val allowCreateUserIdLink: Boolean
get() = hasPrivateForwards
}
sealed interface ExtendedPublicChat : ExtendedChat, PublicChat {
sealed interface ExtendedPublicChat : ExtendedChat, PublicChat, ExtendedNonBotChat {
val description: String
val inviteLink: String?
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
@ -65,11 +74,6 @@ sealed interface ExtendedSupergroupChat : SupergroupChat, ExtendedGroupChat, Ext
@Serializable(ExtendedChatSerializer.Companion::class)
sealed interface ExtendedForumChat : ExtendedSupergroupChat, ForumChat
@Serializable(ExtendedChatSerializer.Companion::class)
sealed interface ExtendedChat : Chat {
val chatPhoto: ChatPhoto?
}
@Serializable(ExtendedChatSerializer.Companion::class)
sealed interface ExtendedChatWithUsername : UsernameChat, ExtendedChat {
val activeUsernames: List<Username>