1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-01 07:25:23 +00:00
tgbotapi/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt

88 lines
3.0 KiB
Kotlin
Raw Normal View History

2022-04-21 18:16:41 +00:00
package dev.inmo.tgbotapi.types.chat
import dev.inmo.tgbotapi.types.*
2024-01-05 14:30:07 +00:00
import dev.inmo.tgbotapi.types.colors.ColorId
2024-01-07 09:52:49 +00:00
import dev.inmo.tgbotapi.types.message.abstracts.AccessibleMessage
2022-04-21 18:16:41 +00:00
import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
2023-12-31 10:38:22 +00:00
import dev.inmo.tgbotapi.types.reactions.Reaction
2022-04-21 18:16:41 +00:00
import kotlinx.serialization.Serializable
@Serializable(ExtendedChatSerializer.Companion::class)
sealed interface ExtendedChat : Chat {
val chatPhoto: ChatPhoto?
2024-01-05 14:30:07 +00:00
val accentColorId: ColorId
val profileAccentColorId: ColorId?
val backgroundCustomEmojiId: CustomEmojiId?
val profileBackgroundCustomEmojiId: CustomEmojiId?
}
@Serializable(ExtendedChatSerializer.Companion::class)
sealed interface ExtendedNonBotChat : ExtendedChat {
val statusEmojiId: CustomEmojiId?
val statusEmojiExpiration: TelegramDate?
}
2023-04-13 13:26:58 +00:00
@Serializable(ExtendedChatSerializer.Companion::class)
2022-11-06 08:26:51 +00:00
sealed interface ExtendedChannelChat : ChannelChat, ExtendedPublicChat, ExtendedChatWithUsername {
2022-11-10 09:56:38 +00:00
val linkedGroupChatId: IdChatIdentifier?
2022-04-21 18:16:41 +00:00
}
2023-04-13 13:26:58 +00:00
@Serializable(ExtendedChatSerializer.Companion::class)
2022-04-21 18:16:41 +00:00
sealed interface ExtendedGroupChat : GroupChat, ExtendedPublicChat {
val permissions: ChatPermissions
}
2023-04-13 13:26:58 +00:00
@Serializable(ExtendedChatSerializer.Companion::class)
sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername, ExtendedNonBotChat {
2022-04-21 18:16:41 +00:00
val bio: String
val hasPrivateForwards: Boolean
val hasRestrictedVoiceAndVideoMessages: Boolean
2022-04-21 18:16:41 +00:00
val allowCreateUserIdLink: Boolean
get() = hasPrivateForwards
}
sealed interface ExtendedPublicChat : ExtendedChat, PublicChat, ExtendedNonBotChat {
2022-04-21 18:16:41 +00:00
val description: String
val inviteLink: String?
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
val pinnedMessage: Message?
2022-12-30 14:55:47 +00:00
val membersHidden: Boolean
2023-12-31 10:38:22 +00:00
val availableReactions: List<Reaction>?
val newMembersSeeHistory: Boolean
2022-04-21 18:16:41 +00:00
}
2023-04-13 13:26:58 +00:00
@Serializable(ExtendedChatSerializer.Companion::class)
2022-11-06 08:26:51 +00:00
sealed interface ExtendedSupergroupChat : SupergroupChat, ExtendedGroupChat, ExtendedChatWithUsername {
2022-04-21 18:16:41 +00:00
val slowModeDelay: Long?
val stickerSetName: StickerSetName?
val canSetStickerSet: Boolean
2022-11-10 09:56:38 +00:00
val linkedChannelChatId: IdChatIdentifier?
2024-02-16 15:57:03 +00:00
val unrestrictBoostsCount: Int?
2022-04-21 18:16:41 +00:00
val location: ChatLocation?
2022-06-21 11:34:14 +00:00
/**
* This field represents field "join_to_send_messages" from API
*/
2022-06-21 12:30:31 +00:00
val requiresJoinForMessaging: Boolean
2022-06-21 11:34:14 +00:00
/**
* This field represents field "join_by_request" from API
*/
2022-06-21 12:30:31 +00:00
val requireAdminApproveToJoin: Boolean
/**
* This field represents field "has_aggressive_anti_spam_enabled" from API
*/
val isAggressiveAntiSpamEnabled: Boolean
2022-04-21 18:16:41 +00:00
}
2023-04-13 13:26:58 +00:00
@Serializable(ExtendedChatSerializer.Companion::class)
2022-11-10 09:56:38 +00:00
sealed interface ExtendedForumChat : ExtendedSupergroupChat, ForumChat
2022-11-06 06:51:53 +00:00
2023-04-13 13:26:58 +00:00
@Serializable(ExtendedChatSerializer.Companion::class)
2022-11-06 08:26:51 +00:00
sealed interface ExtendedChatWithUsername : UsernameChat, ExtendedChat {
val activeUsernames: List<Username>
}