1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-22 16:47:13 +00:00

add Poll object

This commit is contained in:
InsanusMokrassar 2019-04-16 15:51:53 +08:00
parent 0af6e6ca15
commit b7d214d145
3 changed files with 26 additions and 1 deletions

View File

@ -2,7 +2,8 @@
## 0.13.0 Telegram Polls
* `PollOption` added
* Type `PollOption` and `AnonymousPollOption` added
* Type `Poll` added
## 0.12.0 Webhooks

View File

@ -15,6 +15,7 @@ typealias InvoicePayload = String
typealias ShippingOptionIdentifier = String
typealias StartParameter = String
typealias InlineMessageIdentifier = String
typealias PollIdentifier = String
val callbackQueryAnswerLength = 0 until 200
val captionLength = 0 until 1024
@ -29,6 +30,9 @@ val invoiceTitleLimit = 1 until 32
val invoiceDescriptionLimit = 1 until 256
val invoicePayloadBytesLimit = 1 until 128
val pollOptionTextLength = 1 .. 100
val pollQuectionTextLength = 1 until 256
val livePeriodLimit = 60 .. 86400
val inlineQueryAnswerResultsLimit = 0 .. 50
@ -76,6 +80,7 @@ const val pendingUpdateCountField = "pending_update_count"
const val lastErrorDateField = "last_error_date"
const val lastErrorMessageField = "last_error_message"
const val votesCountField = "voter_count"
const val isClosedField = "is_closed"
const val photoUrlField = "photo_url"
@ -181,6 +186,8 @@ const val payloadField = "payload"
const val vcardField = "vcard"
const val resultsField = "results"
const val certificateField = "certificate"
const val questionField = "question"
const val optionsField = "options"
const val pointField = "point"
const val xShiftField = "x_shift"

View File

@ -0,0 +1,17 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.polls
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class Poll(
@SerialName(idField)
val id: PollIdentifier,
@SerialName(questionField)
val question: String,
@SerialName(optionsField)
val options: List<PollOption>,
@SerialName(isClosedField)
val closed: Boolean = false
)