1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-03 07:09:23 +00:00

refactor: expectFlow

This commit is contained in:
2025-06-15 12:24:23 +06:00
parent 429fc5d2f9
commit 86e83f7f1a

View File

@@ -58,13 +58,16 @@ fun <T> FlowsUpdatesFilter.expectFlow(
result.getOrThrow()
}
}.flatten()
return flow {
initRequest ?.also {
return if (initRequest == null) {
flow
} else {
flow {
runCatching {
bot.execute(initRequest)
}
flow.collect(this)
}
emitAll(flow)
}
}