mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
add Poll object
This commit is contained in:
parent
0af6e6ca15
commit
b7d214d145
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
## 0.13.0 Telegram Polls
|
## 0.13.0 Telegram Polls
|
||||||
|
|
||||||
* `PollOption` added
|
* Type `PollOption` and `AnonymousPollOption` added
|
||||||
|
* Type `Poll` added
|
||||||
|
|
||||||
## 0.12.0 Webhooks
|
## 0.12.0 Webhooks
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ typealias InvoicePayload = String
|
|||||||
typealias ShippingOptionIdentifier = String
|
typealias ShippingOptionIdentifier = String
|
||||||
typealias StartParameter = String
|
typealias StartParameter = String
|
||||||
typealias InlineMessageIdentifier = String
|
typealias InlineMessageIdentifier = String
|
||||||
|
typealias PollIdentifier = String
|
||||||
|
|
||||||
val callbackQueryAnswerLength = 0 until 200
|
val callbackQueryAnswerLength = 0 until 200
|
||||||
val captionLength = 0 until 1024
|
val captionLength = 0 until 1024
|
||||||
@ -29,6 +30,9 @@ val invoiceTitleLimit = 1 until 32
|
|||||||
val invoiceDescriptionLimit = 1 until 256
|
val invoiceDescriptionLimit = 1 until 256
|
||||||
val invoicePayloadBytesLimit = 1 until 128
|
val invoicePayloadBytesLimit = 1 until 128
|
||||||
|
|
||||||
|
val pollOptionTextLength = 1 .. 100
|
||||||
|
val pollQuectionTextLength = 1 until 256
|
||||||
|
|
||||||
val livePeriodLimit = 60 .. 86400
|
val livePeriodLimit = 60 .. 86400
|
||||||
|
|
||||||
val inlineQueryAnswerResultsLimit = 0 .. 50
|
val inlineQueryAnswerResultsLimit = 0 .. 50
|
||||||
@ -76,6 +80,7 @@ const val pendingUpdateCountField = "pending_update_count"
|
|||||||
const val lastErrorDateField = "last_error_date"
|
const val lastErrorDateField = "last_error_date"
|
||||||
const val lastErrorMessageField = "last_error_message"
|
const val lastErrorMessageField = "last_error_message"
|
||||||
const val votesCountField = "voter_count"
|
const val votesCountField = "voter_count"
|
||||||
|
const val isClosedField = "is_closed"
|
||||||
|
|
||||||
|
|
||||||
const val photoUrlField = "photo_url"
|
const val photoUrlField = "photo_url"
|
||||||
@ -181,6 +186,8 @@ const val payloadField = "payload"
|
|||||||
const val vcardField = "vcard"
|
const val vcardField = "vcard"
|
||||||
const val resultsField = "results"
|
const val resultsField = "results"
|
||||||
const val certificateField = "certificate"
|
const val certificateField = "certificate"
|
||||||
|
const val questionField = "question"
|
||||||
|
const val optionsField = "options"
|
||||||
|
|
||||||
const val pointField = "point"
|
const val pointField = "point"
|
||||||
const val xShiftField = "x_shift"
|
const val xShiftField = "x_shift"
|
||||||
|
@ -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
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user