2020-10-04 11:06:30 +00:00
|
|
|
package dev.inmo.tgbotapi.bot.Ktor
|
2018-12-26 08:07:24 +00:00
|
|
|
|
2020-11-17 10:06:25 +00:00
|
|
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
2020-10-04 11:06:30 +00:00
|
|
|
import dev.inmo.tgbotapi.utils.*
|
2018-12-26 08:07:24 +00:00
|
|
|
|
2021-08-09 17:22:08 +00:00
|
|
|
@RiskFeature
|
2022-04-21 15:57:11 +00:00
|
|
|
@Deprecated("Replaced", ReplaceWith("createTelegramBotDefaultKtorCallRequestsFactories", "dev.inmo.tgbotapi.bot.ktor.createTelegramBotDefaultKtorCallRequestsFactories"))
|
|
|
|
fun createTelegramBotDefaultKtorCallRequestsFactories() = dev.inmo.tgbotapi.bot.ktor.createTelegramBotDefaultKtorCallRequestsFactories()
|
2021-08-09 17:22:08 +00:00
|
|
|
|
2022-04-21 15:57:11 +00:00
|
|
|
@Deprecated("Replaced", ReplaceWith("KtorRequestsExecutor", "dev.inmo.tgbotapi.bot.ktor.KtorRequestsExecutor"))
|
|
|
|
typealias KtorRequestsExecutor = dev.inmo.tgbotapi.bot.ktor.KtorRequestsExecutor
|
2022-04-21 15:48:25 +00:00
|
|
|
|
2022-04-21 15:57:11 +00:00
|
|
|
@Deprecated("Replaced", ReplaceWith("KtorRequestsExecutorBuilder", "dev.inmo.tgbotapi.bot.ktor.KtorRequestsExecutorBuilder"))
|
|
|
|
typealias KtorRequestsExecutorBuilder = dev.inmo.tgbotapi.bot.ktor.KtorRequestsExecutorBuilder
|
2022-04-21 15:48:25 +00:00
|
|
|
|
2022-04-21 15:57:11 +00:00
|
|
|
@Deprecated("telegramBot", ReplaceWith("createTelegramBotDefaultKtorCallRequestsFactories", "dev.inmo.tgbotapi.bot.ktor.telegramBot"))
|
2022-04-21 15:48:25 +00:00
|
|
|
inline fun telegramBot(
|
|
|
|
telegramAPIUrlsKeeper: TelegramAPIUrlsKeeper,
|
|
|
|
builder: KtorRequestsExecutorBuilder.() -> Unit = {}
|
2022-04-21 15:57:11 +00:00
|
|
|
): TelegramBot = dev.inmo.tgbotapi.bot.ktor.telegramBot(telegramAPIUrlsKeeper, builder)
|
2022-04-21 15:48:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Shortcut for [telegramBot]
|
|
|
|
*/
|
|
|
|
@Suppress("NOTHING_TO_INLINE")
|
2022-04-21 15:57:11 +00:00
|
|
|
@Deprecated("telegramBot", ReplaceWith("createTelegramBotDefaultKtorCallRequestsFactories", "dev.inmo.tgbotapi.bot.ktor.telegramBot"))
|
2022-04-21 15:48:25 +00:00
|
|
|
inline fun telegramBot(
|
|
|
|
token: String,
|
|
|
|
apiUrl: String = telegramBotAPIDefaultUrl,
|
2022-05-02 07:21:43 +00:00
|
|
|
testServer: Boolean = false,
|
2022-04-21 15:48:25 +00:00
|
|
|
builder: KtorRequestsExecutorBuilder.() -> Unit = {}
|
2022-05-02 07:21:43 +00:00
|
|
|
): TelegramBot = telegramBot(TelegramAPIUrlsKeeper(token, testServer, apiUrl), builder)
|