From 9ed1500bee255e96b1e7bbb3420884da84a1df90 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 7 Feb 2020 10:31:22 +0600 Subject: [PATCH] add additional methods for regular poll --- .../requests/send/polls/SendPoll.kt | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/polls/SendPoll.kt b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/polls/SendPoll.kt index b68320164f..07aed23c77 100644 --- a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/polls/SendPoll.kt +++ b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/requests/send/polls/SendPoll.kt @@ -202,6 +202,22 @@ suspend fun RequestsExecutor.sendRegularPoll( chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup ) ) +suspend fun RequestsExecutor.sendRegularPoll( + chatId: ChatIdentifier, + poll: RegularPoll, + isClosed: Boolean = false, + question: String = poll.question, + options: List = poll.options.map { it.text }, + isAnonymous: Boolean = poll.isAnonymous, + allowMultipleAnswers: Boolean = poll.allowMultipleAnswers, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = execute( + SendRegularPoll( + chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup + ) +) suspend fun RequestsExecutor.sendRegularPoll( chat: Chat, @@ -217,6 +233,21 @@ suspend fun RequestsExecutor.sendRegularPoll( chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup ) +suspend fun RequestsExecutor.sendRegularPoll( + chat: Chat, + poll: RegularPoll, + isClosed: Boolean = false, + question: String = poll.question, + options: List = poll.options.map { it.text }, + isAnonymous: Boolean = poll.isAnonymous, + allowMultipleAnswers: Boolean = poll.allowMultipleAnswers, + disableNotification: Boolean = false, + replyToMessageId: MessageIdentifier? = null, + replyMarkup: KeyboardMarkup? = null +) = sendRegularPoll( + chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup +) + suspend fun RequestsExecutor.sendQuizPoll( chatId: ChatIdentifier,