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

75 lines
2.4 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.*
import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
import korlibs.time.DateTime
2022-04-21 18:16:41 +00:00
import kotlinx.serialization.Serializable
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)
2022-11-06 08:26:51 +00:00
sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername {
2022-04-21 18:16:41 +00:00
val bio: String
val hasPrivateForwards: Boolean
val hasRestrictedVoiceAndVideoMessages: Boolean
val statusEmojiId: CustomEmojiId?
val statusEmojiExpiration: TelegramDate?
2022-04-21 18:16:41 +00:00
val allowCreateUserIdLink: Boolean
get() = hasPrivateForwards
}
sealed interface ExtendedPublicChat : ExtendedChat, PublicChat {
val description: String
val inviteLink: String?
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
val pinnedMessage: Message?
2022-12-30 14:55:47 +00:00
val membersHidden: 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?
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-04-21 18:16:41 +00:00
sealed interface ExtendedChat : Chat {
val chatPhoto: ChatPhoto?
}
2022-11-06 08:26:51 +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>
}