mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 00:57:13 +00:00
fixes in sends and poll.kt
This commit is contained in:
parent
905486fff9
commit
cfc2fd1b47
@ -31,7 +31,6 @@ import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
|||||||
import dev.inmo.tgbotapi.types.polls.*
|
import dev.inmo.tgbotapi.types.polls.*
|
||||||
import dev.inmo.tgbotapi.types.venue.Venue
|
import dev.inmo.tgbotapi.types.venue.Venue
|
||||||
import dev.inmo.tgbotapi.utils.*
|
import dev.inmo.tgbotapi.utils.*
|
||||||
import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
|
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlin.js.JsName
|
import kotlin.js.JsName
|
||||||
import kotlin.jvm.JvmName
|
import kotlin.jvm.JvmName
|
||||||
|
@ -858,9 +858,31 @@ suspend fun TelegramBot.send(
|
|||||||
*/
|
*/
|
||||||
suspend fun TelegramBot.send(
|
suspend fun TelegramBot.send(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
poll: RegularPoll,
|
questionTextSources: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendRegularPoll(chatId, questionTextSources, options, closeInfo, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will execute [sendRegularPoll] request
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.send(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
poll: RegularPoll,
|
||||||
|
question: String,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
question: String = poll.question,
|
|
||||||
options: List<InputPollOption> = poll.options.map { it.asInput() },
|
options: List<InputPollOption> = poll.options.map { it.asInput() },
|
||||||
isAnonymous: Boolean = poll.isAnonymous,
|
isAnonymous: Boolean = poll.isAnonymous,
|
||||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
||||||
@ -871,7 +893,29 @@ suspend fun TelegramBot.send(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(chatId, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendRegularPoll(chatId, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will execute [sendRegularPoll] request
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.send(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
poll: RegularPoll,
|
||||||
|
questionTextSources: List<TextSource> = poll.questionTextSources,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
options: List<InputPollOption> = poll.options.map { it.asInput() },
|
||||||
|
isAnonymous: Boolean = poll.isAnonymous,
|
||||||
|
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendRegularPoll(chatId, questionTextSources, options, closeInfo, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will execute [sendRegularPoll] request
|
* Will execute [sendRegularPoll] request
|
||||||
@ -881,7 +925,8 @@ suspend fun TelegramBot.send(
|
|||||||
suspend fun TelegramBot.send(
|
suspend fun TelegramBot.send(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
question: String,
|
question: String,
|
||||||
options: List<String>,
|
options: List<InputPollOption>,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
allowMultipleAnswers: Boolean = false,
|
allowMultipleAnswers: Boolean = false,
|
||||||
@ -892,7 +937,7 @@ suspend fun TelegramBot.send(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(chat, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendRegularPoll(chat.id, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will execute [sendRegularPoll] request
|
* Will execute [sendRegularPoll] request
|
||||||
@ -902,9 +947,10 @@ suspend fun TelegramBot.send(
|
|||||||
suspend fun TelegramBot.send(
|
suspend fun TelegramBot.send(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
poll: RegularPoll,
|
poll: RegularPoll,
|
||||||
|
question: String,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
question: String = poll.question,
|
options: List<InputPollOption> = poll.options.map { it.asInput() },
|
||||||
options: List<String> = poll.options.map { it.text },
|
|
||||||
isAnonymous: Boolean = poll.isAnonymous,
|
isAnonymous: Boolean = poll.isAnonymous,
|
||||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
@ -914,7 +960,29 @@ suspend fun TelegramBot.send(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(chat, poll, isClosed, question, options, isAnonymous, allowMultipleAnswers, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendRegularPoll(chat.id, question, options, closeInfo, questionParseMode, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will execute [sendRegularPoll] request
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.send(
|
||||||
|
chat: Chat,
|
||||||
|
poll: RegularPoll,
|
||||||
|
questionTextSources: List<TextSource> = poll.questionTextSources,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
options: List<InputPollOption> = poll.options.map { it.asInput() },
|
||||||
|
isAnonymous: Boolean = poll.isAnonymous,
|
||||||
|
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendRegularPoll(chat.id, questionTextSources, options, closeInfo, isAnonymous, isClosed, allowMultipleAnswers, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will execute [sendQuizPoll] request
|
* Will execute [sendQuizPoll] request
|
||||||
@ -924,12 +992,13 @@ suspend fun TelegramBot.send(
|
|||||||
suspend fun TelegramBot.send(
|
suspend fun TelegramBot.send(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
question: String,
|
question: String,
|
||||||
options: List<String>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
explanation: String? = null,
|
explanation: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
explanationParseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
@ -937,7 +1006,7 @@ suspend fun TelegramBot.send(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendQuizPoll(chatId, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will execute [sendQuizPoll] request
|
* Will execute [sendQuizPoll] request
|
||||||
@ -947,12 +1016,13 @@ suspend fun TelegramBot.send(
|
|||||||
suspend fun TelegramBot.send(
|
suspend fun TelegramBot.send(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
question: String,
|
question: String,
|
||||||
options: List<String>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
explanation: String? = null,
|
explanation: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
explanationParseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
@ -960,7 +1030,7 @@ suspend fun TelegramBot.send(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chat, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendQuizPoll(chat.id, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will execute [sendQuizPoll] request
|
* Will execute [sendQuizPoll] request
|
||||||
@ -971,12 +1041,13 @@ suspend fun TelegramBot.send(
|
|||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
quizPoll: QuizPoll,
|
quizPoll: QuizPoll,
|
||||||
question: String = quizPoll.question,
|
question: String,
|
||||||
options: List<String> = quizPoll.options.map { it.text },
|
questionParseMode: ParseMode? = null,
|
||||||
|
options: List<InputPollOption> = quizPoll.options.map { it.asInput() },
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||||
explanation: String? = null,
|
explanation: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
explanationParseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
@ -985,7 +1056,7 @@ suspend fun TelegramBot.send(
|
|||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
chatId, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -997,12 +1068,13 @@ suspend fun TelegramBot.send(
|
|||||||
chat: Chat,
|
chat: Chat,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
quizPoll: QuizPoll,
|
quizPoll: QuizPoll,
|
||||||
question: String = quizPoll.question,
|
question: String,
|
||||||
options: List<String> = quizPoll.options.map { it.text },
|
questionParseMode: ParseMode? = null,
|
||||||
|
options: List<InputPollOption> = quizPoll.options.map { it.asInput() },
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||||
explanation: String? = null,
|
explanation: String? = null,
|
||||||
parseMode: ParseMode? = null,
|
explanationParseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
@ -1010,21 +1082,22 @@ suspend fun TelegramBot.send(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, explanation, parseMode, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendQuizPoll(chat.id, question, options, correctOptionId, closeInfo, questionParseMode, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will execute [sendQuizPoll] request
|
* Will execute [sendQuizPoll] request
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.send(
|
suspend fun TelegramBot.send(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
question: String,
|
questionTextSources: List<TextSource>,
|
||||||
options: List<String>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
entities: TextSourcesList,
|
explanation: String? = null,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
@ -1032,21 +1105,22 @@ suspend inline fun TelegramBot.send(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chatId, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendQuizPoll(chatId, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will execute [sendQuizPoll] request
|
* Will execute [sendQuizPoll] request
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.send(
|
suspend fun TelegramBot.send(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
question: String,
|
questionTextSources: List<TextSource>,
|
||||||
options: List<String>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
entities: TextSourcesList,
|
explanation: String? = null,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
@ -1054,22 +1128,23 @@ suspend inline fun TelegramBot.send(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chat, question, options, correctOptionId, isAnonymous, isClosed, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendQuizPoll(chat.id, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will execute [sendQuizPoll] request
|
* Will execute [sendQuizPoll] request
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.send(
|
suspend fun TelegramBot.send(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
quizPoll: QuizPoll,
|
quizPoll: QuizPoll,
|
||||||
question: String = quizPoll.question,
|
questionTextSources: List<TextSource>,
|
||||||
options: List<String> = quizPoll.options.map { it.text },
|
options: List<InputPollOption> = quizPoll.options.map { it.asInput() },
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||||
entities: TextSourcesList,
|
explanation: String? = null,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
@ -1077,22 +1152,25 @@ suspend inline fun TelegramBot.send(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chatId, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendQuizPoll(
|
||||||
|
chatId, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will execute [sendQuizPoll] request
|
* Will execute [sendQuizPoll] request
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
*/
|
*/
|
||||||
suspend inline fun TelegramBot.send(
|
suspend fun TelegramBot.send(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
quizPoll: QuizPoll,
|
quizPoll: QuizPoll,
|
||||||
question: String = quizPoll.question,
|
questionTextSources: List<TextSource>,
|
||||||
options: List<String> = quizPoll.options.map { it.text },
|
options: List<InputPollOption> = quizPoll.options.map { it.asInput() },
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||||
entities: TextSourcesList,
|
explanation: String? = null,
|
||||||
|
explanationParseMode: ParseMode? = null,
|
||||||
closeInfo: ScheduledCloseInfo? = null,
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
threadId: MessageThreadId? = chat.id.threadId,
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
@ -1100,7 +1178,195 @@ suspend inline fun TelegramBot.send(
|
|||||||
protectContent: Boolean = false,
|
protectContent: Boolean = false,
|
||||||
replyParameters: ReplyParameters? = null,
|
replyParameters: ReplyParameters? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(chat, isClosed, quizPoll, question, options, correctOptionId, isAnonymous, entities, closeInfo, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
) = sendQuizPoll(chat.id, questionTextSources, options, correctOptionId, closeInfo, explanation, explanationParseMode, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will execute [sendQuizPoll] request
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.send(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendQuizPoll(chatId, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will execute [sendQuizPoll] request
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.send(
|
||||||
|
chat: Chat,
|
||||||
|
question: String,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendQuizPoll(chat.id, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will execute [sendQuizPoll] request
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.send(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
quizPoll: QuizPoll,
|
||||||
|
question: String,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
options: List<InputPollOption> = quizPoll.options.map { it.asInput() },
|
||||||
|
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||||
|
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendQuizPoll(
|
||||||
|
chatId, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will execute [sendQuizPoll] request
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.send(
|
||||||
|
chat: Chat,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
quizPoll: QuizPoll,
|
||||||
|
question: String,
|
||||||
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
options: List<InputPollOption> = quizPoll.options.map { it.asInput() },
|
||||||
|
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||||
|
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendQuizPoll(chat.id, question, options, correctOptionId, closeInfo, questionParseMode, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will execute [sendQuizPoll] request
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.send(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
questionTextSources: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendQuizPoll(chatId, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will execute [sendQuizPoll] request
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.send(
|
||||||
|
chat: Chat,
|
||||||
|
questionTextSources: List<TextSource>,
|
||||||
|
options: List<InputPollOption>,
|
||||||
|
correctOptionId: Int,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
|
isAnonymous: Boolean = true,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendQuizPoll(chat.id, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will execute [sendQuizPoll] request
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.send(
|
||||||
|
chatId: ChatIdentifier,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
quizPoll: QuizPoll,
|
||||||
|
questionTextSources: List<TextSource> = quizPoll.questionTextSources,
|
||||||
|
explanationTextSources: List<TextSource>? = quizPoll.explanationTextSources.takeIf { it.isNotEmpty() },
|
||||||
|
options: List<InputPollOption> = quizPoll.options.map { it.asInput() },
|
||||||
|
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||||
|
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendQuizPoll(
|
||||||
|
chatId, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will execute [sendQuizPoll] request
|
||||||
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
||||||
|
*/
|
||||||
|
suspend fun TelegramBot.send(
|
||||||
|
chat: Chat,
|
||||||
|
isClosed: Boolean = false,
|
||||||
|
quizPoll: QuizPoll,
|
||||||
|
questionTextSources: List<TextSource> = quizPoll.questionTextSources,
|
||||||
|
explanationTextSources: List<TextSource>? = quizPoll.explanationTextSources.takeIf { it.isNotEmpty() },
|
||||||
|
options: List<InputPollOption> = quizPoll.options.map { it.asInput() },
|
||||||
|
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||||
|
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
|
threadId: MessageThreadId? = chat.id.threadId,
|
||||||
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
||||||
|
disableNotification: Boolean = false,
|
||||||
|
protectContent: Boolean = false,
|
||||||
|
replyParameters: ReplyParameters? = null,
|
||||||
|
replyMarkup: KeyboardMarkup? = null
|
||||||
|
) = sendQuizPoll(chat.id, questionTextSources, options, correctOptionId, closeInfo, explanationTextSources, isAnonymous, isClosed, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will execute [sendSticker] request
|
* Will execute [sendSticker] request
|
||||||
|
@ -16,8 +16,8 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
question: String,
|
question: String,
|
||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
|
explanation: String?,
|
||||||
questionParseMode: ParseMode? = null,
|
questionParseMode: ParseMode? = null,
|
||||||
explanation: String? = null,
|
|
||||||
explanationParseMode: ParseMode? = null,
|
explanationParseMode: ParseMode? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
@ -35,8 +35,8 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
question,
|
question,
|
||||||
options,
|
options,
|
||||||
correctOptionId,
|
correctOptionId,
|
||||||
questionParseMode,
|
|
||||||
explanation,
|
explanation,
|
||||||
|
questionParseMode,
|
||||||
explanationParseMode,
|
explanationParseMode,
|
||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
@ -56,7 +56,7 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
questionEntities: List<TextSource>,
|
questionEntities: List<TextSource>,
|
||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
explanation: String? = null,
|
explanation: String?,
|
||||||
explanationParseMode: ParseMode? = null,
|
explanationParseMode: ParseMode? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
@ -94,7 +94,7 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
question: String,
|
question: String,
|
||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
explanationTextSources: List<TextSource>,
|
explanationTextSources: List<TextSource>? = null,
|
||||||
questionParseMode: ParseMode? = null,
|
questionParseMode: ParseMode? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
@ -112,8 +112,8 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
question,
|
question,
|
||||||
options,
|
options,
|
||||||
correctOptionId,
|
correctOptionId,
|
||||||
explanationTextSources,
|
|
||||||
questionParseMode,
|
questionParseMode,
|
||||||
|
explanationTextSources,
|
||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
openPeriod,
|
openPeriod,
|
||||||
@ -133,7 +133,7 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
questionEntities: List<TextSource>,
|
questionEntities: List<TextSource>,
|
||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
explanationTextSources: List<TextSource>,
|
explanationTextSources: List<TextSource>? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
openPeriod: LongSeconds? = null,
|
openPeriod: LongSeconds? = null,
|
||||||
@ -171,7 +171,7 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
closeInfo: ScheduledCloseInfo?,
|
closeInfo: ScheduledCloseInfo?,
|
||||||
questionParseMode: ParseMode? = null,
|
questionParseMode: ParseMode? = null,
|
||||||
explanation: String? = null,
|
explanation: String?,
|
||||||
explanationParseMode: ParseMode? = null,
|
explanationParseMode: ParseMode? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
@ -188,8 +188,8 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
options,
|
options,
|
||||||
correctOptionId,
|
correctOptionId,
|
||||||
closeInfo,
|
closeInfo,
|
||||||
questionParseMode,
|
|
||||||
explanation,
|
explanation,
|
||||||
|
questionParseMode,
|
||||||
explanationParseMode,
|
explanationParseMode,
|
||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
@ -208,7 +208,7 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
closeInfo: ScheduledCloseInfo?,
|
closeInfo: ScheduledCloseInfo?,
|
||||||
explanation: String? = null,
|
explanation: String?,
|
||||||
explanationParseMode: ParseMode? = null,
|
explanationParseMode: ParseMode? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
@ -243,9 +243,9 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
question: String,
|
question: String,
|
||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
explanationTextSources: List<TextSource>,
|
|
||||||
closeInfo: ScheduledCloseInfo?,
|
closeInfo: ScheduledCloseInfo?,
|
||||||
questionParseMode: ParseMode? = null,
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
@ -260,9 +260,9 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
question,
|
question,
|
||||||
options,
|
options,
|
||||||
correctOptionId,
|
correctOptionId,
|
||||||
explanationTextSources,
|
|
||||||
closeInfo,
|
closeInfo,
|
||||||
questionParseMode,
|
questionParseMode,
|
||||||
|
explanationTextSources,
|
||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
threadId,
|
threadId,
|
||||||
@ -279,8 +279,8 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
questionEntities: List<TextSource>,
|
questionEntities: List<TextSource>,
|
||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
explanationTextSources: List<TextSource>,
|
|
||||||
closeInfo: ScheduledCloseInfo?,
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
@ -295,8 +295,8 @@ suspend fun TelegramBot.sendQuizPoll(
|
|||||||
questionEntities,
|
questionEntities,
|
||||||
options,
|
options,
|
||||||
correctOptionId,
|
correctOptionId,
|
||||||
explanationTextSources,
|
|
||||||
closeInfo,
|
closeInfo,
|
||||||
|
explanationTextSources,
|
||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
threadId,
|
threadId,
|
||||||
|
@ -129,8 +129,8 @@ fun Poll.createRequest(
|
|||||||
textSources,
|
textSources,
|
||||||
options.map { it.asInput() },
|
options.map { it.asInput() },
|
||||||
correctOptionId,
|
correctOptionId,
|
||||||
explanationTextSources,
|
|
||||||
scheduledCloseInfo,
|
scheduledCloseInfo,
|
||||||
|
explanationTextSources,
|
||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
threadId,
|
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.InputPollOption
|
||||||
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
||||||
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
|
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
|
||||||
import dev.inmo.tgbotapi.utils.extensions.makeString
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.SerializationStrategy
|
import kotlinx.serialization.SerializationStrategy
|
||||||
@ -74,8 +73,8 @@ class SendQuizPoll internal constructor(
|
|||||||
question: String,
|
question: String,
|
||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
|
explanation: String?,
|
||||||
questionParseMode: ParseMode? = null,
|
questionParseMode: ParseMode? = null,
|
||||||
explanation: String? = null,
|
|
||||||
explanationParseMode: ParseMode? = null,
|
explanationParseMode: ParseMode? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
@ -114,7 +113,7 @@ class SendQuizPoll internal constructor(
|
|||||||
questionEntities: List<TextSource>,
|
questionEntities: List<TextSource>,
|
||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
explanation: String? = null,
|
explanation: String?,
|
||||||
explanationParseMode: ParseMode? = null,
|
explanationParseMode: ParseMode? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
@ -153,8 +152,8 @@ class SendQuizPoll internal constructor(
|
|||||||
question: String,
|
question: String,
|
||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
explanationTextSources: List<TextSource>,
|
|
||||||
questionParseMode: ParseMode? = null,
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
openPeriod: LongSeconds? = null,
|
openPeriod: LongSeconds? = null,
|
||||||
@ -174,9 +173,9 @@ class SendQuizPoll internal constructor(
|
|||||||
rawQuestionEntities = emptyList(),
|
rawQuestionEntities = emptyList(),
|
||||||
isAnonymous = isAnonymous,
|
isAnonymous = isAnonymous,
|
||||||
isClosed = isClosed,
|
isClosed = isClosed,
|
||||||
explanation = explanationTextSources.makeSourceString(),
|
explanation = explanationTextSources ?.makeSourceString(),
|
||||||
explanationParseMode = null,
|
explanationParseMode = null,
|
||||||
rawExplanationEntities = explanationTextSources.toRawMessageEntities(),
|
rawExplanationEntities = explanationTextSources ?.toRawMessageEntities(),
|
||||||
openPeriod = openPeriod,
|
openPeriod = openPeriod,
|
||||||
closeDate = closeDate,
|
closeDate = closeDate,
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
@ -192,7 +191,7 @@ class SendQuizPoll internal constructor(
|
|||||||
questionEntities: List<TextSource>,
|
questionEntities: List<TextSource>,
|
||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
explanationTextSources: List<TextSource>,
|
explanationTextSources: List<TextSource>? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
openPeriod: LongSeconds? = null,
|
openPeriod: LongSeconds? = null,
|
||||||
@ -212,9 +211,9 @@ class SendQuizPoll internal constructor(
|
|||||||
rawQuestionEntities = questionEntities.toRawMessageEntities(),
|
rawQuestionEntities = questionEntities.toRawMessageEntities(),
|
||||||
isAnonymous = isAnonymous,
|
isAnonymous = isAnonymous,
|
||||||
isClosed = isClosed,
|
isClosed = isClosed,
|
||||||
explanation = explanationTextSources.makeSourceString(),
|
explanation = explanationTextSources ?.makeSourceString(),
|
||||||
explanationParseMode = null,
|
explanationParseMode = null,
|
||||||
rawExplanationEntities = explanationTextSources.toRawMessageEntities(),
|
rawExplanationEntities = explanationTextSources ?.toRawMessageEntities(),
|
||||||
openPeriod = openPeriod,
|
openPeriod = openPeriod,
|
||||||
closeDate = closeDate,
|
closeDate = closeDate,
|
||||||
threadId = threadId,
|
threadId = threadId,
|
||||||
@ -246,8 +245,8 @@ fun SendQuizPoll(
|
|||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
closeInfo: ScheduledCloseInfo?,
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
explanation: String?,
|
||||||
questionParseMode: ParseMode? = null,
|
questionParseMode: ParseMode? = null,
|
||||||
explanation: String? = null,
|
|
||||||
explanationParseMode: ParseMode? = null,
|
explanationParseMode: ParseMode? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
@ -262,8 +261,8 @@ fun SendQuizPoll(
|
|||||||
question = question,
|
question = question,
|
||||||
options = options,
|
options = options,
|
||||||
correctOptionId = correctOptionId,
|
correctOptionId = correctOptionId,
|
||||||
questionParseMode = questionParseMode,
|
|
||||||
explanation = explanation,
|
explanation = explanation,
|
||||||
|
questionParseMode = questionParseMode,
|
||||||
explanationParseMode = explanationParseMode,
|
explanationParseMode = explanationParseMode,
|
||||||
isAnonymous = isAnonymous,
|
isAnonymous = isAnonymous,
|
||||||
isClosed = isClosed,
|
isClosed = isClosed,
|
||||||
@ -283,7 +282,7 @@ fun SendQuizPoll(
|
|||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
closeInfo: ScheduledCloseInfo?,
|
closeInfo: ScheduledCloseInfo?,
|
||||||
explanation: String? = null,
|
explanation: String?,
|
||||||
explanationParseMode: ParseMode? = null,
|
explanationParseMode: ParseMode? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
@ -317,9 +316,9 @@ fun SendQuizPoll(
|
|||||||
question: String,
|
question: String,
|
||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
explanationTextSources: List<TextSource>,
|
|
||||||
closeInfo: ScheduledCloseInfo?,
|
closeInfo: ScheduledCloseInfo?,
|
||||||
questionParseMode: ParseMode? = null,
|
questionParseMode: ParseMode? = null,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
@ -333,8 +332,8 @@ fun SendQuizPoll(
|
|||||||
question = question,
|
question = question,
|
||||||
options = options,
|
options = options,
|
||||||
correctOptionId = correctOptionId,
|
correctOptionId = correctOptionId,
|
||||||
explanationTextSources = explanationTextSources,
|
|
||||||
questionParseMode = questionParseMode,
|
questionParseMode = questionParseMode,
|
||||||
|
explanationTextSources = explanationTextSources,
|
||||||
isAnonymous = isAnonymous,
|
isAnonymous = isAnonymous,
|
||||||
isClosed = isClosed,
|
isClosed = isClosed,
|
||||||
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
|
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo)?.openPeriod,
|
||||||
@ -352,8 +351,8 @@ fun SendQuizPoll(
|
|||||||
questionEntities: List<TextSource>,
|
questionEntities: List<TextSource>,
|
||||||
options: List<InputPollOption>,
|
options: List<InputPollOption>,
|
||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
explanationTextSources: List<TextSource>,
|
|
||||||
closeInfo: ScheduledCloseInfo?,
|
closeInfo: ScheduledCloseInfo?,
|
||||||
|
explanationTextSources: List<TextSource>? = null,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
threadId: MessageThreadId? = chatId.threadId,
|
threadId: MessageThreadId? = chatId.threadId,
|
||||||
|
@ -54,6 +54,8 @@ sealed interface Poll : ReplyInfo.External.ContentVariant, TextedInput {
|
|||||||
val question: String
|
val question: String
|
||||||
override val text: String
|
override val text: String
|
||||||
get() = question
|
get() = question
|
||||||
|
val questionTextSources: List<TextSource>
|
||||||
|
get() = textSources
|
||||||
val options: List<PollOption>
|
val options: List<PollOption>
|
||||||
val votesCount: Int
|
val votesCount: Int
|
||||||
val isClosed: Boolean
|
val isClosed: Boolean
|
||||||
|
Loading…
Reference in New Issue
Block a user