2019-04-16 08:04:02 +00:00
|
|
|
package com.github.insanusmokrassar.TelegramBotAPI.types.message.content
|
|
|
|
|
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
|
2019-04-16 08:16:13 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendPoll
|
2019-04-16 08:04:02 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
|
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
|
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
|
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
|
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.polls.Poll
|
|
|
|
|
|
|
|
data class PollContent(
|
|
|
|
val poll: Poll
|
|
|
|
) : MessageContent {
|
|
|
|
override fun createResend(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
disableNotification: Boolean,
|
|
|
|
replyToMessageId: MessageIdentifier?,
|
|
|
|
replyMarkup: KeyboardMarkup?
|
2019-04-16 08:16:13 +00:00
|
|
|
): Request<RawMessage> = SendPoll(
|
|
|
|
chatId,
|
|
|
|
poll.question,
|
|
|
|
poll.options.map { it.text },
|
|
|
|
disableNotification,
|
|
|
|
replyToMessageId,
|
|
|
|
replyMarkup
|
|
|
|
)
|
2019-04-16 08:04:02 +00:00
|
|
|
}
|