mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-11-22 08:13:53 +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) {
|
when (files.size) {
|
||||||
1 -> sendDocument(
|
1 -> sendDocument(
|
||||||
chat.id,
|
chat.id,
|
||||||
files.first().asMultipartFile()
|
files.first().asMultipartFile(),
|
||||||
|
protectContent = true
|
||||||
)
|
)
|
||||||
else -> sendDocumentsGroup(
|
else -> sendDocumentsGroup(
|
||||||
chat,
|
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.extensions.api.bot.getMe
|
||||||
import dev.inmo.tgbotapi.bot.Ktor.telegramBot
|
import dev.inmo.tgbotapi.bot.Ktor.telegramBot
|
||||||
import dev.inmo.tgbotapi.extensions.api.send.media.*
|
import dev.inmo.tgbotapi.extensions.api.send.media.*
|
||||||
@ -33,5 +34,9 @@ suspend fun activateResenderBot(
|
|||||||
onDocumentsGroup {
|
onDocumentsGroup {
|
||||||
sendDocumentsGroup(it.chat!!, it.map { it.content.toMediaGroupMemberInputMedia() })
|
sendDocumentsGroup(it.chat!!, it.map { it.content.toMediaGroupMemberInputMedia() })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
allUpdatesFlow.subscribeSafelyWithoutExceptions(this) {
|
||||||
|
println(it)
|
||||||
|
}
|
||||||
}.join()
|
}.join()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user