diff --git a/CHANGELOG.md b/CHANGELOG.md index a915a9742f..72e725d6a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # TelegramBotAPI changelog +## 0.30.10 + +* `Common`: + * `Version`: + * `Kotlin`: `1.4.20` -> `1.4.21` + * `Klock`: `2.0.0` -> `2.0.1` + * `Ktor`: `1.4.2` -> `1.4.3` + * `MicroUtils`: `0.4.6` -> `0.4.11` +* `API Extensions`: + * New function `buildBot` + ## 0.30.9 * `Common`: diff --git a/docs/gradle.properties b/docs/gradle.properties index 55021b5f4e..b5322eae27 100644 --- a/docs/gradle.properties +++ b/docs/gradle.properties @@ -1,3 +1,3 @@ -dokka_version=1.4.0 +dokka_version=1.4.20 org.gradle.jvmargs=-Xmx1024m diff --git a/gradle.properties b/gradle.properties index 5f8c040fbe..717d1a7045 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,18 +5,18 @@ kotlin.js.generate.externals=true kotlin.incremental=true kotlin.incremental.js=true -kotlin_version=1.4.20 +kotlin_version=1.4.21 kotlin_coroutines_version=1.4.2 kotlin_serialisation_runtime_version=1.0.1 -klock_version=2.0.0 +klock_version=2.0.1 uuid_version=0.2.3 -ktor_version=1.4.2 +ktor_version=1.4.3 -micro_utils_version=0.4.6 +micro_utils_version=0.4.11 javax_activation_version=1.1.1 library_group=dev.inmo -library_version=0.30.9 +library_version=0.30.10 github_release_plugin_version=2.2.12 diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotBuilder.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotBuilder.kt index 9e64ded426..9e3c3dd8f5 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotBuilder.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/BotBuilder.kt @@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.extensions.api import dev.inmo.tgbotapi.bot.TelegramBot import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper +import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl import io.ktor.client.HttpClient import io.ktor.client.HttpClientConfig import io.ktor.client.engine.* @@ -36,10 +37,25 @@ data class BotBuilder internal constructor( * @return Created by [telegramBotWithCustomClientConfig] function [TelegramBot]. This executor will be preconfigured using [token] and * [block] */ +fun buildBot( + token: String, + apiUrl: String = telegramBotAPIDefaultUrl, + block: BotBuilder.() -> Unit +) = telegramBot( + TelegramAPIUrlsKeeper(token, apiUrl), + BotBuilder().apply(block).createHttpClient() +) + +/** + * @return Created by [telegramBotWithCustomClientConfig] function [TelegramBot]. This executor will be preconfigured using [token] and + * [block] + */ +@Deprecated("Renamed", ReplaceWith("buildBot", "dev.inmo.tgbotapi.extensions.api.buildBot")) fun telegramBot( token: String, block: BotBuilder.() -> Unit -): TelegramBot = telegramBot( - TelegramAPIUrlsKeeper(token), - BotBuilder().apply(block).createHttpClient() +): TelegramBot = buildBot( + token, + telegramBotAPIDefaultUrl, + block )