diff --git a/CHANGELOG.md b/CHANGELOG.md index dc0e8d26af..ba98e80970 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * `RegularPoll` type was added to represent polls with type `regular` * `QuizPoll` type was added to represent polls with type `quiz` * `UnknownPollType` type was added to represent polls which are unknown in current version +* `AnonymousPollOption` was renamed to `SimplePollOption` * `SendPoll` was rewritten as sealed class * `SendRegularPoll` was created and represent `sendPoll` method with type `regular` * `SendQuizPoll` was created and represent `sendPoll` method with type `quiz` diff --git a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/polls/PollOption.kt b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/polls/PollOption.kt index 63eef91eaf..247a7567aa 100644 --- a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/polls/PollOption.kt +++ b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/polls/PollOption.kt @@ -12,7 +12,7 @@ sealed class PollOption { } @Serializable -data class AnonymousPollOption ( +data class SimplePollOption ( @SerialName(textField) override val text: String, @SerialName(votesCountField) @@ -22,13 +22,13 @@ data class AnonymousPollOption ( internal object PollOptionSerializer : KSerializer { override val descriptor: SerialDescriptor = StringDescriptor.withName(PollOption::class.simpleName ?: "PollOption") - override fun deserialize(decoder: Decoder): PollOption = AnonymousPollOption.serializer().deserialize( + override fun deserialize(decoder: Decoder): PollOption = SimplePollOption.serializer().deserialize( decoder ) override fun serialize(encoder: Encoder, obj: PollOption) { when (obj) { - is AnonymousPollOption -> AnonymousPollOption.serializer().serialize( + is SimplePollOption -> SimplePollOption.serializer().serialize( encoder, obj )