mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-09 01:59:47 +00:00
fixes in sends and poll.kt
This commit is contained in:
@@ -129,8 +129,8 @@ fun Poll.createRequest(
|
||||
textSources,
|
||||
options.map { it.asInput() },
|
||||
correctOptionId,
|
||||
explanationTextSources,
|
||||
scheduledCloseInfo,
|
||||
explanationTextSources,
|
||||
isAnonymous,
|
||||
isClosed,
|
||||
threadId,
|
||||
|
@@ -13,7 +13,6 @@ import dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo
|
||||
import dev.inmo.tgbotapi.types.polls.InputPollOption
|
||||
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
||||
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
|
||||
import dev.inmo.tgbotapi.utils.extensions.makeString
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.SerializationStrategy
|
||||
@@ -74,8 +73,8 @@ class SendQuizPoll internal constructor(
|
||||
question: String,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
explanation: String?,
|
||||
questionParseMode: ParseMode? = null,
|
||||
explanation: String? = null,
|
||||
explanationParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
@@ -114,7 +113,7 @@ class SendQuizPoll internal constructor(
|
||||
questionEntities: List<TextSource>,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
explanation: String? = null,
|
||||
explanation: String?,
|
||||
explanationParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
@@ -153,8 +152,8 @@ class SendQuizPoll internal constructor(
|
||||
question: String,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
explanationTextSources: List<TextSource>,
|
||||
questionParseMode: ParseMode? = null,
|
||||
explanationTextSources: List<TextSource>? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
openPeriod: LongSeconds? = null,
|
||||
@@ -174,9 +173,9 @@ class SendQuizPoll internal constructor(
|
||||
rawQuestionEntities = emptyList(),
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
explanation = explanationTextSources.makeSourceString(),
|
||||
explanation = explanationTextSources ?.makeSourceString(),
|
||||
explanationParseMode = null,
|
||||
rawExplanationEntities = explanationTextSources.toRawMessageEntities(),
|
||||
rawExplanationEntities = explanationTextSources ?.toRawMessageEntities(),
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
@@ -192,7 +191,7 @@ class SendQuizPoll internal constructor(
|
||||
questionEntities: List<TextSource>,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
explanationTextSources: List<TextSource>,
|
||||
explanationTextSources: List<TextSource>? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
openPeriod: LongSeconds? = null,
|
||||
@@ -212,9 +211,9 @@ class SendQuizPoll internal constructor(
|
||||
rawQuestionEntities = questionEntities.toRawMessageEntities(),
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
explanation = explanationTextSources.makeSourceString(),
|
||||
explanation = explanationTextSources ?.makeSourceString(),
|
||||
explanationParseMode = null,
|
||||
rawExplanationEntities = explanationTextSources.toRawMessageEntities(),
|
||||
rawExplanationEntities = explanationTextSources ?.toRawMessageEntities(),
|
||||
openPeriod = openPeriod,
|
||||
closeDate = closeDate,
|
||||
threadId = threadId,
|
||||
@@ -246,8 +245,8 @@ fun SendQuizPoll(
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
closeInfo: ScheduledCloseInfo?,
|
||||
explanation: String?,
|
||||
questionParseMode: ParseMode? = null,
|
||||
explanation: String? = null,
|
||||
explanationParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
@@ -262,8 +261,8 @@ fun SendQuizPoll(
|
||||
question = question,
|
||||
options = options,
|
||||
correctOptionId = correctOptionId,
|
||||
questionParseMode = questionParseMode,
|
||||
explanation = explanation,
|
||||
questionParseMode = questionParseMode,
|
||||
explanationParseMode = explanationParseMode,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
@@ -283,7 +282,7 @@ fun SendQuizPoll(
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
closeInfo: ScheduledCloseInfo?,
|
||||
explanation: String? = null,
|
||||
explanation: String?,
|
||||
explanationParseMode: ParseMode? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
@@ -317,9 +316,9 @@ fun SendQuizPoll(
|
||||
question: String,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
explanationTextSources: List<TextSource>,
|
||||
closeInfo: ScheduledCloseInfo?,
|
||||
questionParseMode: ParseMode? = null,
|
||||
explanationTextSources: List<TextSource>? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
@@ -333,8 +332,8 @@ fun SendQuizPoll(
|
||||
question = question,
|
||||
options = options,
|
||||
correctOptionId = correctOptionId,
|
||||
explanationTextSources = explanationTextSources,
|
||||
questionParseMode = questionParseMode,
|
||||
explanationTextSources = explanationTextSources,
|
||||
isAnonymous = isAnonymous,
|
||||
isClosed = isClosed,
|
||||
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
|
||||
@@ -352,8 +351,8 @@ fun SendQuizPoll(
|
||||
questionEntities: List<TextSource>,
|
||||
options: List<InputPollOption>,
|
||||
correctOptionId: Int,
|
||||
explanationTextSources: List<TextSource>,
|
||||
closeInfo: ScheduledCloseInfo?,
|
||||
explanationTextSources: List<TextSource>? = null,
|
||||
isAnonymous: Boolean = true,
|
||||
isClosed: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
|
@@ -54,6 +54,8 @@ sealed interface Poll : ReplyInfo.External.ContentVariant, TextedInput {
|
||||
val question: String
|
||||
override val text: String
|
||||
get() = question
|
||||
val questionTextSources: List<TextSource>
|
||||
get() = textSources
|
||||
val options: List<PollOption>
|
||||
val votesCount: Int
|
||||
val isClosed: Boolean
|
||||
|
Reference in New Issue
Block a user