mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-12-22 08:37:18 +00:00
several small updates
This commit is contained in:
parent
df874b0783
commit
0edaa28151
@ -45,11 +45,13 @@ suspend fun main(args: Array<String>) {
|
||||
when (files.size) {
|
||||
1 -> sendDocument(
|
||||
chat.id,
|
||||
files.first().asMultipartFile()
|
||||
files.first().asMultipartFile(),
|
||||
protectContent = true
|
||||
)
|
||||
else -> sendDocumentsGroup(
|
||||
chat,
|
||||
files.map { InputMediaDocument(it.asMultipartFile()) }
|
||||
files.map { InputMediaDocument(it.asMultipartFile()) },
|
||||
protectContent = true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
|
||||
import dev.inmo.tgbotapi.extensions.api.bot.getMe
|
||||
import dev.inmo.tgbotapi.bot.Ktor.telegramBot
|
||||
import dev.inmo.tgbotapi.extensions.api.send.media.*
|
||||
@ -33,5 +34,9 @@ suspend fun activateResenderBot(
|
||||
onDocumentsGroup {
|
||||
sendDocumentsGroup(it.chat!!, it.map { it.content.toMediaGroupMemberInputMedia() })
|
||||
}
|
||||
|
||||
allUpdatesFlow.subscribeSafelyWithoutExceptions(this) {
|
||||
println(it)
|
||||
}
|
||||
}.join()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user