From c260597799667a10b8c82e9a314d91a29880fba2 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 20 Aug 2023 02:30:36 +0600 Subject: [PATCH] fixes in poll answer --- .../kotlin/dev/inmo/tgbotapi/types/polls/PollAnswer.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/PollAnswer.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/PollAnswer.kt index 9242251a49..644196389e 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/PollAnswer.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/polls/PollAnswer.kt @@ -56,12 +56,12 @@ sealed interface PollAnswer: FromUser { private data class PollAnswerSurrogate( @SerialName(pollIdField) val pollId: PollIdentifier, - @SerialName(userField) - val user: User, @SerialName(optionIdsField) val chosen: List, + @SerialName(userField) + val user: User = Anonymous.defaultUser, @SerialName(voterChatField) - val voterChat: ChannelChat? + val voterChat: ChannelChat? = null ) operator fun invoke( pollId: PollIdentifier, @@ -86,8 +86,8 @@ sealed interface PollAnswer: FromUser { encoder, PollAnswerSurrogate( value.pollId, - value.user, value.chosen, + value.user, (value as? Anonymous) ?.voterChat ) )