From e4f35c0ebacf7f1afac034d70c9910bc447205b9 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 11 Nov 2021 12:11:58 +0600 Subject: [PATCH] update KDocs --- .../dev/inmo/tgbotapi/types/ChatInviteLink.kt | 22 +++++++++++++++++++ .../inmo/tgbotapi/types/ChatJoinRequest.kt | 3 +++ 2 files changed, 25 insertions(+) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatInviteLink.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatInviteLink.kt index f6ea617990..76b7d58127 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatInviteLink.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatInviteLink.kt @@ -42,6 +42,9 @@ private fun ChatInviteLink.toRawChatInviteLink() = RawChatInviteLink( (this as? ChatInviteLinkWithJoinRequest) ?.leftToReview ) +/** + * Base interface for all chat invite links. See inheritors for more info or official [docs](https://core.telegram.org/bots/api#chatinvitelink) + */ @Serializable(ChatInviteLinkSerializer::class) sealed interface ChatInviteLink : WithUser { val inviteLink: String @@ -60,6 +63,9 @@ sealed interface ChatInviteLink : WithUser { } } +/** + * Base interface for all [ChatInviteLink]s which are NOT [PrimaryInviteLink] + */ @Serializable(ChatInviteLinkSerializer::class) sealed interface SecondaryChatInviteLink : ChatInviteLink { override val isPrimary: Boolean @@ -70,6 +76,9 @@ sealed interface SecondaryChatInviteLink : ChatInviteLink { } } +/** + * Primary invite link in the chat for this bot + */ @Serializable data class PrimaryInviteLink( @SerialName(inviteLinkField) @@ -87,6 +96,12 @@ data class PrimaryInviteLink( get() = null } +/** + * Represent [SecondaryChatInviteLink] which will require an aprovement from one of the administrators + * + * @see ChatJoinRequest + * @see dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate + */ @Serializable data class ChatInviteLinkWithJoinRequest( @SerialName(inviteLinkField) @@ -106,6 +121,9 @@ data class ChatInviteLinkWithJoinRequest( get() = expireDate ?.asDate } +/** + * Represent [SecondaryChatInviteLink] which will have limitation for the amount of chat members to join + */ @Serializable data class ChatInviteLinkWithLimitedMembers( @SerialName(inviteLinkField) @@ -125,6 +143,10 @@ data class ChatInviteLinkWithLimitedMembers( get() = expireDate ?.asDate } +/** + * Represent [SecondaryChatInviteLink] which have no any restrictions like [ChatInviteLinkWithJoinRequest] or + * [ChatInviteLinkWithLimitedMembers] + */ @Serializable data class ChatInviteLinkUnlimited( @SerialName(inviteLinkField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatJoinRequest.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatJoinRequest.kt index 05ca019dcc..bfdfc6050f 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatJoinRequest.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatJoinRequest.kt @@ -5,6 +5,9 @@ import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable +/** + * Represent a [ChatJoinRequest](https://core.telegram.org/bots/api#chatjoinrequest) + */ @Serializable data class ChatJoinRequest( @SerialName(chatField)