mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-04-22 01:42:26 +00:00
continue fix of fields absence
This commit is contained in:
@@ -39,6 +39,10 @@ class SendQuizPoll internal constructor(
|
||||
override val isAnonymous: Boolean = true,
|
||||
@SerialName(isClosedField)
|
||||
override val isClosed: Boolean = false,
|
||||
@SerialName(allowsMultipleAnswersField)
|
||||
val allowMultipleAnswers: Boolean = false,
|
||||
@SerialName(allowsRevotingField)
|
||||
val allowsRevoting: Boolean = false,
|
||||
@SerialName(shuffleOptionsField)
|
||||
val shuffleOptions: Boolean = false,
|
||||
@SerialName(hideResultsUntilClosesField)
|
||||
@@ -106,8 +110,10 @@ class SendQuizPoll internal constructor(
|
||||
explanationParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
allowsRevoting: Boolean = false,
|
||||
shuffleOptions: Boolean = false,
|
||||
hideResultsUntilCloses: Boolean = false,
|
||||
hideResultsUntilCloses: Boolean = false,
|
||||
description: String? = null,
|
||||
descriptionParseMode: ParseMode? = null,
|
||||
openPeriod: LongSeconds? = null,
|
||||
@@ -131,6 +137,8 @@ class SendQuizPoll internal constructor(
|
||||
rawQuestionEntities = emptyList(),
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
allowsRevoting = allowsRevoting,
|
||||
shuffleOptions = shuffleOptions,
|
||||
hideResultsUntilCloses = hideResultsUntilCloses,
|
||||
explanation = explanation,
|
||||
@@ -162,8 +170,10 @@ class SendQuizPoll internal constructor(
|
||||
explanationParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
allowsRevoting: Boolean = false,
|
||||
shuffleOptions: Boolean = false,
|
||||
hideResultsUntilCloses: Boolean = false,
|
||||
hideResultsUntilCloses: Boolean = false,
|
||||
description: String? = null,
|
||||
descriptionParseMode: ParseMode? = null,
|
||||
openPeriod: LongSeconds? = null,
|
||||
@@ -187,6 +197,8 @@ class SendQuizPoll internal constructor(
|
||||
rawQuestionEntities = questionEntities.toRawMessageEntities(),
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
allowsRevoting = allowsRevoting,
|
||||
shuffleOptions = shuffleOptions,
|
||||
hideResultsUntilCloses = hideResultsUntilCloses,
|
||||
explanation = explanation,
|
||||
@@ -218,8 +230,10 @@ class SendQuizPoll internal constructor(
|
||||
explanationTextSources: List<TextSource>? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
allowsRevoting: Boolean = false,
|
||||
shuffleOptions: Boolean = false,
|
||||
hideResultsUntilCloses: Boolean = false,
|
||||
hideResultsUntilCloses: Boolean = false,
|
||||
descriptionTextSources: List<TextSource>? = null,
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
@@ -242,6 +256,8 @@ class SendQuizPoll internal constructor(
|
||||
rawQuestionEntities = emptyList(),
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
allowsRevoting = allowsRevoting,
|
||||
shuffleOptions = shuffleOptions,
|
||||
hideResultsUntilCloses = hideResultsUntilCloses,
|
||||
explanation = explanationTextSources?.makeSourceString(),
|
||||
@@ -272,8 +288,10 @@ class SendQuizPoll internal constructor(
|
||||
explanationTextSources: List<TextSource>? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
allowsRevoting: Boolean = false,
|
||||
shuffleOptions: Boolean = false,
|
||||
hideResultsUntilCloses: Boolean = false,
|
||||
hideResultsUntilCloses: Boolean = false,
|
||||
descriptionTextSources: List<TextSource>? = null,
|
||||
openPeriod: LongSeconds? = null,
|
||||
closeDate: LongSeconds? = null,
|
||||
@@ -296,6 +314,8 @@ class SendQuizPoll internal constructor(
|
||||
rawQuestionEntities = questionEntities.toRawMessageEntities(),
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
allowsRevoting = allowsRevoting,
|
||||
shuffleOptions = shuffleOptions,
|
||||
hideResultsUntilCloses = hideResultsUntilCloses,
|
||||
explanation = explanationTextSources?.makeSourceString(),
|
||||
@@ -346,6 +366,8 @@ fun SendQuizPoll(
|
||||
explanationParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
allowsRevoting: Boolean = false,
|
||||
shuffleOptions: Boolean = false,
|
||||
hideResultsUntilCloses: Boolean = false,
|
||||
description: String? = null,
|
||||
@@ -370,6 +392,8 @@ fun SendQuizPoll(
|
||||
explanationParseMode = explanationParseMode,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
allowsRevoting = allowsRevoting,
|
||||
shuffleOptions = shuffleOptions,
|
||||
hideResultsUntilCloses = hideResultsUntilCloses,
|
||||
description = description,
|
||||
@@ -398,6 +422,8 @@ fun SendQuizPoll(
|
||||
explanationParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
allowsRevoting: Boolean = false,
|
||||
shuffleOptions: Boolean = false,
|
||||
hideResultsUntilCloses: Boolean = false,
|
||||
description: String? = null,
|
||||
@@ -421,6 +447,8 @@ fun SendQuizPoll(
|
||||
explanationParseMode = explanationParseMode,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
allowsRevoting = allowsRevoting,
|
||||
shuffleOptions = shuffleOptions,
|
||||
hideResultsUntilCloses = hideResultsUntilCloses,
|
||||
description = description,
|
||||
@@ -449,6 +477,8 @@ fun SendQuizPoll(
|
||||
explanationTextSources: List<TextSource>? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
allowsRevoting: Boolean = false,
|
||||
shuffleOptions: Boolean = false,
|
||||
hideResultsUntilCloses: Boolean = false,
|
||||
descriptionTextSources: List<TextSource>? = null,
|
||||
@@ -471,6 +501,8 @@ fun SendQuizPoll(
|
||||
explanationTextSources = explanationTextSources,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
allowsRevoting = allowsRevoting,
|
||||
shuffleOptions = shuffleOptions,
|
||||
hideResultsUntilCloses = hideResultsUntilCloses,
|
||||
descriptionTextSources = descriptionTextSources,
|
||||
@@ -497,6 +529,8 @@ fun SendQuizPoll(
|
||||
explanationTextSources: List<TextSource>? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
allowMultipleAnswers: Boolean = false,
|
||||
allowsRevoting: Boolean = false,
|
||||
shuffleOptions: Boolean = false,
|
||||
hideResultsUntilCloses: Boolean = false,
|
||||
descriptionTextSources: List<TextSource>? = null,
|
||||
@@ -518,6 +552,8 @@ fun SendQuizPoll(
|
||||
explanationTextSources = explanationTextSources,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
allowMultipleAnswers = allowMultipleAnswers,
|
||||
allowsRevoting = allowsRevoting,
|
||||
shuffleOptions = shuffleOptions,
|
||||
hideResultsUntilCloses = hideResultsUntilCloses,
|
||||
descriptionTextSources = descriptionTextSources,
|
||||
|
||||
@@ -96,7 +96,7 @@ private class RawPoll(
|
||||
@SerialName(explanationEntitiesField)
|
||||
val explanationEntities: List<RawMessageEntity> = emptyList(),
|
||||
@SerialName(allowsRevotingField)
|
||||
val allowsRevoting: Boolean = true,
|
||||
val allowsRevoting: Boolean? = null,
|
||||
@SerialName(descriptionField)
|
||||
val description: String? = null,
|
||||
@SerialName(descriptionEntitiesField)
|
||||
@@ -171,7 +171,7 @@ data class QuizPoll(
|
||||
override val isClosed: Boolean = false,
|
||||
override val isAnonymous: Boolean = false,
|
||||
override val allowMultipleAnswers: Boolean = false,
|
||||
override val allowsRevoting: Boolean = true,
|
||||
override val allowsRevoting: Boolean = false,
|
||||
override val scheduledCloseInfo: ScheduledCloseInfo? = null,
|
||||
override val descriptionTextSources: List<TextSource> = emptyList()
|
||||
) : Poll
|
||||
@@ -197,7 +197,7 @@ object PollSerializer : KSerializer<Poll> {
|
||||
isClosed = rawPoll.isClosed,
|
||||
isAnonymous = rawPoll.isAnonymous,
|
||||
allowMultipleAnswers = rawPoll.allowMultipleAnswers,
|
||||
allowsRevoting = rawPoll.allowsRevoting,
|
||||
allowsRevoting = rawPoll.allowsRevoting ?: false,
|
||||
scheduledCloseInfo = rawPoll.scheduledCloseInfo,
|
||||
descriptionTextSources = rawPoll.description?.let { rawPoll.descriptionEntities.asTextSources(it) } ?: emptyList()
|
||||
)
|
||||
@@ -210,7 +210,7 @@ object PollSerializer : KSerializer<Poll> {
|
||||
isClosed = rawPoll.isClosed,
|
||||
isAnonymous = rawPoll.isAnonymous,
|
||||
allowMultipleAnswers = rawPoll.allowMultipleAnswers,
|
||||
allowsRevoting = rawPoll.allowsRevoting,
|
||||
allowsRevoting = rawPoll.allowsRevoting ?: true,
|
||||
scheduledCloseInfo = rawPoll.scheduledCloseInfo,
|
||||
descriptionTextSources = rawPoll.description?.let { rawPoll.descriptionEntities.asTextSources(it) } ?: emptyList()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user