mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-11-22 00:03:54 +00:00
update tgbotapi version
This commit is contained in:
parent
7b66c89632
commit
3820e29bf2
@ -1,8 +1,10 @@
|
||||
import dev.inmo.tgbotapi.extensions.api.send.sendTextMessage
|
||||
import dev.inmo.tgbotapi.extensions.api.telegramBot
|
||||
import dev.inmo.tgbotapi.extensions.utils.flatMap
|
||||
import dev.inmo.tgbotapi.extensions.utils.formatting.codeMarkdownV2
|
||||
import dev.inmo.tgbotapi.extensions.utils.formatting.regularMarkdownV2
|
||||
import dev.inmo.tgbotapi.extensions.utils.safely
|
||||
import dev.inmo.tgbotapi.extensions.utils.shortcuts.mediaGroupMessages
|
||||
import dev.inmo.tgbotapi.extensions.utils.updates.asContentMessagesFlow
|
||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingFlowsUpdatesByLongPolling
|
||||
import dev.inmo.tgbotapi.types.ParseMode.MarkdownV2
|
||||
@ -23,7 +25,7 @@ suspend fun main(vararg args: String) {
|
||||
val scope = CoroutineScope(Dispatchers.Default)
|
||||
|
||||
bot.startGettingFlowsUpdatesByLongPolling(scope = scope) {
|
||||
messageFlow.asContentMessagesFlow().mapNotNull { it as? PossiblyForwardedMessage }.onEach { message ->
|
||||
(merge(messageFlow.asContentMessagesFlow(), mediaGroupMessages(scope).flatMap())).mapNotNull { it as? PossiblyForwardedMessage }.onEach { message ->
|
||||
safely({ it.printStackTrace() }) {
|
||||
val toAnswer = when (val forwardInfo = message.forwardInfo) {
|
||||
null -> "There is no forward info"
|
||||
|
@ -2,4 +2,4 @@ kotlin.code.style=official
|
||||
org.gradle.parallel=true
|
||||
|
||||
kotlin_version=1.4.10
|
||||
telegram_bot_api_version=0.29.2
|
||||
telegram_bot_api_version=0.29.3
|
||||
|
Loading…
Reference in New Issue
Block a user