1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-12-09 15:55:51 +00:00

add passing of default engines in HttpClient constructors

This commit is contained in:
2025-09-23 17:53:21 +06:00
parent 74d8b31437
commit ee4cf7c626
15 changed files with 76 additions and 9 deletions

View File

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