improve support of local bot api servers

This commit is contained in:
InsanusMokrassar committed 2025-07-25 21:35:38 +06:00
1 parent 5e5dc6b36b
commit cec5a0af12
13 files changed
+110 -4

No files matched your search

@@ -0,0 +1,12 @@
package dev.inmo.tgbotapi.bot.ktor.base
import dev.inmo.micro_utils.common.MPPFile
import okio.FileSystem
import okio.Path
import okio.Path.Companion.toPath
internal actual fun resolveFile(filename: String): MPPFile? = runCatching {
with(Path) { filename.toPath() }.takeIf {
FileSystem.SYSTEM.exists(it) && FileSystem.SYSTEM.metadata(it).isRegularFile
}
}.getOrElse { null }