tgbotapi -> 0.35.3

This commit is contained in:
InsanusMokrassar 2021-08-08 20:32:26 +06:00
parent cdb634e91a
commit 496fc45d2d
3 changed files with 10 additions and 5 deletions

View File

@ -41,13 +41,13 @@ suspend fun main(args: Array<String>) {
val content = oneOf( val content = oneOf(
parallel { parallel {
waitContentMessage(includeMediaGroups = false) { if (chat.id == it.context) content else null }.also(::println) waitContentMessage(includeMediaGroups = false, filter = { message -> message.chat.id == it.context }).also(::println)
}, },
parallel { parallel {
waitMediaGroup { chat ?.id == it.context }.also(::println) waitMediaGroup { chat ?.id == it.context }.also(::println)
}, },
parallel { parallel {
waitText { if (content.containsStopCommand()) content else null }.also(::println) waitText (filter = { it.content.containsStopCommand() }).also(::println)
} }
).first() ).first()

View File

@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.extensions.api.send.reply
import dev.inmo.tgbotapi.extensions.behaviour_builder.telegramBotWithBehaviour import dev.inmo.tgbotapi.extensions.behaviour_builder.telegramBotWithBehaviour
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onContentMessage import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.onContentMessage
import dev.inmo.tgbotapi.extensions.utils.formatting.* import dev.inmo.tgbotapi.extensions.utils.formatting.*
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.ParseMode.MarkdownV2 import dev.inmo.tgbotapi.types.ParseMode.MarkdownV2
import dev.inmo.tgbotapi.types.message.* import dev.inmo.tgbotapi.types.message.*
import kotlinx.coroutines.* import kotlinx.coroutines.*
@ -25,7 +26,11 @@ suspend fun main(vararg args: String) {
} }
is UserForwardInfo -> { is UserForwardInfo -> {
val user = forwardInfo.from val user = forwardInfo.from
regular("User ") + code(user.id.chatId.toString()) + " (${user.firstName} ${user.lastName}: ${user.username ?.username ?: "Without username"})" when (user) {
is CommonUser -> regular("User ")
is CommonBot,
is ExtendedBot -> regular("Bot ")
} + code(user.id.chatId.toString()) + " (${user.firstName} ${user.lastName}: ${user.username ?.username ?: "Without username"})"
} }
is ForwardFromChannelInfo -> regular("Channel (") + code((forwardInfo.channelChat).title) + ")" is ForwardFromChannelInfo -> regular("Channel (") + code((forwardInfo.channelChat).title) + ")"
is ForwardFromSupergroupInfo -> regular("Supergroup (") + code((forwardInfo.group).title) + ")" is ForwardFromSupergroupInfo -> regular("Supergroup (") + code((forwardInfo.group).title) + ")"

View File

@ -3,5 +3,5 @@ org.gradle.parallel=true
kotlin_version=1.5.21 kotlin_version=1.5.21
telegram_bot_api_version=0.35.2 telegram_bot_api_version=0.35.3
micro_utils_version=0.5.16 micro_utils_version=0.5.18