From 3032aa84747c3c50e5ad872e758ddf77a61f293b Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 15 May 2020 19:14:09 +0600 Subject: [PATCH] renaming of telegramBot functions --- CHANGELOG.md | 1 + .../TelegramBotAPI/extensions/api/BotBuilder.kt | 2 +- .../TelegramBotAPI/extensions/api/BotExtensions.kt | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 973cf0fa86..10c5550390 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ * Now it is possible to pass exceptions handler into `executeUnsafe` * `TelegramBotAPI-extensions-api`: * Long Polling extensions now are deprecated in this project. It was replaced into `TelegramBotAPI-extensions-utils` + * Several `telegramBot` functions was renamed into `telegramBotWithCustomClientConfig` * `TelegramBotAPI-extensions-utils`: * Extension `toTelegramUpdate` was added * Long Polling extensions were added diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotBuilder.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotBuilder.kt index 083db9a41e..fc8a7f8856 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotBuilder.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotBuilder.kt @@ -33,7 +33,7 @@ data class BotBuilder internal constructor( } /** - * @return Created by [telegramBot] function [RequestsExecutor]. This executor will be preconfigured using [token] and + * @return Created by [telegramBotWithCustomClientConfig] function [RequestsExecutor]. This executor will be preconfigured using [token] and * [block] */ fun telegramBot( diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotExtensions.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotExtensions.kt index 44514ddeae..ef586bcae8 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotExtensions.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/BotExtensions.kt @@ -22,7 +22,7 @@ fun telegramBot( * Allows to create bot using bot [urlsKeeper] and specify [HttpClientEngine] by passing [clientEngine] param and optionally * configure [HttpClient] using [clientConfig] */ -fun telegramBot( +fun telegramBotWithCustomClientConfig( urlsKeeper: TelegramAPIUrlsKeeper, clientEngine: HttpClientEngine, clientConfig: HttpClientConfig<*>.() -> Unit = {} @@ -34,7 +34,7 @@ fun telegramBot( /** * Allows to create bot using bot [urlsKeeper] and optionally configure [HttpClient] using [clientConfig] */ -fun telegramBot( +fun telegramBotWithCustomClientConfig( urlsKeeper: TelegramAPIUrlsKeeper, clientConfig: HttpClientConfig<*>.() -> Unit = {} ): RequestsExecutor = telegramBot( @@ -47,7 +47,7 @@ fun telegramBot( */ fun telegramBot( token: String -): RequestsExecutor = telegramBot(TelegramAPIUrlsKeeper(token)) +): RequestsExecutor = telegramBotWithCustomClientConfig(TelegramAPIUrlsKeeper(token)) /** * Allows to create bot using bot [token] and already prepared [client] @@ -60,10 +60,10 @@ fun telegramBot( /** * Allows to create bot using bot [token] and configure [HttpClient] using [clientConfig] */ -fun telegramBot( +fun telegramBotWithCustomClientConfig( token: String, clientConfig: HttpClientConfig<*>.() -> Unit -): RequestsExecutor = telegramBot(TelegramAPIUrlsKeeper(token), clientConfig) +): RequestsExecutor = telegramBotWithCustomClientConfig(TelegramAPIUrlsKeeper(token), clientConfig) /** * Allows to create bot using bot [token] and specify [HttpClientEngine] by passing [clientEngine] param and optionally @@ -73,4 +73,4 @@ fun telegramBot( token: String, clientEngine: HttpClientEngine, clientConfig: HttpClientConfig<*>.() -> Unit = {} -): RequestsExecutor = telegramBot(TelegramAPIUrlsKeeper(token), clientEngine, clientConfig) +): RequestsExecutor = telegramBotWithCustomClientConfig(TelegramAPIUrlsKeeper(token), clientEngine, clientConfig)