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 }