ResendableContent#createResends

This commit is contained in:
InsanusMokrassar committed 2019-01-29 10:22:09 +08:00
1 parent 4c0472a139
commit d79d163750
3 files changed
+27

No files matched your search

@@ -10,6 +10,7 @@ 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.utils.toMarkdownText
import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownTexts
data class TextContent(
val text: String,
@@ -29,4 +30,21 @@ data class TextContent(
replyToMessageId,
replyMarkup
)
override fun createResends(
chatId: ChatIdentifier,
disableNotification: Boolean,
replyToMessageId: MessageIdentifier?,
replyMarkup: KeyboardMarkup?
): List<Request<RawMessage>> = toMarkdownTexts().map {
SendMessage(
chatId,
it,
MarkdownParseMode,
false,
disableNotification,
replyToMessageId,
replyMarkup
)
}
}
@@ -13,4 +13,11 @@ interface ResendableContent {
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
): Request<RawMessage>
fun createResends(
chatId: ChatIdentifier,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
): List<Request<RawMessage>> = listOf(createResend(chatId, disableNotification, replyToMessageId, replyMarkup))
}