mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-11-28 22:53:08 +00:00
add passing of default engines in HttpClient constructors
This commit is contained in:
1 parent
74d8b31437
commit
ee4cf7c626
15 files changed
+76
-9
No files matched your search
+2
-1
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.extensions.utils.extensions
|
||||
|
||||
import dev.inmo.tgbotapi.types.files.PathedFile
|
||||
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
|
||||
import dev.inmo.tgbotapi.utils.defaultKtorEngine
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.request.get
|
||||
import io.ktor.client.statement.readBytes
|
||||
@@ -19,5 +20,5 @@ suspend fun HttpClient.loadFile(
|
||||
|
||||
suspend fun PathedFile.download(
|
||||
telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper,
|
||||
client: HttpClient = HttpClient()
|
||||
client: HttpClient = HttpClient(defaultKtorEngine)
|
||||
) = client.loadFile(telegramAPIUrlsKeeper, this)
|
||||
Reference in new issue
Block a user