mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-10-19 06:10:11 +00:00
add KtorRequestsExecutorBuilder
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package dev.inmo.tgbotapi.extensions.api
|
||||
|
||||
import dev.inmo.tgbotapi.bot.Ktor.KtorRequestsExecutor
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
|
||||
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
|
||||
@@ -11,11 +10,11 @@ import io.ktor.client.engine.*
|
||||
/**
|
||||
* Allows to create bot using bot [urlsKeeper]
|
||||
*/
|
||||
@Deprecated("Replaced in core", ReplaceWith("telegramBot", "dev.inmo.tgbotapi.bot.Ktor.telegramBot"))
|
||||
fun telegramBot(
|
||||
urlsKeeper: TelegramAPIUrlsKeeper
|
||||
): TelegramBot = KtorRequestsExecutor(
|
||||
urlsKeeper,
|
||||
HttpClient()
|
||||
): TelegramBot = dev.inmo.tgbotapi.bot.Ktor.telegramBot(
|
||||
urlsKeeper
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -24,10 +23,9 @@ fun telegramBot(
|
||||
fun telegramBot(
|
||||
urlsKeeper: TelegramAPIUrlsKeeper,
|
||||
client: HttpClient
|
||||
): TelegramBot = KtorRequestsExecutor(
|
||||
urlsKeeper,
|
||||
client
|
||||
)
|
||||
): TelegramBot = dev.inmo.tgbotapi.bot.Ktor.telegramBot(urlsKeeper) {
|
||||
this.client = client
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to create bot using bot [urlsKeeper] and specify [HttpClientEngineFactory] by passing [clientFactory] param and optionally
|
||||
|
Reference in New Issue
Block a user