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
|
2023-08-18 17:31:30 +00:00
|
|
|
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)
|
2023-11-25 20:06:30 +00:00
|
|
|
sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername, ExtendedOtherPartiesChat {
|
2022-04-21 18:16:41 +00:00
|
|
|
val bio: String
|
|
|
|
val hasPrivateForwards: Boolean
|
2022-08-14 15:56:25 +00:00
|
|
|
val hasRestrictedVoiceAndVideoMessages: Boolean
|
2022-11-06 08:21:28 +00:00
|
|
|
val statusEmojiId: CustomEmojiId?
|
2023-08-18 17:31:30 +00:00
|
|
|
val statusEmojiExpiration: TelegramDate?
|
2022-04-21 18:16:41 +00:00
|
|
|
|
|
|
|
val allowCreateUserIdLink: Boolean
|
|
|
|
get() = hasPrivateForwards
|
|
|
|
}
|
|
|
|
|
2023-11-25 20:06:30 +00:00
|
|
|
sealed interface ExtendedPublicChat : ExtendedOtherPartiesChat, PublicChat {
|
2022-04-21 18:16:41 +00:00
|
|
|
val description: String
|
|
|
|
val inviteLink: String?
|
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
|
2022-12-30 14:57:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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-11-25 20:06:30 +00:00
|
|
|
|
|
|
|
@Serializable(ExtendedChatSerializer.Companion::class)
|
|
|
|
sealed interface ExtendedOtherPartiesChat : ExtendedChat {
|
|
|
|
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
|
|
|
val pinnedMessage: Message?
|
|
|
|
}
|
|
|
|
|
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>
|
|
|
|
}
|