mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-11-22 00:03:54 +00:00
tgbotapi -> 0.35.3
This commit is contained in:
parent
cdb634e91a
commit
496fc45d2d
@ -41,13 +41,13 @@ suspend fun main(args: Array<String>) {
|
||||
|
||||
val content = oneOf(
|
||||
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 {
|
||||
waitMediaGroup { chat ?.id == it.context }.also(::println)
|
||||
},
|
||||
parallel {
|
||||
waitText { if (content.containsStopCommand()) content else null }.also(::println)
|
||||
waitText (filter = { it.content.containsStopCommand() }).also(::println)
|
||||
}
|
||||
).first()
|
||||
|
||||
|
@ -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.triggers_handling.onContentMessage
|
||||
import dev.inmo.tgbotapi.extensions.utils.formatting.*
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.ParseMode.MarkdownV2
|
||||
import dev.inmo.tgbotapi.types.message.*
|
||||
import kotlinx.coroutines.*
|
||||
@ -25,7 +26,11 @@ suspend fun main(vararg args: String) {
|
||||
}
|
||||
is UserForwardInfo -> {
|
||||
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 ForwardFromSupergroupInfo -> regular("Supergroup (") + code((forwardInfo.group).title) + ")"
|
||||
|
@ -3,5 +3,5 @@ org.gradle.parallel=true
|
||||
|
||||
|
||||
kotlin_version=1.5.21
|
||||
telegram_bot_api_version=0.35.2
|
||||
micro_utils_version=0.5.16
|
||||
telegram_bot_api_version=0.35.3
|
||||
micro_utils_version=0.5.18
|
||||
|
Loading…
Reference in New Issue
Block a user