1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-12-14 02:05:44 +00:00

improve support of local bot api servers

This commit is contained in:
2025-07-25 21:35:38 +06:00
parent 5e5dc6b36b
commit cec5a0af12
13 changed files with 110 additions and 4 deletions

View File

@@ -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 }