mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-12-02 06:50:12 +00:00
Compare commits
No commits in common. "07750a71c0030101185a7bc641d86146381dfcb8" and "7fb308ea4b92f0b0a6f39523a1a9a28dcd0fa1b2" have entirely different histories.
07750a71c0
...
7fb308ea4b
@ -10,7 +10,6 @@ import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage
|
||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.flow.first
|
||||
|
||||
sealed interface BotState : State
|
||||
data class ExpectContentOrStopState(override val context: ChatId, val sourceMessage: CommonMessage<TextContent>) : BotState
|
||||
|
@ -1,4 +1,3 @@
|
||||
import dev.inmo.micro_utils.common.filesize
|
||||
import dev.inmo.tgbotapi.bot.ktor.telegramBot
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.extensions.api.bot.getMe
|
||||
@ -65,9 +64,9 @@ suspend fun main(args: Array<String>) {
|
||||
val chosen = mutableListOf<File>()
|
||||
|
||||
while (left > 0) {
|
||||
val picked = pickFile() ?.takeIf { it.filesize > 0 } ?: continue
|
||||
chosen.add(picked)
|
||||
left--
|
||||
val picked = pickFile() ?: continue
|
||||
chosen.add(picked)
|
||||
if (chosen.size >= mediaCountInMediaGroup.last) {
|
||||
sendFiles(message.chat, chosen)
|
||||
chosen.clear()
|
||||
|
@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx768m
|
||||
|
||||
|
||||
kotlin_version=1.6.21
|
||||
telegram_bot_api_version=2.0.0
|
||||
telegram_bot_api_version=1.1.3
|
||||
micro_utils_version=0.10.5
|
||||
serialization_version=1.3.3
|
||||
ktor_version=2.0.1
|
||||
|
Loading…
Reference in New Issue
Block a user