refactor: expectFlow

This commit is contained in:
InsanusMokrassar committed 2025-06-15 12:24:23 +06:00
1 parent 429fc5d2f9
commit 86e83f7f1a
1 file changed
+6 -3
@@ -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)
}
}