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

active_usernames support

This commit is contained in:
InsanusMokrassar 2022-11-06 14:26:51 +06:00
parent 3f6f04d00f
commit acd3298d4d
3 changed files with 17 additions and 3 deletions

View File

@ -234,6 +234,7 @@ const val isAnimatedField = "is_animated"
const val isVideoField = "is_video" const val isVideoField = "is_video"
const val inviteLinkField = "invite_link" const val inviteLinkField = "invite_link"
const val pinnedMessageField = "pinned_message" const val pinnedMessageField = "pinned_message"
const val activeUsernamesField = "active_usernames"
const val customTitleField = "custom_title" const val customTitleField = "custom_title"
const val optionIdsField = "option_ids" const val optionIdsField = "option_ids"
const val ipAddressField = "ip_address" const val ipAddressField = "ip_address"

View File

@ -15,6 +15,8 @@ data class ExtendedChannelChatImpl(
override val title: String, override val title: String,
@SerialName(usernameField) @SerialName(usernameField)
override val username: Username? = null, override val username: Username? = null,
@SerialName(activeUsernamesField)
override val activeUsernames: List<Username> = emptyList(),
@SerialName(photoField) @SerialName(photoField)
override val chatPhoto: ChatPhoto? = null, override val chatPhoto: ChatPhoto? = null,
@SerialName(descriptionField) @SerialName(descriptionField)
@ -55,6 +57,8 @@ data class ExtendedPrivateChatImpl(
override val chatPhoto: ChatPhoto? = null, override val chatPhoto: ChatPhoto? = null,
@SerialName(usernameField) @SerialName(usernameField)
override val username: Username? = null, override val username: Username? = null,
@SerialName(activeUsernamesField)
override val activeUsernames: List<Username> = emptyList(),
@SerialName(firstNameField) @SerialName(firstNameField)
override val firstName: String = "", override val firstName: String = "",
@SerialName(lastNameField) @SerialName(lastNameField)
@ -79,6 +83,8 @@ data class ExtendedSupergroupChatImpl(
override val title: String, override val title: String,
@SerialName(usernameField) @SerialName(usernameField)
override val username: Username? = null, override val username: Username? = null,
@SerialName(activeUsernamesField)
override val activeUsernames: List<Username> = emptyList(),
@SerialName(photoField) @SerialName(photoField)
override val chatPhoto: ChatPhoto? = null, override val chatPhoto: ChatPhoto? = null,
@SerialName(permissionsField) @SerialName(permissionsField)
@ -114,6 +120,8 @@ data class ExtendedForumChatImpl(
override val title: String, override val title: String,
@SerialName(usernameField) @SerialName(usernameField)
override val username: Username? = null, override val username: Username? = null,
@SerialName(activeUsernamesField)
override val activeUsernames: List<Username> = emptyList(),
@SerialName(photoField) @SerialName(photoField)
override val chatPhoto: ChatPhoto? = null, override val chatPhoto: ChatPhoto? = null,
@SerialName(permissionsField) @SerialName(permissionsField)

View File

@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializ
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
@Serializable(ExtendedChatSerializer::class) @Serializable(ExtendedChatSerializer::class)
sealed interface ExtendedChannelChat : ChannelChat, ExtendedPublicChat { sealed interface ExtendedChannelChat : ChannelChat, ExtendedPublicChat, ExtendedChatWithUsername {
val linkedGroupChatId: ChatId? val linkedGroupChatId: ChatId?
} }
@ -16,7 +16,7 @@ sealed interface ExtendedGroupChat : GroupChat, ExtendedPublicChat {
} }
@Serializable(ExtendedChatSerializer::class) @Serializable(ExtendedChatSerializer::class)
sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChat { sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername {
val bio: String val bio: String
val hasPrivateForwards: Boolean val hasPrivateForwards: Boolean
val hasRestrictedVoiceAndVideoMessages: Boolean val hasRestrictedVoiceAndVideoMessages: Boolean
@ -34,7 +34,7 @@ sealed interface ExtendedPublicChat : ExtendedChat, PublicChat {
} }
@Serializable(ExtendedChatSerializer::class) @Serializable(ExtendedChatSerializer::class)
sealed interface ExtendedSupergroupChat : SupergroupChat, ExtendedGroupChat { sealed interface ExtendedSupergroupChat : SupergroupChat, ExtendedGroupChat, ExtendedChatWithUsername {
val slowModeDelay: Long? val slowModeDelay: Long?
val stickerSetName: StickerSetName? val stickerSetName: StickerSetName?
val canSetStickerSet: Boolean val canSetStickerSet: Boolean
@ -59,3 +59,8 @@ sealed interface ExtendedForumChat : ExtendedSupergroupChat
sealed interface ExtendedChat : Chat { sealed interface ExtendedChat : Chat {
val chatPhoto: ChatPhoto? val chatPhoto: ChatPhoto?
} }
@Serializable(ExtendedChatSerializer::class)
sealed interface ExtendedChatWithUsername : UsernameChat, ExtendedChat {
val activeUsernames: List<Username>
}