mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-11-10 13:54:28 +00:00
improve support of local bot api servers
This commit is contained in:
1 parent
5e5dc6b36b
commit
cec5a0af12
13 files changed
+110
-4
No files matched your search
File renamed without changes.
@@ -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 }
|
||||
Reference in new issue
Block a user