mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
add default votes in SimplePollOption
This commit is contained in:
parent
d9638849e2
commit
5f0a67187f
@ -12,6 +12,13 @@ import kotlinx.serialization.encoding.Encoder
|
|||||||
sealed class PollOption {
|
sealed class PollOption {
|
||||||
abstract val text: String
|
abstract val text: String
|
||||||
abstract val votes: Int
|
abstract val votes: Int
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun simple(
|
||||||
|
text: String,
|
||||||
|
votes: Int = 0
|
||||||
|
) = SimplePollOption(text, votes)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@ -19,7 +26,7 @@ data class SimplePollOption (
|
|||||||
@SerialName(textField)
|
@SerialName(textField)
|
||||||
override val text: String,
|
override val text: String,
|
||||||
@SerialName(votesCountField)
|
@SerialName(votesCountField)
|
||||||
override val votes: Int
|
override val votes: Int = 0
|
||||||
) : PollOption()
|
) : PollOption()
|
||||||
|
|
||||||
@RiskFeature
|
@RiskFeature
|
||||||
|
Loading…
Reference in New Issue
Block a user