From 072264faad9647e96d1eec5c6b9443afde93979b Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 18 Apr 2024 14:47:22 +0600 Subject: [PATCH] add support of users in UsersShared --- .../dev/inmo/tgbotapi/types/request/UsersShared.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/request/UsersShared.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/request/UsersShared.kt index 59622a71ed..3128cf3f44 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/request/UsersShared.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/request/UsersShared.kt @@ -1,6 +1,7 @@ package dev.inmo.tgbotapi.types.request import dev.inmo.tgbotapi.types.* +import dev.inmo.tgbotapi.types.chat.PreviewUser import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -8,15 +9,18 @@ import kotlinx.serialization.Serializable data class UsersShared( @SerialName(requestIdField) override val requestId: RequestId, - @SerialName(userIdsField) - val userIds: List + @SerialName(usersField) + val users: List ) : ChatSharedRequest { + val userIds: List by lazy { + users.map { it.id } + } val userId: UserId get() = userIds.first() constructor( requestId: RequestId, - userId: UserId - ) : this(requestId, listOf(userId)) + user: PreviewUser + ) : this(requestId, listOf(user)) override val chatId: ChatId get() = userId }